diff --git a/README.md b/README.md index abd1d95..4eeb803 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/example/lib/example_pages/age_page.dart b/example/lib/example_pages/age_page.dart index ef7178d..c80e3c9 100644 --- a/example/lib/example_pages/age_page.dart +++ b/example/lib/example_pages/age_page.dart @@ -8,7 +8,7 @@ class AgePage extends StatefulWidget { super.key, }); - final ShellFormInputNumberPickerController inputController; + final FlutterFormInputNumberPickerController inputController; @override State createState() => _AgePageState(); @@ -26,8 +26,8 @@ class _AgePageState extends State { title: "What is your age?", pageNumber: 1, amountOfPages: 3, - shellFormWidgets: [ - ShellFormInputNumberPicker( + FlutterFormWidgets: [ + FlutterFormInputNumberPicker( minValue: 12, maxValue: 120, controller: widget.inputController, diff --git a/example/lib/example_pages/carousel_page.dart b/example/lib/example_pages/carousel_page.dart index 8d7d8e7..da4c67e 100644 --- a/example/lib/example_pages/carousel_page.dart +++ b/example/lib/example_pages/carousel_page.dart @@ -9,7 +9,7 @@ class CarouselPage extends StatefulWidget { super.key, }); - final ShellFormInputCarouselController inputController; + final FlutterFormInputCarouselController inputController; final List> cars; @override @@ -28,8 +28,8 @@ class _CarouselPageState extends State { title: "What's your favorite car?", pageNumber: 3, amountOfPages: 3, - shellFormWidgets: [ - ShellFormInputCarousel( + FlutterFormWidgets: [ + FlutterFormInputCarousel( controller: widget.inputController, items: getCars()) ], ); diff --git a/example/lib/example_pages/name_page.dart b/example/lib/example_pages/name_page.dart index b617a2b..4892b7e 100644 --- a/example/lib/example_pages/name_page.dart +++ b/example/lib/example_pages/name_page.dart @@ -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 { 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 { if (widget.showLastName) Padding( padding: const EdgeInsets.fromLTRB(40, 0, 40, 0), - child: ShellFormInputPlainText( + child: FlutterFormInputPlainText( label: const Text("Last Name"), controller: widget.lastNameController, ), diff --git a/example/lib/form_example.dart b/example/lib/form_example.dart index db19523..d729ad2 100644 --- a/example/lib/form_example.dart +++ b/example/lib/form_example.dart @@ -15,18 +15,18 @@ class FormExample extends ConsumerStatefulWidget { } class _FormExampleState extends ConsumerState { - 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> cars = [ { @@ -43,8 +43,8 @@ class _FormExampleState extends ConsumerState { }, ]; - ShellFormInputPlainTextController firstNameController = - ShellFormInputPlainTextController( + FlutterFormInputPlainTextController firstNameController = + FlutterFormInputPlainTextController( mandatory: true, id: "firstName", checkPageTitle: (dynamic firstName) { @@ -52,8 +52,8 @@ class _FormExampleState extends ConsumerState { }, ); - ShellFormInputPlainTextController lastNameController = - ShellFormInputPlainTextController( + FlutterFormInputPlainTextController lastNameController = + FlutterFormInputPlainTextController( mandatory: true, id: "lastName", checkPageTitle: (dynamic lastName) { @@ -64,7 +64,7 @@ class _FormExampleState extends ConsumerState { @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 { body: Center( child: FlutterForm( formController: formController, - options: ShellFormOptions( + options: FlutterFormOptions( onFinished: (Map> results) { debugPrint("Final full results: $results"); Navigator.of(context).pushNamed('/thanks'); @@ -172,19 +172,19 @@ class _FormExampleState extends ConsumerState { 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, diff --git a/example/lib/template_page.dart b/example/lib/template_page.dart index f34749c..db7f6db 100644 --- a/example/lib/template_page.dart +++ b/example/lib/template_page.dart @@ -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 shellFormWidgets; + final List 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( diff --git a/lib/next_shell/form.dart b/lib/next_shell/form.dart index 55149cf..01dc684 100644 --- a/lib/next_shell/form.dart +++ b/lib/next_shell/form.dart @@ -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 pages; +class FlutterFormOptions { + final List pages; final CheckPage? checkPage; final Widget Function(int pageNumber, bool checkingPages)? nextButton; @@ -24,7 +24,7 @@ class ShellFormOptions { final void Function(Map>) onFinished; final void Function(int pageNumber, Map) 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. diff --git a/lib/src/form.dart b/lib/src/form.dart index bd8d82a..5013200 100644 --- a/lib/src/form.dart +++ b/lib/src/form.dart @@ -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> 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 createState() => _ShellFormState(); + ConsumerState createState() => _FlutterFormState(); } -class _ShellFormState extends ConsumerState { - late ShellFormController _formController; +class _FlutterFormState extends ConsumerState { + late FlutterFormController _formController; @override void initState() { @@ -200,11 +200,11 @@ class _ShellFormState extends ConsumerState { _formController = widget.formController; - _formController.setShellFormOptions(widget.options); + _formController.setFlutterFormOptions(widget.options); List> keys = []; - for (ShellFormPage _ in widget.options.pages) { + for (FlutterFormPage _ in widget.options.pages) { keys.add(GlobalKey()); } @@ -214,10 +214,10 @@ class _ShellFormState extends ConsumerState { setState(() {}); }); - List controllers = []; + List 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 { _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 { } } -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 _formPageControllers; + late List _formPageControllers; - List getFormPageControllers() { + List getFormPageControllers() { return _formPageControllers; } - setFormPageControllers(List controllers) { + setFormPageControllers(List controllers) { _formPageControllers = controllers; } @@ -544,7 +544,7 @@ class ShellFormController extends ChangeNotifier { return allValues; } - setShellFormOptions(ShellFormOptions options) { + setFlutterFormOptions(FlutterFormOptions options) { _options = options; } diff --git a/lib/src/utils/form_page_controller.dart b/lib/src/utils/form_page_controller.dart index 2ee77cb..2a1cd7b 100644 --- a/lib/src/utils/form_page_controller.dart +++ b/lib/src/utils/form_page_controller.dart @@ -1,9 +1,9 @@ import 'package:flutter_form/flutter_form.dart'; -class ShellFormPageController { - List _controllers = []; +class FlutterFormPageController { + List _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 getAllValues() { Map values = {}; - for (ShellFormInputController controller in _controllers) { + for (FlutterFormInputController controller in _controllers) { if (controller.value != null) { values.addAll({controller.id!: controller.value}); } diff --git a/lib/src/utils/formstate.dart b/lib/src/utils/formstate.dart index 75be64e..afd0056 100644 --- a/lib/src/utils/formstate.dart +++ b/lib/src/utils/formstate.dart @@ -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 = diff --git a/lib/src/widgets/input/abstractions.dart b/lib/src/widgets/input/abstractions.dart index d49a4cb..7cbf871 100644 --- a/lib/src/widgets/input/abstractions.dart +++ b/lib/src/widgets/input/abstractions.dart @@ -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 { +abstract class FlutterFormInputController { String? id; T? value; bool mandatory = false; diff --git a/lib/src/widgets/input/input_types/input_carousel/input_carousel.dart b/lib/src/widgets/input/input_types/input_carousel/input_carousel.dart index 119a1eb..bea21f4 100644 --- a/lib/src/widgets/input/input_types/input_carousel/input_carousel.dart +++ b/lib/src/widgets/input/input_types/input_carousel/input_carousel.dart @@ -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 { - ShellFormInputCarouselController({ +/// Mainly used by [FlutterFormInputCarousel]. +class FlutterFormInputCarouselController + implements FlutterFormInputController { + FlutterFormInputCarouselController({ required this.id, this.mandatory = true, this.value, diff --git a/lib/src/widgets/input/input_types/input_email.dart b/lib/src/widgets/input/input_types/input_email.dart index bbb281a..e23c9b6 100644 --- a/lib/src/widgets/input/input_types/input_email.dart +++ b/lib/src/widgets/input/input_types/input_email.dart @@ -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 { - ShellFormInputEmailController({ +/// Mainly used by [FlutterFormInputEmail]. +class FlutterFormInputEmailController + implements FlutterFormInputController { + FlutterFormInputEmailController({ required this.id, this.mandatory = true, this.value, diff --git a/lib/src/widgets/input/input_types/input_number_picker/input_number_picker.dart b/lib/src/widgets/input/input_types/input_number_picker/input_number_picker.dart index f548307..47b0b4f 100644 --- a/lib/src/widgets/input/input_types/input_number_picker/input_number_picker.dart +++ b/lib/src/widgets/input/input_types/input_number_picker/input_number_picker.dart @@ -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 { }); } -class ShellFormInputNumberPickerController - implements ShellFormInputController { - ShellFormInputNumberPickerController({ +class FlutterFormInputNumberPickerController + implements FlutterFormInputController { + FlutterFormInputNumberPickerController({ required this.id, this.mandatory = true, this.value, diff --git a/lib/src/widgets/input/input_types/input_password/input_password.dart b/lib/src/widgets/input/input_types/input_password/input_password.dart index 2c3b82a..0f7b46d 100644 --- a/lib/src/widgets/input/input_types/input_password/input_password.dart +++ b/lib/src/widgets/input/input_types/input_password/input_password.dart @@ -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 { - ShellFormInputPasswordController({ +/// Mainly used by [FlutterFormInputPassword]. +class FlutterFormInputPasswordController + implements FlutterFormInputController { + FlutterFormInputPasswordController({ required this.id, this.mandatory = true, this.value, diff --git a/lib/src/widgets/input/input_types/input_password/password.dart b/lib/src/widgets/input/input_types/input_password/password.dart index 19d5473..9ef1df1 100644 --- a/lib/src/widgets/input/input_types/input_password/password.dart +++ b/lib/src/widgets/input/input_types/input_password/password.dart @@ -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, diff --git a/lib/src/widgets/input/input_types/input_plain_text.dart b/lib/src/widgets/input/input_types/input_plain_text.dart index 3c0ad87..91b193f 100644 --- a/lib/src/widgets/input/input_types/input_plain_text.dart +++ b/lib/src/widgets/input/input_types/input_plain_text.dart @@ -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 { - ShellFormInputPlainTextController({ +/// Mainly used by [FlutterFormInputPlainText]. +class FlutterFormInputPlainTextController + implements FlutterFormInputController { + FlutterFormInputPlainTextController({ required this.id, this.mandatory = false, this.value, diff --git a/lib/src/widgets/input/input_types/input_slider/input_slider.dart b/lib/src/widgets/input/input_types/input_slider/input_slider.dart index 943ea1b..9c7446b 100644 --- a/lib/src/widgets/input/input_types/input_slider/input_slider.dart +++ b/lib/src/widgets/input/input_types/input_slider/input_slider.dart @@ -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 { - ShellFormInputSliderController({ +/// Mainly used by [FlutterFormInputSlider]. +class FlutterFormInputSliderController + implements FlutterFormInputController { + FlutterFormInputSliderController({ required this.id, this.mandatory = true, this.value,