mirror of
https://github.com/Iconica-Development/flutter_form_wizard.git
synced 2025-05-19 10:53:49 +02:00
Replaced ShellForm with FlutterForm
This commit is contained in:
parent
cade46ecfe
commit
fa6994cee5
18 changed files with 139 additions and 139 deletions
|
@ -18,7 +18,7 @@ To use this package, add `flutter_form` as a [dependency in your pubspec.yaml fi
|
|||
|
||||
See the [Example Code](example/lib/form_example.dart) for an example on how to use this package.
|
||||
|
||||
WARNING Make sure to define your ShellFormInputControllers above your Flutter Form and not inside each page. This prevents that the used controllers differ from the registered ones.
|
||||
WARNING Make sure to define your FlutterFormInputControllers above your Flutter Form and not inside each page. This prevents that the used controllers differ from the registered ones.
|
||||
|
||||
Flutter Form has two paramaters: options and formController. Each of these parameters' own parameters will be explained in tabels below.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class AgePage extends StatefulWidget {
|
|||
super.key,
|
||||
});
|
||||
|
||||
final ShellFormInputNumberPickerController inputController;
|
||||
final FlutterFormInputNumberPickerController inputController;
|
||||
|
||||
@override
|
||||
State<AgePage> createState() => _AgePageState();
|
||||
|
@ -26,8 +26,8 @@ class _AgePageState extends State<AgePage> {
|
|||
title: "What is your age?",
|
||||
pageNumber: 1,
|
||||
amountOfPages: 3,
|
||||
shellFormWidgets: [
|
||||
ShellFormInputNumberPicker(
|
||||
FlutterFormWidgets: [
|
||||
FlutterFormInputNumberPicker(
|
||||
minValue: 12,
|
||||
maxValue: 120,
|
||||
controller: widget.inputController,
|
||||
|
|
|
@ -9,7 +9,7 @@ class CarouselPage extends StatefulWidget {
|
|||
super.key,
|
||||
});
|
||||
|
||||
final ShellFormInputCarouselController inputController;
|
||||
final FlutterFormInputCarouselController inputController;
|
||||
final List<Map<String, dynamic>> cars;
|
||||
|
||||
@override
|
||||
|
@ -28,8 +28,8 @@ class _CarouselPageState extends State<CarouselPage> {
|
|||
title: "What's your favorite car?",
|
||||
pageNumber: 3,
|
||||
amountOfPages: 3,
|
||||
shellFormWidgets: [
|
||||
ShellFormInputCarousel(
|
||||
FlutterFormWidgets: [
|
||||
FlutterFormInputCarousel(
|
||||
controller: widget.inputController, items: getCars())
|
||||
],
|
||||
);
|
||||
|
|
|
@ -10,8 +10,8 @@ class NamePage extends StatefulWidget {
|
|||
super.key,
|
||||
});
|
||||
|
||||
final ShellFormInputPlainTextController firstNameController;
|
||||
final ShellFormInputPlainTextController lastNameController;
|
||||
final FlutterFormInputPlainTextController firstNameController;
|
||||
final FlutterFormInputPlainTextController lastNameController;
|
||||
final bool showLastName;
|
||||
|
||||
@override
|
||||
|
@ -30,10 +30,10 @@ class _NamePageState extends State<NamePage> {
|
|||
pageNumber: 2,
|
||||
amountOfPages: 3,
|
||||
title: "Please enter your name",
|
||||
shellFormWidgets: [
|
||||
FlutterFormWidgets: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(40, 0, 40, 40),
|
||||
child: ShellFormInputPlainText(
|
||||
child: FlutterFormInputPlainText(
|
||||
label: const Text("First Name"),
|
||||
controller: widget.firstNameController,
|
||||
),
|
||||
|
@ -41,7 +41,7 @@ class _NamePageState extends State<NamePage> {
|
|||
if (widget.showLastName)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(40, 0, 40, 0),
|
||||
child: ShellFormInputPlainText(
|
||||
child: FlutterFormInputPlainText(
|
||||
label: const Text("Last Name"),
|
||||
controller: widget.lastNameController,
|
||||
),
|
||||
|
|
|
@ -15,18 +15,18 @@ class FormExample extends ConsumerStatefulWidget {
|
|||
}
|
||||
|
||||
class _FormExampleState extends ConsumerState<FormExample> {
|
||||
final ShellFormController formController = ShellFormController();
|
||||
final FlutterFormController formController = FlutterFormController();
|
||||
|
||||
final String checkPageText = "All entered info: ";
|
||||
|
||||
final ageInputController = ShellFormInputNumberPickerController(
|
||||
final ageInputController = FlutterFormInputNumberPickerController(
|
||||
id: "age",
|
||||
checkPageTitle: (dynamic amount) {
|
||||
return "Age: $amount years";
|
||||
},
|
||||
);
|
||||
|
||||
late final ShellFormInputCarouselController carouselInputController;
|
||||
late final FlutterFormInputCarouselController carouselInputController;
|
||||
|
||||
final List<Map<String, dynamic>> cars = [
|
||||
{
|
||||
|
@ -43,8 +43,8 @@ class _FormExampleState extends ConsumerState<FormExample> {
|
|||
},
|
||||
];
|
||||
|
||||
ShellFormInputPlainTextController firstNameController =
|
||||
ShellFormInputPlainTextController(
|
||||
FlutterFormInputPlainTextController firstNameController =
|
||||
FlutterFormInputPlainTextController(
|
||||
mandatory: true,
|
||||
id: "firstName",
|
||||
checkPageTitle: (dynamic firstName) {
|
||||
|
@ -52,8 +52,8 @@ class _FormExampleState extends ConsumerState<FormExample> {
|
|||
},
|
||||
);
|
||||
|
||||
ShellFormInputPlainTextController lastNameController =
|
||||
ShellFormInputPlainTextController(
|
||||
FlutterFormInputPlainTextController lastNameController =
|
||||
FlutterFormInputPlainTextController(
|
||||
mandatory: true,
|
||||
id: "lastName",
|
||||
checkPageTitle: (dynamic lastName) {
|
||||
|
@ -64,7 +64,7 @@ class _FormExampleState extends ConsumerState<FormExample> {
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
carouselInputController = ShellFormInputCarouselController(
|
||||
carouselInputController = FlutterFormInputCarouselController(
|
||||
id: 'carCarousel',
|
||||
checkPageTitle: (dynamic index) {
|
||||
return cars[index]["title"];
|
||||
|
@ -88,7 +88,7 @@ class _FormExampleState extends ConsumerState<FormExample> {
|
|||
body: Center(
|
||||
child: FlutterForm(
|
||||
formController: formController,
|
||||
options: ShellFormOptions(
|
||||
options: FlutterFormOptions(
|
||||
onFinished: (Map<int, Map<String, dynamic>> results) {
|
||||
debugPrint("Final full results: $results");
|
||||
Navigator.of(context).pushNamed('/thanks');
|
||||
|
@ -172,19 +172,19 @@ class _FormExampleState extends ConsumerState<FormExample> {
|
|||
return Container();
|
||||
},
|
||||
pages: [
|
||||
ShellFormPage(
|
||||
FlutterFormPage(
|
||||
child: AgePage(
|
||||
inputController: ageInputController,
|
||||
),
|
||||
),
|
||||
ShellFormPage(
|
||||
FlutterFormPage(
|
||||
child: NamePage(
|
||||
firstNameController: firstNameController,
|
||||
lastNameController: lastNameController,
|
||||
showLastName: showLastName,
|
||||
),
|
||||
),
|
||||
ShellFormPage(
|
||||
FlutterFormPage(
|
||||
child: CarouselPage(
|
||||
inputController: carouselInputController,
|
||||
cars: cars,
|
||||
|
|
|
@ -8,7 +8,7 @@ class TemplatePage extends StatelessWidget {
|
|||
required this.title,
|
||||
required this.pageNumber,
|
||||
required this.amountOfPages,
|
||||
required this.shellFormWidgets,
|
||||
required this.FlutterFormWidgets,
|
||||
});
|
||||
|
||||
final Size size;
|
||||
|
@ -16,7 +16,7 @@ class TemplatePage extends StatelessWidget {
|
|||
final String title;
|
||||
final int pageNumber;
|
||||
final int amountOfPages;
|
||||
final List<Widget> shellFormWidgets;
|
||||
final List<Widget> FlutterFormWidgets;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -54,7 +54,7 @@ class TemplatePage extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
const Spacer(),
|
||||
for (var widget in shellFormWidgets) ...[
|
||||
for (var widget in FlutterFormWidgets) ...[
|
||||
widget,
|
||||
],
|
||||
const Spacer(
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
/// The options used to set parameters to a [ShellForm].
|
||||
/// The options used to set parameters to a [FlutterForm].
|
||||
///
|
||||
/// The pages determine what pages the pageview will contain via a [List] of [ShellFormPage]s.
|
||||
/// The pages determine what pages the pageview will contain via a [List] of [FlutterFormPage]s.
|
||||
///
|
||||
/// Using a checkpage gives the ability for the user to check all input values before commiting by [CheckPage].
|
||||
/// If [checkPage] is null no check page will be shown.
|
||||
///
|
||||
/// [nextButton] and [backButton] are both a way to give controls to user.
|
||||
/// Both are just plain widgets used in a [Stack]. So the widgets can be aligned where ever.
|
||||
/// The formcontroller of [ShellForm] should be used to give control to the widgets/buttons.
|
||||
/// The formcontroller of [FlutterForm] should be used to give control to the widgets/buttons.
|
||||
///
|
||||
/// [onFinished] and [onNext] are both callbacks which give the users results.
|
||||
/// [onNext] is called when the user goes to the next page.
|
||||
/// [onFinished] is called when the form is finished. When checkpage is set [onFinished] is called when the checkpage is finished.
|
||||
class ShellFormOptions {
|
||||
final List<ShellFormPage> pages;
|
||||
class FlutterFormOptions {
|
||||
final List<FlutterFormPage> pages;
|
||||
|
||||
final CheckPage? checkPage;
|
||||
final Widget Function(int pageNumber, bool checkingPages)? nextButton;
|
||||
|
@ -24,7 +24,7 @@ class ShellFormOptions {
|
|||
final void Function(Map<int, Map<String, dynamic>>) onFinished;
|
||||
final void Function(int pageNumber, Map<String, dynamic>) onNext;
|
||||
|
||||
const ShellFormOptions({
|
||||
const FlutterFormOptions({
|
||||
required this.pages,
|
||||
this.checkPage,
|
||||
this.nextButton,
|
||||
|
@ -34,16 +34,16 @@ class ShellFormOptions {
|
|||
});
|
||||
}
|
||||
|
||||
/// The defines every page in a [ShellForm].
|
||||
class ShellFormPage {
|
||||
/// The defines every page in a [FlutterForm].
|
||||
class FlutterFormPage {
|
||||
final Widget child;
|
||||
|
||||
ShellFormPage({
|
||||
FlutterFormPage({
|
||||
required this.child,
|
||||
});
|
||||
}
|
||||
|
||||
/// [CheckPage] is used to set a check page at the end of a [ShellForm].
|
||||
/// [CheckPage] is used to set a check page at the end of a [FlutterForm].
|
||||
/// A [CheckPage] is a page where the user can check all input values before commiting.
|
||||
///
|
||||
/// [title] is the widget shown at the top of the page.
|
||||
|
|
|
@ -9,20 +9,20 @@ import 'utils/formstate.dart' as fs;
|
|||
/// A wrapper for flutters [Form] that can be controlled by a controller and provides multiple pre-defined input types/fields
|
||||
/// [FlutterForm] also provides multi page forms and a check page for validation.
|
||||
///
|
||||
/// A [ShellFormController] has to be given to control what happens to values and pages within the ShellForm.
|
||||
/// A [FlutterFormController] has to be given to control what happens to values and pages within the FlutterForm.
|
||||
///
|
||||
/// [ShellFormOptions] have to be provided to control the appearance of the form.
|
||||
/// [FlutterFormOptions] have to be provided to control the appearance of the form.
|
||||
///
|
||||
/// WARNING Define your FormInputController above your FlutterForm. Otherwise when rebuild the controller will differ from the registered ones.
|
||||
/// ``` dart
|
||||
/// ShellFormInputEmailController emailController =
|
||||
/// ShellFormInputEmailController(id: 'email');
|
||||
/// ShellFormInputPasswordController passwordController =
|
||||
/// ShellFormInputPasswordController(id: 'password');
|
||||
/// FlutterFormInputEmailController emailController =
|
||||
/// FlutterFormInputEmailController(id: 'email');
|
||||
/// FlutterFormInputPasswordController passwordController =
|
||||
/// FlutterFormInputPasswordController(id: 'password');
|
||||
///
|
||||
/// ShellForm(
|
||||
/// formController: shellFormController,
|
||||
/// options: ShellFormOptions(
|
||||
/// FlutterForm(
|
||||
/// formController: FlutterFormController,
|
||||
/// options: FlutterFormOptions(
|
||||
/// onFinished: (Map<int, Map<String, dynamic>> results) {
|
||||
/// // print(results);
|
||||
/// },
|
||||
|
@ -38,7 +38,7 @@ import 'utils/formstate.dart' as fs;
|
|||
/// ),
|
||||
/// child: ElevatedButton(
|
||||
/// onPressed: () {
|
||||
/// shellFormController.autoNextStep();
|
||||
/// FlutterFormController.autoNextStep();
|
||||
/// },
|
||||
/// child: Text(checkingPages ? "Save" : "Next Page"),
|
||||
/// ),
|
||||
|
@ -54,7 +54,7 @@ import 'utils/formstate.dart' as fs;
|
|||
/// padding: EdgeInsets.zero,
|
||||
/// splashRadius: 29,
|
||||
/// onPressed: () {
|
||||
/// shellFormController.previousStep();
|
||||
/// FlutterFormController.previousStep();
|
||||
/// },
|
||||
/// icon: const Icon(Icons.chevron_left),
|
||||
/// ),
|
||||
|
@ -64,7 +64,7 @@ import 'utils/formstate.dart' as fs;
|
|||
/// return Container();
|
||||
/// },
|
||||
/// pages: [
|
||||
/// ShellFormPage(
|
||||
/// FlutterFormPage(
|
||||
/// child: Column(
|
||||
/// mainAxisAlignment: MainAxisAlignment.center,
|
||||
/// children: [
|
||||
|
@ -90,11 +90,11 @@ import 'utils/formstate.dart' as fs;
|
|||
/// ),
|
||||
/// ),
|
||||
/// const Spacer(),
|
||||
/// ShellFormInputEmail(controller: emailController),
|
||||
/// FlutterFormInputEmail(controller: emailController),
|
||||
/// const SizedBox(
|
||||
/// height: 25,
|
||||
/// ),
|
||||
/// ShellFormInputPassword(controller: passwordController),
|
||||
/// FlutterFormInputPassword(controller: passwordController),
|
||||
/// const Spacer(),
|
||||
/// ],
|
||||
/// ),
|
||||
|
@ -184,15 +184,15 @@ class FlutterForm extends ConsumerStatefulWidget {
|
|||
required this.formController,
|
||||
}) : super(key: key);
|
||||
|
||||
final ShellFormOptions options;
|
||||
final ShellFormController formController;
|
||||
final FlutterFormOptions options;
|
||||
final FlutterFormController formController;
|
||||
|
||||
@override
|
||||
ConsumerState<FlutterForm> createState() => _ShellFormState();
|
||||
ConsumerState<FlutterForm> createState() => _FlutterFormState();
|
||||
}
|
||||
|
||||
class _ShellFormState extends ConsumerState<FlutterForm> {
|
||||
late ShellFormController _formController;
|
||||
class _FlutterFormState extends ConsumerState<FlutterForm> {
|
||||
late FlutterFormController _formController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -200,11 +200,11 @@ class _ShellFormState extends ConsumerState<FlutterForm> {
|
|||
|
||||
_formController = widget.formController;
|
||||
|
||||
_formController.setShellFormOptions(widget.options);
|
||||
_formController.setFlutterFormOptions(widget.options);
|
||||
|
||||
List<GlobalKey<FormState>> keys = [];
|
||||
|
||||
for (ShellFormPage _ in widget.options.pages) {
|
||||
for (FlutterFormPage _ in widget.options.pages) {
|
||||
keys.add(GlobalKey<FormState>());
|
||||
}
|
||||
|
||||
|
@ -214,10 +214,10 @@ class _ShellFormState extends ConsumerState<FlutterForm> {
|
|||
setState(() {});
|
||||
});
|
||||
|
||||
List<ShellFormPageController> controllers = [];
|
||||
List<FlutterFormPageController> controllers = [];
|
||||
|
||||
for (int i = 0; i < widget.options.pages.length; i++) {
|
||||
controllers.add(ShellFormPageController());
|
||||
controllers.add(FlutterFormPageController());
|
||||
}
|
||||
|
||||
_formController.setFormPageControllers(controllers);
|
||||
|
@ -304,7 +304,7 @@ class _ShellFormState extends ConsumerState<FlutterForm> {
|
|||
_formController.getAllResults().forEach(
|
||||
(pageNumber, pageResults) {
|
||||
pageResults.forEach((inputId, inputResult) {
|
||||
ShellFormInputController? inputController = _formController
|
||||
FlutterFormInputController? inputController = _formController
|
||||
.getFormPageControllers()[pageNumber]
|
||||
.getController(inputId);
|
||||
|
||||
|
@ -406,8 +406,8 @@ class _ShellFormState extends ConsumerState<FlutterForm> {
|
|||
}
|
||||
}
|
||||
|
||||
class ShellFormController extends ChangeNotifier {
|
||||
late ShellFormOptions _options;
|
||||
class FlutterFormController extends ChangeNotifier {
|
||||
late FlutterFormOptions _options;
|
||||
|
||||
int _currentStep = 0;
|
||||
|
||||
|
@ -417,13 +417,13 @@ class ShellFormController extends ChangeNotifier {
|
|||
|
||||
final PageController _pageController = PageController();
|
||||
|
||||
late List<ShellFormPageController> _formPageControllers;
|
||||
late List<FlutterFormPageController> _formPageControllers;
|
||||
|
||||
List<ShellFormPageController> getFormPageControllers() {
|
||||
List<FlutterFormPageController> getFormPageControllers() {
|
||||
return _formPageControllers;
|
||||
}
|
||||
|
||||
setFormPageControllers(List<ShellFormPageController> controllers) {
|
||||
setFormPageControllers(List<FlutterFormPageController> controllers) {
|
||||
_formPageControllers = controllers;
|
||||
}
|
||||
|
||||
|
@ -544,7 +544,7 @@ class ShellFormController extends ChangeNotifier {
|
|||
return allValues;
|
||||
}
|
||||
|
||||
setShellFormOptions(ShellFormOptions options) {
|
||||
setFlutterFormOptions(FlutterFormOptions options) {
|
||||
_options = options;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:flutter_form/flutter_form.dart';
|
||||
|
||||
class ShellFormPageController {
|
||||
List<ShellFormInputController> _controllers = [];
|
||||
class FlutterFormPageController {
|
||||
List<FlutterFormInputController> _controllers = [];
|
||||
|
||||
void register(ShellFormInputController inputController) {
|
||||
void register(FlutterFormInputController inputController) {
|
||||
_controllers.add(inputController);
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ class ShellFormPageController {
|
|||
return _controllers.any((element) => (element.id == id));
|
||||
}
|
||||
|
||||
ShellFormInputController? getController(String key) {
|
||||
FlutterFormInputController? getController(String key) {
|
||||
if (_isRegisteredById(key)) {
|
||||
return _controllers.firstWhere((element) => element.id == key);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class ShellFormPageController {
|
|||
Map<String, dynamic> getAllValues() {
|
||||
Map<String, dynamic> values = {};
|
||||
|
||||
for (ShellFormInputController controller in _controllers) {
|
||||
for (FlutterFormInputController controller in _controllers) {
|
||||
if (controller.value != null) {
|
||||
values.addAll({controller.id!: controller.value});
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class FormState extends InheritedWidget {
|
|||
required this.formController,
|
||||
}) : super(key: key, child: child);
|
||||
|
||||
final ShellFormPageController formController;
|
||||
final FlutterFormPageController formController;
|
||||
|
||||
static FormState of(BuildContext context) {
|
||||
final FormState? result =
|
||||
|
|
|
@ -2,25 +2,25 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '/src/utils/formstate.dart' as fs;
|
||||
|
||||
/// Abstract class for the input widgets used in a [ShellForm].
|
||||
/// Abstract class for the input widgets used in a [FlutterForm].
|
||||
///
|
||||
/// The controller [ShellFormInputController] has to be given to the widget.
|
||||
/// The controller [FlutterFormInputController] has to be given to the widget.
|
||||
/// Whicht controller is used determines how to value will be handled.
|
||||
///
|
||||
/// label is a standard parameter to normally sets the label of the input.
|
||||
abstract class ShellFormInputWidget extends ConsumerWidget {
|
||||
const ShellFormInputWidget({
|
||||
abstract class FlutterFormInputWidget extends ConsumerWidget {
|
||||
const FlutterFormInputWidget({
|
||||
Key? key,
|
||||
required this.controller,
|
||||
this.label,
|
||||
String? hintText,
|
||||
}) : super(key: key);
|
||||
|
||||
final ShellFormInputController controller;
|
||||
final FlutterFormInputController controller;
|
||||
final Widget? label;
|
||||
|
||||
registerController(BuildContext context) {
|
||||
ShellFormInputController? localController =
|
||||
FlutterFormInputController? localController =
|
||||
fs.FormState.of(context).formController.getController(controller.id!);
|
||||
|
||||
if (localController == null) {
|
||||
|
@ -29,9 +29,9 @@ abstract class ShellFormInputWidget extends ConsumerWidget {
|
|||
}
|
||||
}
|
||||
|
||||
/// Abstract class for the controller for inputs used in a [ShellForm].
|
||||
/// Abstract class for the controller for inputs used in a [FlutterForm].
|
||||
///
|
||||
/// The [id] determines the key in the [Map] returned by the [ShellForm].
|
||||
/// The [id] determines the key in the [Map] returned by the [FlutterForm].
|
||||
///
|
||||
/// [value] is a way to set a initial value.
|
||||
///
|
||||
|
@ -49,7 +49,7 @@ abstract class ShellFormInputWidget extends ConsumerWidget {
|
|||
///
|
||||
/// [checkPageDescription] is the same as checkPageTitle but for the description.
|
||||
/// If null no description will be shown.
|
||||
abstract class ShellFormInputController<T> {
|
||||
abstract class FlutterFormInputController<T> {
|
||||
String? id;
|
||||
T? value;
|
||||
bool mandatory = false;
|
||||
|
|
|
@ -10,11 +10,11 @@ import 'carousel_form.dart';
|
|||
///
|
||||
/// [items] will be the [Widget]s to be displayed in the carousel.
|
||||
///
|
||||
/// Standard controller is [ShellFormInputCarouselController].
|
||||
class ShellFormInputCarousel extends ShellFormInputWidget {
|
||||
const ShellFormInputCarousel({
|
||||
/// Standard controller is [FlutterFormInputCarouselController].
|
||||
class FlutterFormInputCarousel extends FlutterFormInputWidget {
|
||||
const FlutterFormInputCarousel({
|
||||
Key? key,
|
||||
required ShellFormInputController controller,
|
||||
required FlutterFormInputController controller,
|
||||
Widget? label,
|
||||
required this.items,
|
||||
}) : super(key: key, controller: controller, label: label);
|
||||
|
@ -37,12 +37,12 @@ class ShellFormInputCarousel extends ShellFormInputWidget {
|
|||
}
|
||||
}
|
||||
|
||||
/// Controller for the carousel used by a [ShellFormInputWidget] used in a [FlutterForm].
|
||||
/// Controller for the carousel used by a [FlutterFormInputWidget] used in a [FlutterForm].
|
||||
///
|
||||
/// Mainly used by [ShellFormInputCarousel].
|
||||
class ShellFormInputCarouselController
|
||||
implements ShellFormInputController<int> {
|
||||
ShellFormInputCarouselController({
|
||||
/// Mainly used by [FlutterFormInputCarousel].
|
||||
class FlutterFormInputCarouselController
|
||||
implements FlutterFormInputController<int> {
|
||||
FlutterFormInputCarouselController({
|
||||
required this.id,
|
||||
this.mandatory = true,
|
||||
this.value,
|
||||
|
|
|
@ -6,11 +6,11 @@ import '../../../../flutter_form.dart';
|
|||
|
||||
/// Input for an email used in a [FlutterForm].
|
||||
///
|
||||
/// Standard controller is [ShellFormInputEmailController].
|
||||
class ShellFormInputEmail extends ShellFormInputWidget {
|
||||
const ShellFormInputEmail({
|
||||
/// Standard controller is [FlutterFormInputEmailController].
|
||||
class FlutterFormInputEmail extends FlutterFormInputWidget {
|
||||
const FlutterFormInputEmail({
|
||||
Key? key,
|
||||
required ShellFormInputController controller,
|
||||
required FlutterFormInputController controller,
|
||||
Widget? label,
|
||||
}) : super(
|
||||
key: key,
|
||||
|
@ -39,12 +39,12 @@ class ShellFormInputEmail extends ShellFormInputWidget {
|
|||
}
|
||||
}
|
||||
|
||||
/// Controller for emails used by a [ShellFormInputWidget] used in a [FlutterForm].
|
||||
/// Controller for emails used by a [FlutterFormInputWidget] used in a [FlutterForm].
|
||||
///
|
||||
/// Mainly used by [ShellFormInputEmail].
|
||||
class ShellFormInputEmailController
|
||||
implements ShellFormInputController<String> {
|
||||
ShellFormInputEmailController({
|
||||
/// Mainly used by [FlutterFormInputEmail].
|
||||
class FlutterFormInputEmailController
|
||||
implements FlutterFormInputController<String> {
|
||||
FlutterFormInputEmailController({
|
||||
required this.id,
|
||||
this.mandatory = true,
|
||||
this.value,
|
||||
|
|
|
@ -5,10 +5,10 @@ import 'package:flutter_form/next_shell/translation_service.dart';
|
|||
|
||||
import 'numberpicker.dart';
|
||||
|
||||
class ShellFormInputNumberPicker extends ShellFormInputWidget {
|
||||
const ShellFormInputNumberPicker({
|
||||
class FlutterFormInputNumberPicker extends FlutterFormInputWidget {
|
||||
const FlutterFormInputNumberPicker({
|
||||
Key? key,
|
||||
required ShellFormInputController controller,
|
||||
required FlutterFormInputController controller,
|
||||
Widget? label,
|
||||
this.minValue = 0,
|
||||
this.maxValue = 100,
|
||||
|
@ -65,9 +65,9 @@ class NumberPickerFormField extends FormField<int> {
|
|||
});
|
||||
}
|
||||
|
||||
class ShellFormInputNumberPickerController
|
||||
implements ShellFormInputController<int> {
|
||||
ShellFormInputNumberPickerController({
|
||||
class FlutterFormInputNumberPickerController
|
||||
implements FlutterFormInputController<int> {
|
||||
FlutterFormInputNumberPickerController({
|
||||
required this.id,
|
||||
this.mandatory = true,
|
||||
this.value,
|
||||
|
|
|
@ -5,11 +5,11 @@ import '../../../../../flutter_form.dart';
|
|||
|
||||
/// Input for a password used in a [FlutterForm].
|
||||
///
|
||||
/// Standard controller is [ShellFormInputEmailController].
|
||||
class ShellFormInputPassword extends ShellFormInputWidget {
|
||||
const ShellFormInputPassword({
|
||||
/// Standard controller is [FlutterFormInputEmailController].
|
||||
class FlutterFormInputPassword extends FlutterFormInputWidget {
|
||||
const FlutterFormInputPassword({
|
||||
Key? key,
|
||||
required ShellFormInputController controller,
|
||||
required FlutterFormInputController controller,
|
||||
Widget? label,
|
||||
}) : super(key: key, controller: controller, label: label);
|
||||
|
||||
|
@ -24,12 +24,12 @@ class ShellFormInputPassword extends ShellFormInputWidget {
|
|||
}
|
||||
}
|
||||
|
||||
/// Controller for passwords used by a [ShellFormInputWidget] used in a [ShellFrom].
|
||||
/// Controller for passwords used by a [FlutterFormInputWidget] used in a [ShellFrom].
|
||||
///
|
||||
/// Mainly used by [ShellFormInputPassword].
|
||||
class ShellFormInputPasswordController
|
||||
implements ShellFormInputController<String> {
|
||||
ShellFormInputPasswordController({
|
||||
/// Mainly used by [FlutterFormInputPassword].
|
||||
class FlutterFormInputPasswordController
|
||||
implements FlutterFormInputController<String> {
|
||||
FlutterFormInputPasswordController({
|
||||
required this.id,
|
||||
this.mandatory = true,
|
||||
this.value,
|
||||
|
|
|
@ -3,11 +3,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import '../../../../../flutter_form.dart';
|
||||
import 'package:flutter_form/next_shell/translation_service.dart';
|
||||
|
||||
/// Generates a [TextFormField] for passwords. It requires a [ShellFormInputController]
|
||||
/// Generates a [TextFormField] for passwords. It requires a [FlutterFormInputController]
|
||||
/// as the [controller] parameter and an optional [Widget] as [label]
|
||||
class PasswordTextField extends ConsumerStatefulWidget {
|
||||
final Widget? label;
|
||||
final ShellFormInputController controller;
|
||||
final FlutterFormInputController controller;
|
||||
|
||||
const PasswordTextField({
|
||||
Key? key,
|
||||
|
|
|
@ -6,11 +6,11 @@ import 'package:flutter_form/next_shell/translation_service.dart';
|
|||
|
||||
/// Input for plain text input used in a [FlutterForm].
|
||||
///
|
||||
/// Standard controller is [ShellFormInputPlainTextController].
|
||||
class ShellFormInputPlainText extends ShellFormInputWidget {
|
||||
const ShellFormInputPlainText({
|
||||
/// Standard controller is [FlutterFormInputPlainTextController].
|
||||
class FlutterFormInputPlainText extends FlutterFormInputWidget {
|
||||
const FlutterFormInputPlainText({
|
||||
Key? key,
|
||||
required ShellFormInputController controller,
|
||||
required FlutterFormInputController controller,
|
||||
Widget? label,
|
||||
}) : super(key: key, controller: controller, label: label);
|
||||
|
||||
|
@ -34,11 +34,11 @@ class ShellFormInputPlainText extends ShellFormInputWidget {
|
|||
|
||||
/// Input for an plain text with extra styling used in a [FlutterForm].
|
||||
///
|
||||
/// Standard controller is [ShellFormInputPlainTextController].
|
||||
class ShellFormInputPlainTextWhiteWithBorder extends ShellFormInputWidget {
|
||||
const ShellFormInputPlainTextWhiteWithBorder({
|
||||
/// Standard controller is [FlutterFormInputPlainTextController].
|
||||
class FlutterFormInputPlainTextWhiteWithBorder extends FlutterFormInputWidget {
|
||||
const FlutterFormInputPlainTextWhiteWithBorder({
|
||||
Key? key,
|
||||
required ShellFormInputController controller,
|
||||
required FlutterFormInputController controller,
|
||||
Widget? label,
|
||||
this.hint,
|
||||
}) : super(key: key, controller: controller, label: label);
|
||||
|
@ -73,12 +73,12 @@ class ShellFormInputPlainTextWhiteWithBorder extends ShellFormInputWidget {
|
|||
}
|
||||
}
|
||||
|
||||
/// Controller for plain text used by a [ShellFormInputWidget] used in a [FlutterForm].
|
||||
/// Controller for plain text used by a [FlutterFormInputWidget] used in a [FlutterForm].
|
||||
///
|
||||
/// Mainly used by [ShellFormInputPlainText].
|
||||
class ShellFormInputPlainTextController
|
||||
implements ShellFormInputController<String> {
|
||||
ShellFormInputPlainTextController({
|
||||
/// Mainly used by [FlutterFormInputPlainText].
|
||||
class FlutterFormInputPlainTextController
|
||||
implements FlutterFormInputController<String> {
|
||||
FlutterFormInputPlainTextController({
|
||||
required this.id,
|
||||
this.mandatory = false,
|
||||
this.value,
|
||||
|
|
|
@ -7,11 +7,11 @@ import '../../../../../flutter_form.dart';
|
|||
|
||||
/// Input for a number value between two values via a slider. Used in a [FlutterForm].
|
||||
///
|
||||
/// Standard controller is [ShellFormInputSliderController].
|
||||
class ShellFormInputSlider extends ShellFormInputWidget {
|
||||
const ShellFormInputSlider({
|
||||
/// Standard controller is [FlutterFormInputSliderController].
|
||||
class FlutterFormInputSlider extends FlutterFormInputWidget {
|
||||
const FlutterFormInputSlider({
|
||||
Key? key,
|
||||
required ShellFormInputController controller,
|
||||
required FlutterFormInputController controller,
|
||||
Widget? label,
|
||||
this.minValue = 0,
|
||||
this.maxValue = 100,
|
||||
|
@ -35,12 +35,12 @@ class ShellFormInputSlider extends ShellFormInputWidget {
|
|||
}
|
||||
}
|
||||
|
||||
/// Controller for slider used by a [ShellFormInputWidget] used in a [FlutterForm].
|
||||
/// Controller for slider used by a [FlutterFormInputWidget] used in a [FlutterForm].
|
||||
///
|
||||
/// Mainly used by [ShellFormInputSlider].
|
||||
class ShellFormInputSliderController
|
||||
implements ShellFormInputController<double> {
|
||||
ShellFormInputSliderController({
|
||||
/// Mainly used by [FlutterFormInputSlider].
|
||||
class FlutterFormInputSliderController
|
||||
implements FlutterFormInputController<double> {
|
||||
FlutterFormInputSliderController({
|
||||
required this.id,
|
||||
this.mandatory = true,
|
||||
this.value,
|
||||
|
|
Loading…
Reference in a new issue