From 927a01948d780164716041db122c21690e95b3de Mon Sep 17 00:00:00 2001 From: Vasiliy Ditsyak Date: Sat, 14 Dec 2024 18:04:22 +0100 Subject: [PATCH] array itemBuilder control --- .github/workflows/donate_action.yaml | 2 +- .github/workflows/pr-check-annotation.yml | 8 +- .github/workflows/pr-check-example.yml | 8 +- .github/workflows/pr-check-generator-test.yml | 6 +- .github/workflows/pr-check-generator.yml | 8 +- .../test/doc/array_nullable_test.dart | 765 +++--------------- .../test/doc/delivery_list_test.dart | 28 +- .../reactive_forms_generator/CHANGELOG.md | 4 + .../example/ios/Runner/AppDelegate.swift | 2 +- .../lib/docs/animated_url_list/url.gform.dart | 10 +- .../animated_url_list/url_output.gform.dart | 10 +- .../docs/annotateless/annotateless.gform.dart | 3 + .../annotateless_output.gform.dart | 3 + .../array_nullable/array_nullable.gform.dart | 3 + .../array_nullable/array_nullable_form.dart | 8 +- .../delivery_list/delivery_list.gform.dart | 6 + .../lib/docs/freezed/freezed_class.gform.dart | 3 + .../freezed/freezed_class_output.gform.dart | 3 + .../example/lib/docs/freezed2/test.gform.dart | 10 +- .../lib/docs/generic/generic.gform.dart | 10 +- .../generic_status_list.gform.dart | 3 + .../example/lib/docs/group/group.gform.dart | 10 +- .../example/lib/docs/login/login.gform.dart | 10 +- .../lib/docs/login/login_output.gform.dart | 10 +- .../login_extended/login_extended.gform.dart | 3 + .../login_extended_output.gform.dart | 3 + .../login_extended_nullable.gform.dart | 3 + .../login_extended_nullable_output.gform.dart | 3 + .../docs/mailing_list/mailing_list.gform.dart | 3 + .../docs/mailing_list/mailing_list_form.dart | 7 +- .../model_extends/model_extends.gform.dart | 3 + .../model_implements.gform.dart | 3 + .../example/lib/docs/nested/nested.gform.dart | 23 +- .../docs/nested_generics/product.gform.dart | 13 +- .../lib/docs/profile/profile.gform.dart | 3 + .../renamed_basic/renamed_basic.gform.dart | 3 + .../renamed_basic_output.gform.dart | 3 + .../docs/user_profile/user_profile.gform.dart | 3 + .../user_profile_output.gform.dart | 3 + .../reactive_form_array_builder.dart | 3 +- .../reactive_forms_generator/pubspec.yaml | 2 +- 41 files changed, 324 insertions(+), 693 deletions(-) diff --git a/.github/workflows/donate_action.yaml b/.github/workflows/donate_action.yaml index 90a8aa26..a0005160 100644 --- a/.github/workflows/donate_action.yaml +++ b/.github/workflows/donate_action.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Comment on issue uses: actions/github-script@v5 diff --git a/.github/workflows/pr-check-annotation.yml b/.github/workflows/pr-check-annotation.yml index 260f1ace..31c3368b 100644 --- a/.github/workflows/pr-check-annotation.yml +++ b/.github/workflows/pr-check-annotation.yml @@ -16,16 +16,16 @@ jobs: steps: - name: Setup Flutter - uses: subosito/flutter-action@v2.10.0 + uses: subosito/flutter-action@v2 with: - flutter-version: 3.19.5 + flutter-version: 3.24.5 channel: stable cache: true - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: reactive_forms_annotations => analyze - run: cd packages/reactive_forms_annotations && flutter pub get && flutter analyze + run: cd packages/reactive_forms_annotations && flutter pub get && flutter analyze --no-fatal-infos - name: reactive_forms_annotations => code formatting run: cd packages/reactive_forms_annotations && flutter pub get && dart format --set-exit-if-changed lib \ No newline at end of file diff --git a/.github/workflows/pr-check-example.yml b/.github/workflows/pr-check-example.yml index 9f1975a8..a8e498a3 100644 --- a/.github/workflows/pr-check-example.yml +++ b/.github/workflows/pr-check-example.yml @@ -16,19 +16,19 @@ jobs: steps: - name: Setup Flutter - uses: subosito/flutter-action@v2.10.0 + uses: subosito/flutter-action@v2 with: - flutter-version: 3.19.5 + flutter-version: 3.24.5 channel: stable cache: true - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: reactive_forms_generator => example => build_runner run: cd packages/reactive_forms_generator/example && flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs - name: reactive_forms_generator => example => analyze - run: cd packages/reactive_forms_generator/example && flutter pub get && flutter analyze + run: cd packages/reactive_forms_generator/example && flutter pub get && flutter analyze --no-fatal-infos # - name: reactive_forms_generator => example => code formatting # run: cd packages/reactive_forms_generator/example && flutter pub get && dart format --set-exit-if-changed lib diff --git a/.github/workflows/pr-check-generator-test.yml b/.github/workflows/pr-check-generator-test.yml index 1d47d753..169fbdbf 100644 --- a/.github/workflows/pr-check-generator-test.yml +++ b/.github/workflows/pr-check-generator-test.yml @@ -16,13 +16,13 @@ jobs: steps: - name: Setup Flutter - uses: subosito/flutter-action@v2.10.0 + uses: subosito/flutter-action@v2 with: - flutter-version: 3.19.5 + flutter-version: 3.24.5 channel: stable cache: true - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: reactive_forms_generator => Code generation tests run: cd packages/generator_tests && flutter pub get && dart test && cd ../ \ No newline at end of file diff --git a/.github/workflows/pr-check-generator.yml b/.github/workflows/pr-check-generator.yml index dddeea24..ac2c1cae 100644 --- a/.github/workflows/pr-check-generator.yml +++ b/.github/workflows/pr-check-generator.yml @@ -16,16 +16,16 @@ jobs: steps: - name: Setup Flutter - uses: subosito/flutter-action@v2.10.0 + uses: subosito/flutter-action@v2 with: - flutter-version: 3.19.5 + flutter-version: 3.24.5 channel: stable cache: true - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: reactive_forms_generator => analyze - run: cd packages/reactive_forms_generator && flutter pub get && flutter analyze + run: cd packages/reactive_forms_generator && flutter pub get && flutter analyze --no-fatal-infos - name: reactive_forms_generator => code formatting run: cd packages/reactive_forms_generator && flutter pub get && dart format --set-exit-if-changed lib \ No newline at end of file diff --git a/packages/generator_tests/test/doc/array_nullable_test.dart b/packages/generator_tests/test/doc/array_nullable_test.dart index c6b378f0..ed5d7ac6 100644 --- a/packages/generator_tests/test/doc/array_nullable_test.dart +++ b/packages/generator_tests/test/doc/array_nullable_test.dart @@ -58,14 +58,14 @@ const generatedFile = r'''// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark -part of 'array_nullable.dart'; +part of 'annotateless.dart'; // ************************************************************************** // ReactiveFormsGenerator // ************************************************************************** -class ReactiveArrayNullableFormConsumer extends StatelessWidget { - const ReactiveArrayNullableFormConsumer({ +class ReactiveAnnotatelessFormConsumer extends StatelessWidget { + const ReactiveAnnotatelessFormConsumer({ Key? key, required this.builder, this.child, @@ -74,21 +74,21 @@ class ReactiveArrayNullableFormConsumer extends StatelessWidget { final Widget? child; final Widget Function( - BuildContext context, ArrayNullableForm formModel, Widget? child) builder; + BuildContext context, AnnotatelessForm formModel, Widget? child) builder; @override Widget build(BuildContext context) { - final formModel = ReactiveArrayNullableForm.of(context); + final formModel = ReactiveAnnotatelessForm.of(context); - if (formModel is! ArrayNullableForm) { + if (formModel is! AnnotatelessForm) { throw FormControlParentNotFoundException(this); } return builder(context, formModel, child); } } -class ArrayNullableFormInheritedStreamer extends InheritedStreamer { - const ArrayNullableFormInheritedStreamer({ +class AnnotatelessFormInheritedStreamer extends InheritedStreamer { + const AnnotatelessFormInheritedStreamer({ Key? key, required this.form, required Stream stream, @@ -99,11 +99,11 @@ class ArrayNullableFormInheritedStreamer extends InheritedStreamer { key: key, ); - final ArrayNullableForm form; + final AnnotatelessForm form; } -class ReactiveArrayNullableForm extends StatelessWidget { - const ReactiveArrayNullableForm({ +class ReactiveAnnotatelessForm extends StatelessWidget { + const ReactiveAnnotatelessForm({ Key? key, required this.form, required this.child, @@ -113,33 +113,33 @@ class ReactiveArrayNullableForm extends StatelessWidget { final Widget child; - final ArrayNullableForm form; + final AnnotatelessForm form; final bool Function(FormGroup formGroup)? canPop; final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; - static ArrayNullableForm? of( + static AnnotatelessForm? of( BuildContext context, { bool listen = true, }) { if (listen) { return context .dependOnInheritedWidgetOfExactType< - ArrayNullableFormInheritedStreamer>() + AnnotatelessFormInheritedStreamer>() ?.form; } final element = context.getElementForInheritedWidgetOfExactType< - ArrayNullableFormInheritedStreamer>(); + AnnotatelessFormInheritedStreamer>(); return element == null ? null - : (element.widget as ArrayNullableFormInheritedStreamer).form; + : (element.widget as AnnotatelessFormInheritedStreamer).form; } @override Widget build(BuildContext context) { - return ArrayNullableFormInheritedStreamer( + return AnnotatelessFormInheritedStreamer( form: form, stream: form.form.statusChanged, child: ReactiveFormPopScope( @@ -151,16 +151,16 @@ class ReactiveArrayNullableForm extends StatelessWidget { } } -extension ReactiveReactiveArrayNullableFormExt on BuildContext { - ArrayNullableForm? arrayNullableFormWatch() => - ReactiveArrayNullableForm.of(this); +extension ReactiveReactiveAnnotatelessFormExt on BuildContext { + AnnotatelessForm? annotatelessFormWatch() => + ReactiveAnnotatelessForm.of(this); - ArrayNullableForm? arrayNullableFormRead() => - ReactiveArrayNullableForm.of(this, listen: false); + AnnotatelessForm? annotatelessFormRead() => + ReactiveAnnotatelessForm.of(this, listen: false); } -class ArrayNullableFormBuilder extends StatefulWidget { - const ArrayNullableFormBuilder({ +class AnnotatelessFormBuilder extends StatefulWidget { + const AnnotatelessFormBuilder({ Key? key, this.model, this.child, @@ -170,7 +170,7 @@ class ArrayNullableFormBuilder extends StatefulWidget { this.initState, }) : super(key: key); - final ArrayNullable? model; + final Annotateless? model; final Widget? child; @@ -179,23 +179,25 @@ class ArrayNullableFormBuilder extends StatefulWidget { final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; final Widget Function( - BuildContext context, ArrayNullableForm formModel, Widget? child) builder; + BuildContext context, AnnotatelessForm formModel, Widget? child) builder; - final void Function(BuildContext context, ArrayNullableForm formModel)? + final void Function(BuildContext context, AnnotatelessForm formModel)? initState; @override - _ArrayNullableFormBuilderState createState() => - _ArrayNullableFormBuilderState(); + _AnnotatelessFormBuilderState createState() => + _AnnotatelessFormBuilderState(); } -class _ArrayNullableFormBuilderState extends State { - late ArrayNullableForm _formModel; +class _AnnotatelessFormBuilderState extends State { + late AnnotatelessForm _formModel; + + StreamSubscription? _logSubscription; @override void initState() { _formModel = - ArrayNullableForm(ArrayNullableForm.formElements(widget.model), null); + AnnotatelessForm(AnnotatelessForm.formElements(widget.model), null); if (_formModel.form.disabled) { _formModel.form.markAsDisabled(); @@ -203,7 +205,7 @@ class _ArrayNullableFormBuilderState extends State { widget.initState?.call(context, _formModel); - _logArrayNullableForm.onRecord.listen((LogRecord e) { + _logSubscription = _logAnnotatelessForm.onRecord.listen((LogRecord e) { // use `dumpErrorToConsole` for severe messages to ensure that severe // exceptions are formatted consistently with other Flutter examples and // avoids printing duplicate exceptions @@ -235,7 +237,7 @@ class _ArrayNullableFormBuilderState extends State { } @override - void didUpdateWidget(covariant ArrayNullableFormBuilder oldWidget) { + void didUpdateWidget(covariant AnnotatelessFormBuilder oldWidget) { if (widget.model != oldWidget.model) { _formModel.updateValue(widget.model); } @@ -246,12 +248,13 @@ class _ArrayNullableFormBuilderState extends State { @override void dispose() { _formModel.form.dispose(); + _logSubscription?.cancel(); super.dispose(); } @override Widget build(BuildContext context) { - return ReactiveArrayNullableForm( + return ReactiveAnnotatelessForm( key: ObjectKey(_formModel), form: _formModel, // canPop: widget.canPop, @@ -268,23 +271,17 @@ class _ArrayNullableFormBuilderState extends State { } } -final _logArrayNullableForm = Logger('ArrayNullableForm'); +final _logAnnotatelessForm = Logger.detached('AnnotatelessForm'); -class ArrayNullableForm implements FormModel { - ArrayNullableForm( +class AnnotatelessForm implements FormModel { + AnnotatelessForm( this.form, this.path, ); - static const String emailListControlName = "emailList"; - - static const String fruitListControlName = "fruitList"; - - static const String vegetablesListControlName = "vegetablesList"; - - static const String modeListControlName = "modeList"; + static const String emailControlName = "email"; - static const String someListControlName = "someList"; + static const String passwordControlName = "password"; final FormGroup form; @@ -292,614 +289,150 @@ class ArrayNullableForm implements FormModel { final Map _disabled = {}; - String someListControlPath() => pathBuilder(someListControlName); - - String emailListControlPath() => pathBuilder(emailListControlName); - - String fruitListControlPath() => pathBuilder(fruitListControlName); - - String vegetablesListControlPath() => pathBuilder(vegetablesListControlName); - - String modeListControlPath() => pathBuilder(modeListControlName); + String emailControlPath() => pathBuilder(emailControlName); - List? get _someListValue => someListControl?.value; - - List get _emailListValue => - emailListControl.value?.whereType().toList() ?? []; - - List get _fruitListValue => - fruitListControl.value?.whereType().toList() ?? []; - - List? get _vegetablesListValue => - vegetablesListControl?.value?.whereType().toList() ?? []; - - List? get _modeListValue => - modeListControl?.value?.whereType().toList() ?? []; - - bool get containsSomeList { - try { - form.control(someListControlPath()); - return true; - } catch (e) { - return false; - } - } + String passwordControlPath() => pathBuilder(passwordControlName); - bool get containsEmailList { - try { - form.control(emailListControlPath()); - return true; - } catch (e) { - return false; - } - } + String get _emailValue => emailControl.value ?? ""; - bool get containsFruitList { - try { - form.control(fruitListControlPath()); - return true; - } catch (e) { - return false; - } - } + String get _passwordValue => passwordControl.value ?? ""; - bool get containsVegetablesList { + bool get containsEmail { try { - form.control(vegetablesListControlPath()); + form.control(emailControlPath()); return true; } catch (e) { return false; } } - bool get containsModeList { + bool get containsPassword { try { - form.control(modeListControlPath()); + form.control(passwordControlPath()); return true; } catch (e) { return false; } } - Map? get someListErrors => someListControl?.errors; - - Map get emailListErrors => emailListControl.errors; - - Map get fruitListErrors => fruitListControl.errors; - - Map? get vegetablesListErrors => - vegetablesListControl?.errors; - - Map? get modeListErrors => modeListControl?.errors; - - void get someListFocus => form.focus(someListControlPath()); - - void get emailListFocus => form.focus(emailListControlPath()); - - void get fruitListFocus => form.focus(fruitListControlPath()); - - void get vegetablesListFocus => form.focus(vegetablesListControlPath()); - - void get modeListFocus => form.focus(modeListControlPath()); - - void someListRemove({ - bool updateParent = true, - bool emitEvent = true, - }) { - if (containsSomeList) { - final controlPath = path; - if (controlPath == null) { - form.removeControl( - someListControlName, - updateParent: updateParent, - emitEvent: emitEvent, - ); - } else { - final formGroup = form.control(controlPath); - - if (formGroup is FormGroup) { - formGroup.removeControl( - someListControlName, - updateParent: updateParent, - emitEvent: emitEvent, - ); - } - } - } - } - - void vegetablesListRemove({ - bool updateParent = true, - bool emitEvent = true, - }) { - if (containsVegetablesList) { - final controlPath = path; - if (controlPath == null) { - form.removeControl( - vegetablesListControlName, - updateParent: updateParent, - emitEvent: emitEvent, - ); - } else { - final formGroup = form.control(controlPath); - - if (formGroup is FormGroup) { - formGroup.removeControl( - vegetablesListControlName, - updateParent: updateParent, - emitEvent: emitEvent, - ); - } - } - } - } - - void modeListRemove({ - bool updateParent = true, - bool emitEvent = true, - }) { - if (containsModeList) { - final controlPath = path; - if (controlPath == null) { - form.removeControl( - modeListControlName, - updateParent: updateParent, - emitEvent: emitEvent, - ); - } else { - final formGroup = form.control(controlPath); - - if (formGroup is FormGroup) { - formGroup.removeControl( - modeListControlName, - updateParent: updateParent, - emitEvent: emitEvent, - ); - } - } - } - } - - void someListValueUpdate( - List? value, { - bool updateParent = true, - bool emitEvent = true, - }) { - someListControl?.updateValue(value, - updateParent: updateParent, emitEvent: emitEvent); - } - - void emailListValueUpdate( - List value, { - bool updateParent = true, - bool emitEvent = true, - }) { - emailListControl.updateValue(value, - updateParent: updateParent, emitEvent: emitEvent); - } - - void fruitListValueUpdate( - List value, { - bool updateParent = true, - bool emitEvent = true, - }) { - fruitListControl.updateValue(value, - updateParent: updateParent, emitEvent: emitEvent); - } + Map get emailErrors => emailControl.errors; - void vegetablesListValueUpdate( - List? value, { - bool updateParent = true, - bool emitEvent = true, - }) { - vegetablesListControl?.updateValue(value, - updateParent: updateParent, emitEvent: emitEvent); - } + Map get passwordErrors => passwordControl.errors; - void modeListValueUpdate( - List? value, { - bool updateParent = true, - bool emitEvent = true, - }) { - modeListControl?.updateValue(value, - updateParent: updateParent, emitEvent: emitEvent); - } + void get emailFocus => form.focus(emailControlPath()); - void someListValuePatch( - List? value, { - bool updateParent = true, - bool emitEvent = true, - }) { - someListControl?.patchValue(value, - updateParent: updateParent, emitEvent: emitEvent); - } + void get passwordFocus => form.focus(passwordControlPath()); - void emailListValuePatch( - List value, { + void emailValueUpdate( + String value, { bool updateParent = true, bool emitEvent = true, }) { - emailListControl.patchValue(value, + emailControl.updateValue(value, updateParent: updateParent, emitEvent: emitEvent); } - void fruitListValuePatch( - List value, { + void passwordValueUpdate( + String value, { bool updateParent = true, bool emitEvent = true, }) { - fruitListControl.patchValue(value, + passwordControl.updateValue(value, updateParent: updateParent, emitEvent: emitEvent); } - void vegetablesListValuePatch( - List? value, { + void emailValuePatch( + String value, { bool updateParent = true, bool emitEvent = true, }) { - vegetablesListControl?.patchValue(value, + emailControl.patchValue(value, updateParent: updateParent, emitEvent: emitEvent); } - void modeListValuePatch( - List? value, { + void passwordValuePatch( + String value, { bool updateParent = true, bool emitEvent = true, }) { - modeListControl?.patchValue(value, + passwordControl.patchValue(value, updateParent: updateParent, emitEvent: emitEvent); } - void someListValueReset( - List? value, { - bool updateParent = true, - bool emitEvent = true, - bool removeFocus = false, - bool? disabled, - }) => - someListControl?.reset( - value: value, updateParent: updateParent, emitEvent: emitEvent); - - void emailListValueReset( - List value, { - bool updateParent = true, - bool emitEvent = true, - bool removeFocus = false, - bool? disabled, - }) => - emailListControl.reset( - value: value, updateParent: updateParent, emitEvent: emitEvent); - - void fruitListValueReset( - List value, { - bool updateParent = true, - bool emitEvent = true, - bool removeFocus = false, - bool? disabled, - }) => - fruitListControl.reset( - value: value, updateParent: updateParent, emitEvent: emitEvent); - - void vegetablesListValueReset( - List? value, { + void emailValueReset( + String value, { bool updateParent = true, bool emitEvent = true, bool removeFocus = false, bool? disabled, }) => - vegetablesListControl?.reset( + emailControl.reset( value: value, updateParent: updateParent, emitEvent: emitEvent); - void modeListValueReset( - List? value, { + void passwordValueReset( + String value, { bool updateParent = true, bool emitEvent = true, bool removeFocus = false, bool? disabled, }) => - modeListControl?.reset( + passwordControl.reset( value: value, updateParent: updateParent, emitEvent: emitEvent); - FormControl>? get someListControl => containsSomeList - ? form.control(someListControlPath()) as FormControl>? - : null; - - FormArray get emailListControl => - form.control(emailListControlPath()) as FormArray; - - FormArray get fruitListControl => - form.control(fruitListControlPath()) as FormArray; - - FormArray? get vegetablesListControl => containsVegetablesList - ? form.control(vegetablesListControlPath()) as FormArray? - : null; - - FormArray? get modeListControl => containsModeList - ? form.control(modeListControlPath()) as FormArray? - : null; - - List> get emailListControlControls => - emailListControl.controls.cast>(); - - List> get fruitListControlControls => - fruitListControl.controls.cast>(); - - List?> get vegetablesListControlControls => - containsVegetablesList - ? vegetablesListControl?.controls.cast?>() ?? [] - : []; - - List?> get modeListControlControls => containsModeList - ? modeListControl?.controls.cast?>() ?? [] - : []; - - void someListSetDisabled( - bool disabled, { - bool updateParent = true, - bool emitEvent = true, - }) { - if (disabled) { - someListControl?.markAsDisabled( - updateParent: updateParent, - emitEvent: emitEvent, - ); - } else { - someListControl?.markAsEnabled( - updateParent: updateParent, - emitEvent: emitEvent, - ); - } - } + FormControl get emailControl => + form.control(emailControlPath()) as FormControl; - void emailListSetDisabled( - bool disabled, { - bool updateParent = true, - bool emitEvent = true, - }) { - if (disabled) { - emailListControl.markAsDisabled( - updateParent: updateParent, - emitEvent: emitEvent, - ); - } else { - emailListControl.markAsEnabled( - updateParent: updateParent, - emitEvent: emitEvent, - ); - } - } + FormControl get passwordControl => + form.control(passwordControlPath()) as FormControl; - void fruitListSetDisabled( + void emailSetDisabled( bool disabled, { bool updateParent = true, bool emitEvent = true, }) { if (disabled) { - fruitListControl.markAsDisabled( + emailControl.markAsDisabled( updateParent: updateParent, emitEvent: emitEvent, ); } else { - fruitListControl.markAsEnabled( + emailControl.markAsEnabled( updateParent: updateParent, emitEvent: emitEvent, ); } } - void vegetablesListSetDisabled( + void passwordSetDisabled( bool disabled, { bool updateParent = true, bool emitEvent = true, }) { if (disabled) { - vegetablesListControl?.markAsDisabled( + passwordControl.markAsDisabled( updateParent: updateParent, emitEvent: emitEvent, ); } else { - vegetablesListControl?.markAsEnabled( + passwordControl.markAsEnabled( updateParent: updateParent, emitEvent: emitEvent, ); } } - void modeListSetDisabled( - bool disabled, { - bool updateParent = true, - bool emitEvent = true, - }) { - if (disabled) { - modeListControl?.markAsDisabled( - updateParent: updateParent, - emitEvent: emitEvent, - ); - } else { - modeListControl?.markAsEnabled( - updateParent: updateParent, - emitEvent: emitEvent, - ); - } - } - - void addEmailListItem( - String value, { - List>? asyncValidators, - List>? validators, - int? asyncValidatorsDebounceTime, - bool? disabled, - ValidatorsApplyMode validatorsApplyMode = ValidatorsApplyMode.merge, - }) { - List> resultingValidators = []; - List> resultingAsyncValidators = []; - - switch (validatorsApplyMode) { - case ValidatorsApplyMode.merge: - if (validators != null) { - resultingValidators.addAll(validators); - } - if (asyncValidators != null) { - resultingAsyncValidators.addAll(asyncValidators); - } - break; - case ValidatorsApplyMode.override: - if (validators != null) { - resultingValidators = validators; - } - - if (asyncValidators != null) { - resultingAsyncValidators = asyncValidators; - } - break; - } - - emailListControl.add(FormControl( - value: value, - validators: resultingValidators, - asyncValidators: resultingAsyncValidators, - asyncValidatorsDebounceTime: asyncValidatorsDebounceTime ?? 250, - disabled: disabled ?? false, - )); - } - - void addFruitListItem( - bool? value, { - List>? asyncValidators, - List>? validators, - int? asyncValidatorsDebounceTime, - bool? disabled, - ValidatorsApplyMode validatorsApplyMode = ValidatorsApplyMode.merge, - }) { - List> resultingValidators = []; - List> resultingAsyncValidators = []; - - switch (validatorsApplyMode) { - case ValidatorsApplyMode.merge: - if (validators != null) { - resultingValidators.addAll(validators); - } - if (asyncValidators != null) { - resultingAsyncValidators.addAll(asyncValidators); - } - break; - case ValidatorsApplyMode.override: - if (validators != null) { - resultingValidators = validators; - } - - if (asyncValidators != null) { - resultingAsyncValidators = asyncValidators; - } - break; - } - - fruitListControl.add(FormControl( - value: value, - validators: resultingValidators, - asyncValidators: resultingAsyncValidators, - asyncValidatorsDebounceTime: asyncValidatorsDebounceTime ?? 250, - disabled: disabled ?? false, - )); - } - - void addVegetablesListItem( - String? value, { - List>? asyncValidators, - List>? validators, - int? asyncValidatorsDebounceTime, - bool? disabled, - ValidatorsApplyMode validatorsApplyMode = ValidatorsApplyMode.merge, - }) { - List> resultingValidators = []; - List> resultingAsyncValidators = []; - - switch (validatorsApplyMode) { - case ValidatorsApplyMode.merge: - if (validators != null) { - resultingValidators.addAll(validators); - } - if (asyncValidators != null) { - resultingAsyncValidators.addAll(asyncValidators); - } - break; - case ValidatorsApplyMode.override: - if (validators != null) { - resultingValidators = validators; - } - - if (asyncValidators != null) { - resultingAsyncValidators = asyncValidators; - } - break; - } - - vegetablesListControl?.add(FormControl( - value: value, - validators: resultingValidators, - asyncValidators: resultingAsyncValidators, - asyncValidatorsDebounceTime: asyncValidatorsDebounceTime ?? 250, - disabled: disabled ?? false, - )); - } - - void addModeListItem( - UserMode? value, { - List>? asyncValidators, - List>? validators, - int? asyncValidatorsDebounceTime, - bool? disabled, - ValidatorsApplyMode validatorsApplyMode = ValidatorsApplyMode.merge, - }) { - List> resultingValidators = []; - List> resultingAsyncValidators = []; - - switch (validatorsApplyMode) { - case ValidatorsApplyMode.merge: - if (validators != null) { - resultingValidators.addAll(validators); - } - if (asyncValidators != null) { - resultingAsyncValidators.addAll(asyncValidators); - } - break; - case ValidatorsApplyMode.override: - if (validators != null) { - resultingValidators = validators; - } - - if (asyncValidators != null) { - resultingAsyncValidators = asyncValidators; - } - break; - } - - modeListControl?.add(FormControl( - value: value, - validators: resultingValidators, - asyncValidators: resultingAsyncValidators, - asyncValidatorsDebounceTime: asyncValidatorsDebounceTime ?? 250, - disabled: disabled ?? false, - )); - } - @override - ArrayNullable get model { + Annotateless get model { final isValid = !currentForm.hasErrors && currentForm.errors.isEmpty; if (!isValid) { - _logArrayNullableForm.warning( + _logAnnotatelessForm.warning( 'Avoid calling `model` on invalid form.Possible exceptions for non-nullable fields which should be guarded by `required` validator.', null, StackTrace.current, ); } - return ArrayNullable( - emailList: _emailListValue, - fruitList: _fruitListValue, - vegetablesList: _vegetablesListValue, - modeList: _modeListValue, - someList: _someListValue); + return Annotateless(email: _emailValue, password: _passwordValue); } @override @@ -935,28 +468,28 @@ class ArrayNullableForm implements FormModel { } @override - bool equalsTo(ArrayNullable? other) { + bool equalsTo(Annotateless? other) { final currentForm = this.currentForm; return const DeepCollectionEquality().equals( currentForm is FormControlCollection ? currentForm.rawValue : currentForm.value, - ArrayNullableForm.formElements(other).rawValue, + AnnotatelessForm.formElements(other).rawValue, ); } @override void submit({ - required void Function(ArrayNullable model) onValid, + required void Function(Annotateless model) onValid, void Function()? onNotValid, }) { currentForm.markAllAsTouched(); if (currentForm.valid) { onValid(model); } else { - _logArrayNullableForm.info('Errors'); - _logArrayNullableForm.info('┗━━ ${form.errors}'); + _logAnnotatelessForm.info('Errors'); + _logAnnotatelessForm.info('┗━━ ${form.errors}'); onNotValid?.call(); } } @@ -967,16 +500,16 @@ class ArrayNullableForm implements FormModel { @override void updateValue( - ArrayNullable? value, { + Annotateless? value, { bool updateParent = true, bool emitEvent = true, }) => - form.updateValue(ArrayNullableForm.formElements(value).rawValue, + form.updateValue(AnnotatelessForm.formElements(value).rawValue, updateParent: updateParent, emitEvent: emitEvent); @override void reset({ - ArrayNullable? value, + Annotateless? value, bool updateParent = true, bool emitEvent = true, }) => @@ -988,65 +521,16 @@ class ArrayNullableForm implements FormModel { String pathBuilder(String? pathItem) => [path, pathItem].whereType().join("."); - static FormGroup formElements(ArrayNullable? arrayNullable) => FormGroup({ - emailListControlName: FormArray( - (arrayNullable?.emailList ?? []) - .map((e) => FormControl( - value: e, - validators: [], - asyncValidators: [], - asyncValidatorsDebounceTime: 250, - disabled: false, - )) - .toList(), - validators: [RequiredValidator()], - asyncValidators: [], - asyncValidatorsDebounceTime: 250, - disabled: false), - fruitListControlName: FormArray( - (arrayNullable?.fruitList ?? []) - .map((e) => FormControl( - value: e, - validators: [], - asyncValidators: [], - asyncValidatorsDebounceTime: 250, - disabled: false, - )) - .toList(), + static FormGroup formElements(Annotateless? annotateless) => FormGroup({ + emailControlName: FormControl( + value: annotateless?.email, validators: [], asyncValidators: [], asyncValidatorsDebounceTime: 250, - disabled: false), - vegetablesListControlName: FormArray( - (arrayNullable?.vegetablesList ?? []) - .map((e) => FormControl( - value: e, - validators: [], - asyncValidators: [], - asyncValidatorsDebounceTime: 250, - disabled: false, - )) - .toList(), - validators: [], - asyncValidators: [], - asyncValidatorsDebounceTime: 250, - disabled: false), - modeListControlName: FormArray( - (arrayNullable?.modeList ?? []) - .map((e) => FormControl( - value: e, - validators: [], - asyncValidators: [], - asyncValidatorsDebounceTime: 250, - disabled: false, - )) - .toList(), - validators: [], - asyncValidators: [], - asyncValidatorsDebounceTime: 250, - disabled: false), - someListControlName: FormControl>( - value: arrayNullable?.someList, + disabled: false, + touched: false), + passwordControlName: FormControl( + value: annotateless?.password, validators: [], asyncValidators: [], asyncValidatorsDebounceTime: 250, @@ -1059,9 +543,9 @@ class ArrayNullableForm implements FormModel { disabled: false); } -class ReactiveArrayNullableFormArrayBuilder< - ReactiveArrayNullableFormArrayBuilderT> extends StatelessWidget { - const ReactiveArrayNullableFormArrayBuilder({ +class ReactiveAnnotatelessFormArrayBuilder< + ReactiveAnnotatelessFormArrayBuilderT> extends StatelessWidget { + const ReactiveAnnotatelessFormArrayBuilder({ Key? key, this.control, this.formControl, @@ -1071,29 +555,30 @@ class ReactiveArrayNullableFormArrayBuilder< "You have to specify `control` or `formControl`!"), super(key: key); - final FormArray? formControl; + final FormArray? formControl; - final FormArray? Function( - ArrayNullableForm formModel)? control; + final FormArray? Function( + AnnotatelessForm formModel)? control; final Widget Function(BuildContext context, List itemList, - ArrayNullableForm formModel)? builder; + AnnotatelessForm formModel)? builder; final Widget Function( BuildContext context, int i, - ReactiveArrayNullableFormArrayBuilderT? item, - ArrayNullableForm formModel) itemBuilder; + FormControl control, + ReactiveAnnotatelessFormArrayBuilderT? item, + AnnotatelessForm formModel) itemBuilder; @override Widget build(BuildContext context) { - final formModel = ReactiveArrayNullableForm.of(context); + final formModel = ReactiveAnnotatelessForm.of(context); if (formModel == null) { throw FormControlParentNotFoundException(this); } - return ReactiveFormArray( + return ReactiveFormArray( formArray: formControl ?? control?.call(formModel), builder: (context, formArray, child) { final values = formArray.controls.map((e) => e.value).toList(); @@ -1105,6 +590,8 @@ class ReactiveArrayNullableFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), @@ -1124,9 +611,9 @@ class ReactiveArrayNullableFormArrayBuilder< } } -class ReactiveArrayNullableFormFormGroupArrayBuilder< - ReactiveArrayNullableFormFormGroupArrayBuilderT> extends StatelessWidget { - const ReactiveArrayNullableFormFormGroupArrayBuilder({ +class ReactiveAnnotatelessFormFormGroupArrayBuilder< + ReactiveAnnotatelessFormFormGroupArrayBuilderT> extends StatelessWidget { + const ReactiveAnnotatelessFormFormGroupArrayBuilder({ Key? key, this.extended, this.getExtended, @@ -1137,24 +624,24 @@ class ReactiveArrayNullableFormFormGroupArrayBuilder< super(key: key); final ExtendedControl?>, - List>? extended; + List>? extended; final ExtendedControl?>, - List> - Function(ArrayNullableForm formModel)? getExtended; + List> + Function(AnnotatelessForm formModel)? getExtended; final Widget Function(BuildContext context, List itemList, - ArrayNullableForm formModel)? builder; + AnnotatelessForm formModel)? builder; final Widget Function( BuildContext context, int i, - ReactiveArrayNullableFormFormGroupArrayBuilderT? item, - ArrayNullableForm formModel) itemBuilder; + ReactiveAnnotatelessFormFormGroupArrayBuilderT? item, + AnnotatelessForm formModel) itemBuilder; @override Widget build(BuildContext context) { - final formModel = ReactiveArrayNullableForm.of(context); + final formModel = ReactiveAnnotatelessForm.of(context); if (formModel == null) { throw FormControlParentNotFoundException(this); @@ -1166,7 +653,7 @@ class ReactiveArrayNullableFormFormGroupArrayBuilder< stream: value.control.valueChanges, builder: (context, snapshot) { final itemList = (value.value() ?? - []) + []) .asMap() .map((i, item) => MapEntry( i, diff --git a/packages/generator_tests/test/doc/delivery_list_test.dart b/packages/generator_tests/test/doc/delivery_list_test.dart index 117404a3..ce9ba885 100644 --- a/packages/generator_tests/test/doc/delivery_list_test.dart +++ b/packages/generator_tests/test/doc/delivery_list_test.dart @@ -225,6 +225,8 @@ class DeliveryListFormBuilder extends StatefulWidget { class _DeliveryListFormBuilderState extends State { late DeliveryListForm _formModel; + StreamSubscription? _logSubscription; + @override void initState() { _formModel = @@ -236,7 +238,7 @@ class _DeliveryListFormBuilderState extends State { widget.initState?.call(context, _formModel); - _logDeliveryListForm.onRecord.listen((LogRecord e) { + _logSubscription = _logDeliveryListForm.onRecord.listen((LogRecord e) { // use `dumpErrorToConsole` for severe messages to ensure that severe // exceptions are formatted consistently with other Flutter examples and // avoids printing duplicate exceptions @@ -279,6 +281,7 @@ class _DeliveryListFormBuilderState extends State { @override void dispose() { _formModel.form.dispose(); + _logSubscription?.cancel(); super.dispose(); } @@ -301,7 +304,7 @@ class _DeliveryListFormBuilderState extends State { } } -final _logDeliveryListForm = Logger('DeliveryListForm'); +final _logDeliveryListForm = Logger.detached('DeliveryListForm'); class DeliveryListForm implements FormModel { DeliveryListForm( @@ -836,7 +839,7 @@ class DeliveryListForm implements FormModel { disabled: false); } -final _logDeliveryPointForm = Logger('DeliveryPointForm'); +final _logDeliveryPointForm = Logger.detached('DeliveryPointForm'); class DeliveryPointForm implements FormModel { DeliveryPointForm( @@ -1134,7 +1137,7 @@ class DeliveryPointForm implements FormModel { disabled: false); } -final _logAddressForm = Logger('AddressForm'); +final _logAddressForm = Logger.detached('AddressForm'); class AddressForm implements FormModel { AddressForm( @@ -1460,7 +1463,7 @@ class AddressForm implements FormModel { disabled: false); } -final _logClientForm = Logger('ClientForm'); +final _logClientForm = Logger.detached('ClientForm'); class ClientForm implements FormModel { ClientForm( @@ -1885,6 +1888,7 @@ class ReactiveDeliveryListFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveDeliveryListFormArrayBuilderT? item, DeliveryListForm formModel) itemBuilder; @@ -1908,6 +1912,8 @@ class ReactiveDeliveryListFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), @@ -2124,6 +2130,8 @@ class _StandaloneDeliveryPointFormBuilderState extends State { late StandaloneDeliveryPointForm _formModel; + StreamSubscription? _logSubscription; + @override void initState() { _formModel = StandaloneDeliveryPointForm( @@ -2135,7 +2143,8 @@ class _StandaloneDeliveryPointFormBuilderState widget.initState?.call(context, _formModel); - _logStandaloneDeliveryPointForm.onRecord.listen((LogRecord e) { + _logSubscription = + _logStandaloneDeliveryPointForm.onRecord.listen((LogRecord e) { // use `dumpErrorToConsole` for severe messages to ensure that severe // exceptions are formatted consistently with other Flutter examples and // avoids printing duplicate exceptions @@ -2178,6 +2187,7 @@ class _StandaloneDeliveryPointFormBuilderState @override void dispose() { _formModel.form.dispose(); + _logSubscription?.cancel(); super.dispose(); } @@ -2200,7 +2210,8 @@ class _StandaloneDeliveryPointFormBuilderState } } -final _logStandaloneDeliveryPointForm = Logger('StandaloneDeliveryPointForm'); +final _logStandaloneDeliveryPointForm = + Logger.detached('StandaloneDeliveryPointForm'); class StandaloneDeliveryPointForm implements FormModel { @@ -2523,6 +2534,7 @@ class ReactiveStandaloneDeliveryPointFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveStandaloneDeliveryPointFormArrayBuilderT? item, StandaloneDeliveryPointForm formModel) itemBuilder; @@ -2546,6 +2558,8 @@ class ReactiveStandaloneDeliveryPointFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] as FormControl< + ReactiveStandaloneDeliveryPointFormArrayBuilderT>, item, formModel, ), diff --git a/packages/reactive_forms_generator/CHANGELOG.md b/packages/reactive_forms_generator/CHANGELOG.md index df5ac94e..c44cdb4a 100644 --- a/packages/reactive_forms_generator/CHANGELOG.md +++ b/packages/reactive_forms_generator/CHANGELOG.md @@ -1,3 +1,7 @@ +## [6.0.0-beta.16] + +* expose control in itemBuilder + ## [6.0.0-beta.15] * rebase on main 2 diff --git a/packages/reactive_forms_generator/example/ios/Runner/AppDelegate.swift b/packages/reactive_forms_generator/example/ios/Runner/AppDelegate.swift index 70693e4a..b6363034 100644 --- a/packages/reactive_forms_generator/example/ios/Runner/AppDelegate.swift +++ b/packages/reactive_forms_generator/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/reactive_forms_generator/example/lib/docs/animated_url_list/url.gform.dart b/packages/reactive_forms_generator/example/lib/docs/animated_url_list/url.gform.dart index 5865581c..0db63ec4 100644 --- a/packages/reactive_forms_generator/example/lib/docs/animated_url_list/url.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/animated_url_list/url.gform.dart @@ -813,8 +813,12 @@ class ReactiveUrlFormArrayBuilder final Widget Function( BuildContext context, List itemList, UrlForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveUrlFormArrayBuilderT? item, UrlForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveUrlFormArrayBuilderT? item, + UrlForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -836,6 +840,8 @@ class ReactiveUrlFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/animated_url_list/url_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/animated_url_list/url_output.gform.dart index c5227bb1..cd93c9ab 100644 --- a/packages/reactive_forms_generator/example/lib/docs/animated_url_list/url_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/animated_url_list/url_output.gform.dart @@ -881,8 +881,12 @@ class ReactiveUrlOFormArrayBuilder final Widget Function( BuildContext context, List itemList, UrlOForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveUrlOFormArrayBuilderT? item, UrlOForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveUrlOFormArrayBuilderT? item, + UrlOForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -904,6 +908,8 @@ class ReactiveUrlOFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/annotateless/annotateless.gform.dart b/packages/reactive_forms_generator/example/lib/docs/annotateless/annotateless.gform.dart index 4d157d34..bc6b57aa 100644 --- a/packages/reactive_forms_generator/example/lib/docs/annotateless/annotateless.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/annotateless/annotateless.gform.dart @@ -511,6 +511,7 @@ class ReactiveAnnotatelessFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveAnnotatelessFormArrayBuilderT? item, AnnotatelessForm formModel) itemBuilder; @@ -534,6 +535,8 @@ class ReactiveAnnotatelessFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/annotateless/annotateless_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/annotateless/annotateless_output.gform.dart index 12143a0b..6875ee1f 100644 --- a/packages/reactive_forms_generator/example/lib/docs/annotateless/annotateless_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/annotateless/annotateless_output.gform.dart @@ -521,6 +521,7 @@ class ReactiveAnnotatelessOFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveAnnotatelessOFormArrayBuilderT? item, AnnotatelessOForm formModel) itemBuilder; @@ -544,6 +545,8 @@ class ReactiveAnnotatelessOFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable.gform.dart b/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable.gform.dart index f6c2147f..0107aa47 100644 --- a/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable.gform.dart @@ -1030,6 +1030,7 @@ class ReactiveArrayNullableFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveArrayNullableFormArrayBuilderT? item, ArrayNullableForm formModel) itemBuilder; @@ -1053,6 +1054,8 @@ class ReactiveArrayNullableFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable_form.dart b/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable_form.dart index 323d6942..e18f5274 100644 --- a/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable_form.dart +++ b/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable_form.dart @@ -50,9 +50,9 @@ class _ArrayNullableFormWidgetState extends State { Expanded( child: ReactiveArrayNullableFormArrayBuilder( formControl: formModel.emailListControl, - itemBuilder: (context, i, item, formModel) { + itemBuilder: (context, i, control, item, formModel) { return ReactiveTextField( - formControlName: i.toString(), + formControl: control, decoration: const InputDecoration(labelText: 'Email'), ); }, @@ -76,9 +76,9 @@ class _ArrayNullableFormWidgetState extends State { Expanded( child: ReactiveArrayNullableFormArrayBuilder( formControl: formModel.fruitListControl, - itemBuilder: (_, i, __, ___) { + itemBuilder: (_, i, control, __, ___) { return ReactiveCheckboxListTile( - formControlName: i.toString(), + formControl: control, title: Text(fruits[i]), ); }, diff --git a/packages/reactive_forms_generator/example/lib/docs/delivery_list/delivery_list.gform.dart b/packages/reactive_forms_generator/example/lib/docs/delivery_list/delivery_list.gform.dart index ee2bb408..7fe332e7 100644 --- a/packages/reactive_forms_generator/example/lib/docs/delivery_list/delivery_list.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/delivery_list/delivery_list.gform.dart @@ -1800,6 +1800,7 @@ class ReactiveDeliveryListFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveDeliveryListFormArrayBuilderT? item, DeliveryListForm formModel) itemBuilder; @@ -1823,6 +1824,8 @@ class ReactiveDeliveryListFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), @@ -2443,6 +2446,7 @@ class ReactiveStandaloneDeliveryPointFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveStandaloneDeliveryPointFormArrayBuilderT? item, StandaloneDeliveryPointForm formModel) itemBuilder; @@ -2466,6 +2470,8 @@ class ReactiveStandaloneDeliveryPointFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] as FormControl< + ReactiveStandaloneDeliveryPointFormArrayBuilderT>, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/freezed/freezed_class.gform.dart b/packages/reactive_forms_generator/example/lib/docs/freezed/freezed_class.gform.dart index cd3bc336..976ba42c 100644 --- a/packages/reactive_forms_generator/example/lib/docs/freezed/freezed_class.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/freezed/freezed_class.gform.dart @@ -874,6 +874,7 @@ class ReactiveFreezedClassFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveFreezedClassFormArrayBuilderT? item, FreezedClassForm formModel) itemBuilder; @@ -897,6 +898,8 @@ class ReactiveFreezedClassFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/freezed/freezed_class_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/freezed/freezed_class_output.gform.dart index b1a0efbc..841c147d 100644 --- a/packages/reactive_forms_generator/example/lib/docs/freezed/freezed_class_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/freezed/freezed_class_output.gform.dart @@ -1094,6 +1094,7 @@ class ReactiveFreezedClassOFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveFreezedClassOFormArrayBuilderT? item, FreezedClassOForm formModel) itemBuilder; @@ -1117,6 +1118,8 @@ class ReactiveFreezedClassOFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/freezed2/test.gform.dart b/packages/reactive_forms_generator/example/lib/docs/freezed2/test.gform.dart index 1e7efcb3..3598a56e 100644 --- a/packages/reactive_forms_generator/example/lib/docs/freezed2/test.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/freezed2/test.gform.dart @@ -529,8 +529,12 @@ class ReactiveTestFormArrayBuilder final Widget Function( BuildContext context, List itemList, TestForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveTestFormArrayBuilderT? item, TestForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveTestFormArrayBuilderT? item, + TestForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -552,6 +556,8 @@ class ReactiveTestFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/generic/generic.gform.dart b/packages/reactive_forms_generator/example/lib/docs/generic/generic.gform.dart index 9f7a9eba..56b269fd 100644 --- a/packages/reactive_forms_generator/example/lib/docs/generic/generic.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/generic/generic.gform.dart @@ -455,8 +455,12 @@ class ReactiveTagsFormArrayBuilder BuildContext context, List itemList, TagsForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveTagsFormArrayBuilderT? item, TagsForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveTagsFormArrayBuilderT? item, + TagsForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -478,6 +482,8 @@ class ReactiveTagsFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/generic_status_list/generic_status_list.gform.dart b/packages/reactive_forms_generator/example/lib/docs/generic_status_list/generic_status_list.gform.dart index eec6b730..76adc7bf 100644 --- a/packages/reactive_forms_generator/example/lib/docs/generic_status_list/generic_status_list.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/generic_status_list/generic_status_list.gform.dart @@ -490,6 +490,7 @@ class ReactiveStatusListFormArrayBuilder control, ReactiveStatusListFormArrayBuilderT? item, StatusListForm formModel) itemBuilder; @@ -513,6 +514,8 @@ class ReactiveStatusListFormArrayBuilder, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/group/group.gform.dart b/packages/reactive_forms_generator/example/lib/docs/group/group.gform.dart index c9017c97..cb3bda29 100644 --- a/packages/reactive_forms_generator/example/lib/docs/group/group.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/group/group.gform.dart @@ -1843,8 +1843,12 @@ class ReactiveGroupFormArrayBuilder BuildContext context, List itemList, GroupForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveGroupFormArrayBuilderT? item, GroupForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveGroupFormArrayBuilderT? item, + GroupForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -1866,6 +1870,8 @@ class ReactiveGroupFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/login/login.gform.dart b/packages/reactive_forms_generator/example/lib/docs/login/login.gform.dart index e63d3777..e5f8f88f 100644 --- a/packages/reactive_forms_generator/example/lib/docs/login/login.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/login/login.gform.dart @@ -505,8 +505,12 @@ class ReactiveLoginFormArrayBuilder BuildContext context, List itemList, LoginForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveLoginFormArrayBuilderT? item, LoginForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveLoginFormArrayBuilderT? item, + LoginForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -528,6 +532,8 @@ class ReactiveLoginFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/login/login_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/login/login_output.gform.dart index ab8f757f..aeb39f26 100644 --- a/packages/reactive_forms_generator/example/lib/docs/login/login_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/login/login_output.gform.dart @@ -570,8 +570,12 @@ class ReactiveLoginOFormArrayBuilder BuildContext context, List itemList, LoginOForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveLoginOFormArrayBuilderT? item, LoginOForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveLoginOFormArrayBuilderT? item, + LoginOForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -593,6 +597,8 @@ class ReactiveLoginOFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/login_extended/login_extended.gform.dart b/packages/reactive_forms_generator/example/lib/docs/login_extended/login_extended.gform.dart index 43e3aa9d..a9031a26 100644 --- a/packages/reactive_forms_generator/example/lib/docs/login_extended/login_extended.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/login_extended/login_extended.gform.dart @@ -1074,6 +1074,7 @@ class ReactiveLoginExtendedFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveLoginExtendedFormArrayBuilderT? item, LoginExtendedForm formModel) itemBuilder; @@ -1097,6 +1098,8 @@ class ReactiveLoginExtendedFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/login_extended/login_extended_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/login_extended/login_extended_output.gform.dart index 78747959..1d76da96 100644 --- a/packages/reactive_forms_generator/example/lib/docs/login_extended/login_extended_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/login_extended/login_extended_output.gform.dart @@ -1130,6 +1130,7 @@ class ReactiveLoginExtendedOFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveLoginExtendedOFormArrayBuilderT? item, LoginExtendedOForm formModel) itemBuilder; @@ -1153,6 +1154,8 @@ class ReactiveLoginExtendedOFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/login_extended_nullable/login_extended_nullable.gform.dart b/packages/reactive_forms_generator/example/lib/docs/login_extended_nullable/login_extended_nullable.gform.dart index eec8b6cc..bc6ecd3a 100644 --- a/packages/reactive_forms_generator/example/lib/docs/login_extended_nullable/login_extended_nullable.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/login_extended_nullable/login_extended_nullable.gform.dart @@ -1088,6 +1088,7 @@ class ReactiveLoginExtendedNullableFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveLoginExtendedNullableFormArrayBuilderT? item, LoginExtendedNullableForm formModel) itemBuilder; @@ -1111,6 +1112,8 @@ class ReactiveLoginExtendedNullableFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] as FormControl< + ReactiveLoginExtendedNullableFormArrayBuilderT>, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/login_extended_nullable/login_extended_nullable_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/login_extended_nullable/login_extended_nullable_output.gform.dart index 0e605324..1bd0b163 100644 --- a/packages/reactive_forms_generator/example/lib/docs/login_extended_nullable/login_extended_nullable_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/login_extended_nullable/login_extended_nullable_output.gform.dart @@ -1089,6 +1089,7 @@ class ReactiveLoginExtendedNullableOFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveLoginExtendedNullableOFormArrayBuilderT? item, LoginExtendedNullableOForm formModel) itemBuilder; @@ -1112,6 +1113,8 @@ class ReactiveLoginExtendedNullableOFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] as FormControl< + ReactiveLoginExtendedNullableOFormArrayBuilderT>, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list.gform.dart b/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list.gform.dart index 5d48e9e5..924637de 100644 --- a/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list.gform.dart @@ -485,6 +485,7 @@ class ReactiveMailingListFormArrayBuilder final Widget Function( BuildContext context, int i, + FormControl control, ReactiveMailingListFormArrayBuilderT? item, MailingListForm formModel) itemBuilder; @@ -508,6 +509,8 @@ class ReactiveMailingListFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list_form.dart b/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list_form.dart index d782a44b..0ef063df 100644 --- a/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list_form.dart +++ b/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list_form.dart @@ -34,14 +34,13 @@ class _MailingListFormWidgetState extends State { Expanded( child: ReactiveMailingListFormArrayBuilder( formControl: formModel.emailListControl, - itemBuilder: (context, i, item, formModel) { + itemBuilder: (context, i, control, item, formModel) { return Row( children: [ Expanded( child: ReactiveTextField( - key: ValueKey( - formModel.emailListControl.controls[i]), - formControlName: i.toString(), + key: ObjectKey(control), + formControl: control, validationMessages: { 'email': (_) => 'Invalid email', }, diff --git a/packages/reactive_forms_generator/example/lib/docs/model_extends/model_extends.gform.dart b/packages/reactive_forms_generator/example/lib/docs/model_extends/model_extends.gform.dart index fb41c5cc..ca2ed5e3 100644 --- a/packages/reactive_forms_generator/example/lib/docs/model_extends/model_extends.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/model_extends/model_extends.gform.dart @@ -511,6 +511,7 @@ class ReactiveModelExtendsFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveModelExtendsFormArrayBuilderT? item, ModelExtendsForm formModel) itemBuilder; @@ -534,6 +535,8 @@ class ReactiveModelExtendsFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/model_implements/model_implements.gform.dart b/packages/reactive_forms_generator/example/lib/docs/model_implements/model_implements.gform.dart index 660ade7a..3d4da1ec 100644 --- a/packages/reactive_forms_generator/example/lib/docs/model_implements/model_implements.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/model_implements/model_implements.gform.dart @@ -515,6 +515,7 @@ class ReactiveModelImplementsFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveModelImplementsFormArrayBuilderT? item, ModelImplementsForm formModel) itemBuilder; @@ -538,6 +539,8 @@ class ReactiveModelImplementsFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/nested/nested.gform.dart b/packages/reactive_forms_generator/example/lib/docs/nested/nested.gform.dart index 6e96e5de..afd0b4cf 100644 --- a/packages/reactive_forms_generator/example/lib/docs/nested/nested.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/nested/nested.gform.dart @@ -432,6 +432,7 @@ class ReactiveSubGroupFormArrayBuilder final Widget Function( BuildContext context, int i, + FormControl control, ReactiveSubGroupFormArrayBuilderT? item, SubGroupForm formModel) itemBuilder; @@ -455,6 +456,8 @@ class ReactiveSubGroupFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), @@ -1152,8 +1155,12 @@ class ReactiveGroupFormArrayBuilder BuildContext context, List itemList, GroupForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveGroupFormArrayBuilderT? item, GroupForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveGroupFormArrayBuilderT? item, + GroupForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -1175,6 +1182,8 @@ class ReactiveGroupFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), @@ -1794,8 +1803,12 @@ class ReactiveNestedFormArrayBuilder BuildContext context, List itemList, NestedForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveNestedFormArrayBuilderT? item, NestedForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveNestedFormArrayBuilderT? item, + NestedForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -1817,6 +1830,8 @@ class ReactiveNestedFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/nested_generics/product.gform.dart b/packages/reactive_forms_generator/example/lib/docs/nested_generics/product.gform.dart index 3002095c..3134fef0 100644 --- a/packages/reactive_forms_generator/example/lib/docs/nested_generics/product.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/nested_generics/product.gform.dart @@ -905,6 +905,7 @@ class ReactiveProductDetailsFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveProductDetailsFormArrayBuilderT? item, ProductDetailsForm formModel) itemBuilder; @@ -928,6 +929,8 @@ class ReactiveProductDetailsFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), @@ -1244,8 +1247,12 @@ class ReactiveIdFormArrayBuilder itemList, IdForm formModel)? builder; - final Widget Function(BuildContext context, int i, - ReactiveIdFormArrayBuilderT? item, IdForm formModel) itemBuilder; + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveIdFormArrayBuilderT? item, + IdForm formModel) itemBuilder; @override Widget build(BuildContext context) { @@ -1267,6 +1274,8 @@ class ReactiveIdFormArrayBuilder, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/profile/profile.gform.dart b/packages/reactive_forms_generator/example/lib/docs/profile/profile.gform.dart index 9e928577..7ec48240 100644 --- a/packages/reactive_forms_generator/example/lib/docs/profile/profile.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/profile/profile.gform.dart @@ -2279,6 +2279,7 @@ class ReactiveProfileFormArrayBuilder final Widget Function( BuildContext context, int i, + FormControl control, ReactiveProfileFormArrayBuilderT? item, ProfileForm formModel) itemBuilder; @@ -2302,6 +2303,8 @@ class ReactiveProfileFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/renamed_basic/renamed_basic.gform.dart b/packages/reactive_forms_generator/example/lib/docs/renamed_basic/renamed_basic.gform.dart index a73697a6..20dd0d1e 100644 --- a/packages/reactive_forms_generator/example/lib/docs/renamed_basic/renamed_basic.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/renamed_basic/renamed_basic.gform.dart @@ -511,6 +511,7 @@ class ReactiveSomeWiredNameFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveSomeWiredNameFormArrayBuilderT? item, SomeWiredNameForm formModel) itemBuilder; @@ -534,6 +535,8 @@ class ReactiveSomeWiredNameFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/renamed_basic/renamed_basic_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/renamed_basic/renamed_basic_output.gform.dart index cdd52f09..c7da4bff 100644 --- a/packages/reactive_forms_generator/example/lib/docs/renamed_basic/renamed_basic_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/renamed_basic/renamed_basic_output.gform.dart @@ -573,6 +573,7 @@ class ReactiveSomeWiredNameFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveSomeWiredNameFormArrayBuilderT? item, SomeWiredNameForm formModel) itemBuilder; @@ -596,6 +597,8 @@ class ReactiveSomeWiredNameFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/user_profile/user_profile.gform.dart b/packages/reactive_forms_generator/example/lib/docs/user_profile/user_profile.gform.dart index 0ed2638a..65eb31dd 100644 --- a/packages/reactive_forms_generator/example/lib/docs/user_profile/user_profile.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/user_profile/user_profile.gform.dart @@ -1192,6 +1192,7 @@ class ReactiveUserProfileFormArrayBuilder final Widget Function( BuildContext context, int i, + FormControl control, ReactiveUserProfileFormArrayBuilderT? item, UserProfileForm formModel) itemBuilder; @@ -1215,6 +1216,8 @@ class ReactiveUserProfileFormArrayBuilder itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/example/lib/docs/user_profile/user_profile_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/user_profile/user_profile_output.gform.dart index ad5b3d6c..04cd285d 100644 --- a/packages/reactive_forms_generator/example/lib/docs/user_profile/user_profile_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/user_profile/user_profile_output.gform.dart @@ -1272,6 +1272,7 @@ class ReactiveUserProfileOFormArrayBuilder< final Widget Function( BuildContext context, int i, + FormControl control, ReactiveUserProfileOFormArrayBuilderT? item, UserProfileOForm formModel) itemBuilder; @@ -1295,6 +1296,8 @@ class ReactiveUserProfileOFormArrayBuilder< itemBuilder( context, i, + formArray.controls[i] + as FormControl, item, formModel, ), diff --git a/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form_array_builder.dart b/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form_array_builder.dart index bc5127c5..f66e0777 100644 --- a/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form_array_builder.dart +++ b/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form_array_builder.dart @@ -91,6 +91,7 @@ class ReactiveFormArrayBuilder { itemBuilder( context, i, + formArray.controls[i] as FormControl<$T>, item, formModel, ), @@ -140,7 +141,7 @@ class ReactiveFormArrayBuilder { ..name = 'itemBuilder' ..modifier = FieldModifier.final$ ..type = Reference( - 'Widget Function(BuildContext context, int i, $T? item, ${formGenerator.classNameFull} formModel)'), + 'Widget Function(BuildContext context, int i, FormControl<$T> control, $T? item, ${formGenerator.classNameFull} formModel)'), ), ]; diff --git a/packages/reactive_forms_generator/pubspec.yaml b/packages/reactive_forms_generator/pubspec.yaml index 13b0abf6..dcba2b28 100644 --- a/packages/reactive_forms_generator/pubspec.yaml +++ b/packages/reactive_forms_generator/pubspec.yaml @@ -2,7 +2,7 @@ name: reactive_forms_generator description: Generator for reactive_forms. Generates form classes based on model. repository: https://github.com/artflutter/reactive_forms_generator -version: 6.0.0-beta.15 +version: 6.0.0-beta.16 environment: sdk: ">=3.0.0 <4.0.0"