diff --git a/packages/generator_tests/test/doc/animated_url_list_output_test.dart b/packages/generator_tests/test/doc/animated_url_list_output_test.dart index a0ff27db..e5f771b4 100644 --- a/packages/generator_tests/test/doc/animated_url_list_output_test.dart +++ b/packages/generator_tests/test/doc/animated_url_list_output_test.dart @@ -103,7 +103,7 @@ class ReactiveAnimatedUrlLisOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -112,7 +112,8 @@ class ReactiveAnimatedUrlLisOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static AnimatedUrlLisOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -139,7 +140,7 @@ class ReactiveAnimatedUrlLisOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -160,7 +161,7 @@ class AnimatedUrlLisOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -171,7 +172,8 @@ class AnimatedUrlLisOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -265,7 +267,7 @@ class _AnimatedUrlLisOFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -312,7 +314,7 @@ class AnimatedUrlLisOForm } } - Map get urlListErrors => urlListControl.errors; + Map get urlListErrors => urlListControl.errors; void get urlListFocus => form.focus(urlListControlPath()); @@ -719,9 +721,9 @@ class UrlEntityOForm implements FormModel { } } - Map? get labelErrors => labelControl.errors; + Map? get labelErrors => labelControl.errors; - Map? get urlErrors => urlControl.errors; + Map? get urlErrors => urlControl.errors; void get labelFocus => form.focus(labelControlPath()); diff --git a/packages/generator_tests/test/doc/animated_url_list_test.dart b/packages/generator_tests/test/doc/animated_url_list_test.dart index b5b06e07..e99d5e9e 100644 --- a/packages/generator_tests/test/doc/animated_url_list_test.dart +++ b/packages/generator_tests/test/doc/animated_url_list_test.dart @@ -103,7 +103,7 @@ class ReactiveAnimatedUrlListForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -112,7 +112,8 @@ class ReactiveAnimatedUrlListForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static AnimatedUrlListForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -139,7 +140,7 @@ class ReactiveAnimatedUrlListForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -160,7 +161,7 @@ class AnimatedUrlListFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -171,7 +172,8 @@ class AnimatedUrlListFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -265,7 +267,7 @@ class _AnimatedUrlListFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -312,7 +314,7 @@ class AnimatedUrlListForm } } - Map get urlListErrors => urlListControl.errors; + Map get urlListErrors => urlListControl.errors; void get urlListFocus => form.focus(urlListControlPath()); @@ -718,9 +720,9 @@ class UrlEntityForm implements FormModel { } } - Map get labelErrors => labelControl.errors; + Map get labelErrors => labelControl.errors; - Map get urlErrors => urlControl.errors; + Map get urlErrors => urlControl.errors; void get labelFocus => form.focus(labelControlPath()); diff --git a/packages/generator_tests/test/doc/annotateless_output_test.dart b/packages/generator_tests/test/doc/annotateless_output_test.dart index e693dbbd..daba54fc 100644 --- a/packages/generator_tests/test/doc/annotateless_output_test.dart +++ b/packages/generator_tests/test/doc/annotateless_output_test.dart @@ -94,7 +94,7 @@ class ReactiveAnnotatelessOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -103,7 +103,8 @@ class ReactiveAnnotatelessOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static AnnotatelessOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -130,7 +131,7 @@ class ReactiveAnnotatelessOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -151,7 +152,7 @@ class AnnotatelessOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -162,7 +163,8 @@ class AnnotatelessOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -255,7 +257,7 @@ class _AnnotatelessOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -317,9 +319,9 @@ class AnnotatelessOForm } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/annotateless_test.dart b/packages/generator_tests/test/doc/annotateless_test.dart index cb1e9426..93256827 100644 --- a/packages/generator_tests/test/doc/annotateless_test.dart +++ b/packages/generator_tests/test/doc/annotateless_test.dart @@ -91,7 +91,7 @@ class ReactiveAnnotatelessForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -100,7 +100,8 @@ class ReactiveAnnotatelessForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static AnnotatelessForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -127,7 +128,7 @@ class ReactiveAnnotatelessForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -148,7 +149,7 @@ class AnnotatelessFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -159,7 +160,8 @@ class AnnotatelessFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -252,7 +254,7 @@ class _AnnotatelessFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -313,9 +315,9 @@ class AnnotatelessForm implements FormModel { } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/array_nullable_output_test.dart b/packages/generator_tests/test/doc/array_nullable_output_test.dart index 2fc6ca51..4895f598 100644 --- a/packages/generator_tests/test/doc/array_nullable_output_test.dart +++ b/packages/generator_tests/test/doc/array_nullable_output_test.dart @@ -106,7 +106,7 @@ class ReactiveArrayNullableOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -115,7 +115,8 @@ class ReactiveArrayNullableOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ArrayNullableOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -142,7 +143,7 @@ class ReactiveArrayNullableOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -163,7 +164,7 @@ class ArrayNullableOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -174,7 +175,8 @@ class ArrayNullableOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -267,7 +269,7 @@ class _ArrayNullableOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -394,15 +396,16 @@ class ArrayNullableOForm } } - Map? get someListErrors => someListControl.errors; + Map? get someListErrors => someListControl.errors; - Map get emailListErrors => emailListControl.errors; + Map get emailListErrors => emailListControl.errors; - Map get fruitListErrors => fruitListControl.errors; + Map get fruitListErrors => fruitListControl.errors; - Map? get vegetablesListErrors => vegetablesListControl.errors; + Map? get vegetablesListErrors => + vegetablesListControl.errors; - Map? get modeListErrors => modeListControl.errors; + Map? get modeListErrors => modeListControl.errors; void get someListFocus => form.focus(someListControlPath()); diff --git a/packages/generator_tests/test/doc/array_nullable_test.dart b/packages/generator_tests/test/doc/array_nullable_test.dart index b902db2b..9a5e5696 100644 --- a/packages/generator_tests/test/doc/array_nullable_test.dart +++ b/packages/generator_tests/test/doc/array_nullable_test.dart @@ -109,7 +109,7 @@ class ReactiveArrayNullableForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -118,7 +118,8 @@ class ReactiveArrayNullableForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ArrayNullableForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -145,7 +146,7 @@ class ReactiveArrayNullableForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -166,7 +167,7 @@ class ArrayNullableFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -177,7 +178,8 @@ class ArrayNullableFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -270,7 +272,7 @@ class _ArrayNullableFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -416,18 +418,19 @@ class ArrayNullableForm implements FormModel { } } - Map? get someListErrors => someListControl.errors; + Map? get someListErrors => someListControl.errors; - Map get someListRequiredErrors => + Map get someListRequiredErrors => someListRequiredControl.errors; - Map get emailListErrors => emailListControl.errors; + Map get emailListErrors => emailListControl.errors; - Map get fruitListErrors => fruitListControl.errors; + Map get fruitListErrors => fruitListControl.errors; - Map? get vegetablesListErrors => vegetablesListControl.errors; + Map? get vegetablesListErrors => + vegetablesListControl.errors; - Map? get modeListErrors => modeListControl.errors; + Map? get modeListErrors => modeListControl.errors; void get someListFocus => form.focus(someListControlPath()); diff --git a/packages/generator_tests/test/doc/create_output_test.dart b/packages/generator_tests/test/doc/create_output_test.dart index fc2ff63e..f23e45d2 100644 --- a/packages/generator_tests/test/doc/create_output_test.dart +++ b/packages/generator_tests/test/doc/create_output_test.dart @@ -155,7 +155,7 @@ class ReactiveMSICreateForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -164,7 +164,8 @@ class ReactiveMSICreateForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static MSICreateForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -189,7 +190,7 @@ class ReactiveMSICreateForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -209,7 +210,7 @@ class MSICreateFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -220,7 +221,8 @@ class MSICreateFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -311,7 +313,7 @@ class _MSICreateFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -518,26 +520,27 @@ class MSICreateForm implements FormModel { } } - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; - Map? get businessNumberErrors => businessNumberControl.errors; + Map? get businessNumberErrors => + businessNumberControl.errors; - Map? get fileIdsErrors => fileIdsControl.errors; + Map? get fileIdsErrors => fileIdsControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map get sameMailingAddressAsCompanyErrors => + Map get sameMailingAddressAsCompanyErrors => sameMailingAddressAsCompanyControl.errors; - Map get companyAddressErrors => companyAddressControl.errors; + Map get companyAddressErrors => companyAddressControl.errors; - Map get primaryContactErrors => primaryContactControl.errors; + Map get primaryContactErrors => primaryContactControl.errors; - Map get mailingAddressErrors => mailingAddressControl.errors; + Map get mailingAddressErrors => mailingAddressControl.errors; - Map get adminsErrors => adminsControl.errors; + Map get adminsErrors => adminsControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1747,14 +1750,14 @@ class AddressForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get stateOrProvinceErrors => + Map? get stateOrProvinceErrors => stateOrProvinceControl.errors; - Map? get zipCodeErrors => zipCodeControl.errors; + Map? get zipCodeErrors => zipCodeControl.errors; void get streetFocus => form.focus(streetControlPath()); @@ -2387,11 +2390,11 @@ class PrimaryContactForm } } - Map? get fullNameErrors => fullNameControl.errors; + Map? get fullNameErrors => fullNameControl.errors; - Map? get jobTitleErrors => jobTitleControl.errors; + Map? get jobTitleErrors => jobTitleControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; void get fullNameFocus => form.focus(fullNameControlPath()); @@ -2930,11 +2933,11 @@ class AdminContactInformationForm } } - Map? get firstNameErrors => firstNameControl.errors; + Map? get firstNameErrors => firstNameControl.errors; - Map? get lastNameErrors => lastNameControl.errors; + Map? get lastNameErrors => lastNameControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; void get firstNameFocus => form.focus(firstNameControlPath()); diff --git a/packages/generator_tests/test/doc/delivery_list_output_test.dart b/packages/generator_tests/test/doc/delivery_list_output_test.dart index dafd8816..d436bfd6 100644 --- a/packages/generator_tests/test/doc/delivery_list_output_test.dart +++ b/packages/generator_tests/test/doc/delivery_list_output_test.dart @@ -147,7 +147,7 @@ class ReactiveDeliveryListOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -156,7 +156,8 @@ class ReactiveDeliveryListOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static DeliveryListOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -183,7 +184,7 @@ class ReactiveDeliveryListOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -204,7 +205,7 @@ class DeliveryListOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -215,7 +216,8 @@ class DeliveryListOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -308,7 +310,7 @@ class _DeliveryListOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -376,9 +378,9 @@ class DeliveryListOForm } } - Map get deliveryListErrors => deliveryListControl.errors; + Map get deliveryListErrors => deliveryListControl.errors; - Map? get clientListErrors => clientListControl.errors; + Map? get clientListErrors => clientListControl.errors; void get deliveryListFocus => form.focus(deliveryListControlPath()); @@ -1001,9 +1003,9 @@ class DeliveryPointOForm } } - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; void get nameFocus => form.focus(nameControlPath()); @@ -1391,9 +1393,9 @@ class AddressOForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; void get streetFocus => form.focus(streetControlPath()); @@ -1825,11 +1827,11 @@ class ClientOForm implements FormModel { } } - Map get clientTypeErrors => clientTypeControl.errors; + Map get clientTypeErrors => clientTypeControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get notesErrors => notesControl.errors; + Map? get notesErrors => notesControl.errors; void get clientTypeFocus => form.focus(clientTypeControlPath()); @@ -2596,7 +2598,7 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -2605,7 +2607,8 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static StandaloneDeliveryPointForm? of( BuildContext context, { @@ -2635,7 +2638,7 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -2656,7 +2659,7 @@ class StandaloneDeliveryPointFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -2667,7 +2670,8 @@ class StandaloneDeliveryPointFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -2766,7 +2770,7 @@ class _StandaloneDeliveryPointFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -2832,9 +2836,9 @@ class StandaloneDeliveryPointForm } } - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; void get nameFocus => form.focus(nameControlPath()); diff --git a/packages/generator_tests/test/doc/delivery_list_test.dart b/packages/generator_tests/test/doc/delivery_list_test.dart index 592d3ae0..f5acd682 100644 --- a/packages/generator_tests/test/doc/delivery_list_test.dart +++ b/packages/generator_tests/test/doc/delivery_list_test.dart @@ -139,7 +139,7 @@ class ReactiveDeliveryListForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -148,7 +148,8 @@ class ReactiveDeliveryListForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static DeliveryListForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -175,7 +176,7 @@ class ReactiveDeliveryListForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -196,7 +197,7 @@ class DeliveryListFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -207,7 +208,8 @@ class DeliveryListFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -300,7 +302,7 @@ class _DeliveryListFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -367,9 +369,9 @@ class DeliveryListForm implements FormModel { } } - Map get deliveryListErrors => deliveryListControl.errors; + Map get deliveryListErrors => deliveryListControl.errors; - Map? get clientListErrors => clientListControl.errors; + Map? get clientListErrors => clientListControl.errors; void get deliveryListFocus => form.focus(deliveryListControlPath()); @@ -989,9 +991,9 @@ class DeliveryPointForm implements FormModel { } } - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; void get nameFocus => form.focus(nameControlPath()); @@ -1378,9 +1380,9 @@ class AddressForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; void get streetFocus => form.focus(streetControlPath()); @@ -1811,11 +1813,11 @@ class ClientForm implements FormModel { } } - Map get clientTypeErrors => clientTypeControl.errors; + Map get clientTypeErrors => clientTypeControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get notesErrors => notesControl.errors; + Map? get notesErrors => notesControl.errors; void get clientTypeFocus => form.focus(clientTypeControlPath()); @@ -2530,7 +2532,7 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -2539,7 +2541,8 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static StandaloneDeliveryPointForm? of( BuildContext context, { @@ -2569,7 +2572,7 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -2590,7 +2593,7 @@ class StandaloneDeliveryPointFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -2601,7 +2604,8 @@ class StandaloneDeliveryPointFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -2700,7 +2704,7 @@ class _StandaloneDeliveryPointFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -2765,9 +2769,9 @@ class StandaloneDeliveryPointForm } } - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; void get nameFocus => form.focus(nameControlPath()); diff --git a/packages/generator_tests/test/doc/freezed_class_output_test.dart b/packages/generator_tests/test/doc/freezed_class_output_test.dart index 1d738ff2..467fb533 100644 --- a/packages/generator_tests/test/doc/freezed_class_output_test.dart +++ b/packages/generator_tests/test/doc/freezed_class_output_test.dart @@ -107,7 +107,7 @@ class ReactiveFreezedClassOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -116,7 +116,8 @@ class ReactiveFreezedClassOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static FreezedClassOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -143,7 +144,7 @@ class ReactiveFreezedClassOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -164,7 +165,7 @@ class FreezedClassOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -175,7 +176,8 @@ class FreezedClassOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -268,7 +270,7 @@ class _FreezedClassOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -451,23 +453,23 @@ class FreezedClassOForm } } - Map? get genderErrors => genderControl.errors; + Map? get genderErrors => genderControl.errors; - Map? get genderRErrors => genderRControl.errors; + Map? get genderRErrors => genderRControl.errors; - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; - Map? get idRErrors => idRControl.errors; + Map? get idRErrors => idRControl.errors; - Map get idR2Errors => idR2Control.errors; + Map get idR2Errors => idR2Control.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get logoImageErrors => logoImageControl.errors; + Map? get logoImageErrors => logoImageControl.errors; - Map? get yearErrors => yearControl.errors; + Map? get yearErrors => yearControl.errors; - Map get selectedSpacesErrors => selectedSpacesControl.errors; + Map get selectedSpacesErrors => selectedSpacesControl.errors; void get genderFocus => form.focus(genderControlPath()); diff --git a/packages/generator_tests/test/doc/freezed_class_test.dart b/packages/generator_tests/test/doc/freezed_class_test.dart index af7b64bc..189a0577 100644 --- a/packages/generator_tests/test/doc/freezed_class_test.dart +++ b/packages/generator_tests/test/doc/freezed_class_test.dart @@ -106,7 +106,7 @@ class ReactiveFreezedClassForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -115,7 +115,8 @@ class ReactiveFreezedClassForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static FreezedClassForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -142,7 +143,7 @@ class ReactiveFreezedClassForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -163,7 +164,7 @@ class FreezedClassFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -174,7 +175,8 @@ class FreezedClassFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -267,7 +269,7 @@ class _FreezedClassFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -398,17 +400,17 @@ class FreezedClassForm implements FormModel { } } - Map? get genderErrors => genderControl.errors; + Map? get genderErrors => genderControl.errors; - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get logoImageErrors => logoImageControl.errors; + Map? get logoImageErrors => logoImageControl.errors; - Map? get yearErrors => yearControl.errors; + Map? get yearErrors => yearControl.errors; - Map get selectedSpacesErrors => selectedSpacesControl.errors; + Map get selectedSpacesErrors => selectedSpacesControl.errors; void get genderFocus => form.focus(genderControlPath()); diff --git a/packages/generator_tests/test/doc/generic_output_test.dart b/packages/generator_tests/test/doc/generic_output_test.dart index 8a6be633..8a16869a 100644 --- a/packages/generator_tests/test/doc/generic_output_test.dart +++ b/packages/generator_tests/test/doc/generic_output_test.dart @@ -86,7 +86,7 @@ class ReactiveTagsOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -95,7 +95,8 @@ class ReactiveTagsOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static TagsOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -120,7 +121,7 @@ class ReactiveTagsOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -140,7 +141,7 @@ class TagsOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -151,7 +152,8 @@ class TagsOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -242,7 +244,7 @@ class _TagsOFormBuilderState extends State> { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -285,7 +287,7 @@ class TagsOForm implements FormModel, TagsOOutput> { } } - Map? get tagsErrors => tagsControl.errors; + Map? get tagsErrors => tagsControl.errors; void get tagsFocus => form.focus(tagsControlPath()); diff --git a/packages/generator_tests/test/doc/generic_status_list_output_test.dart b/packages/generator_tests/test/doc/generic_status_list_output_test.dart index 052ceb22..8a7ef3db 100644 --- a/packages/generator_tests/test/doc/generic_status_list_output_test.dart +++ b/packages/generator_tests/test/doc/generic_status_list_output_test.dart @@ -87,7 +87,7 @@ class ReactiveStatusListOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -96,7 +96,8 @@ class ReactiveStatusListOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static StatusListOForm? of( BuildContext context, { @@ -126,7 +127,7 @@ class ReactiveStatusListOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -147,7 +148,7 @@ class StatusListOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -158,7 +159,8 @@ class StatusListOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -252,7 +254,7 @@ class _StatusListOFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -297,7 +299,7 @@ class StatusListOForm } } - Map get listErrors => listControl.errors; + Map get listErrors => listControl.errors; void get listFocus => form.focus(listControlPath()); diff --git a/packages/generator_tests/test/doc/generic_status_list_test.dart b/packages/generator_tests/test/doc/generic_status_list_test.dart index a8e83782..3868b7cd 100644 --- a/packages/generator_tests/test/doc/generic_status_list_test.dart +++ b/packages/generator_tests/test/doc/generic_status_list_test.dart @@ -87,7 +87,7 @@ class ReactiveStatusListForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -96,7 +96,8 @@ class ReactiveStatusListForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static StatusListForm? of( BuildContext context, { @@ -126,7 +127,7 @@ class ReactiveStatusListForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -147,7 +148,7 @@ class StatusListFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -158,7 +159,8 @@ class StatusListFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -252,7 +254,7 @@ class _StatusListFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -297,7 +299,7 @@ class StatusListForm } } - Map get listErrors => listControl.errors; + Map get listErrors => listControl.errors; void get listFocus => form.focus(listControlPath()); diff --git a/packages/generator_tests/test/doc/generic_test.dart b/packages/generator_tests/test/doc/generic_test.dart index 13d7816c..a0b99ad1 100644 --- a/packages/generator_tests/test/doc/generic_test.dart +++ b/packages/generator_tests/test/doc/generic_test.dart @@ -86,7 +86,7 @@ class ReactiveTagsForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -95,7 +95,8 @@ class ReactiveTagsForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static TagsForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -120,7 +121,7 @@ class ReactiveTagsForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -139,7 +140,7 @@ class TagsFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -150,7 +151,8 @@ class TagsFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -241,7 +243,7 @@ class _TagsFormBuilderState extends State> { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -284,7 +286,7 @@ class TagsForm implements FormModel, Tags> { } } - Map? get tagsErrors => tagsControl.errors; + Map? get tagsErrors => tagsControl.errors; void get tagsFocus => form.focus(tagsControlPath()); diff --git a/packages/generator_tests/test/doc/group_output_test.dart b/packages/generator_tests/test/doc/group_output_test.dart index 34844d31..032302ad 100644 --- a/packages/generator_tests/test/doc/group_output_test.dart +++ b/packages/generator_tests/test/doc/group_output_test.dart @@ -136,7 +136,7 @@ class ReactiveGroupOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -145,7 +145,8 @@ class ReactiveGroupOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static GroupOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -168,7 +169,7 @@ class ReactiveGroupOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -187,7 +188,7 @@ class GroupOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -198,7 +199,8 @@ class GroupOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -285,7 +287,7 @@ class _GroupOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -385,13 +387,13 @@ class GroupOForm implements FormModel { } } - Map? get personalErrors => personalControl.errors; + Map? get personalErrors => personalControl.errors; - Map? get phoneErrors => phoneControl.errors; + Map? get phoneErrors => phoneControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; - Map? get address2Errors => address2Control.errors; + Map? get address2Errors => address2Control.errors; void get personalFocus => form.focus(personalControlPath()); @@ -984,9 +986,9 @@ class PersonalOForm implements FormModel { } } - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; void get nameFocus => form.focus(nameControlPath()); @@ -1405,9 +1407,9 @@ class PhoneOForm implements FormModel { } } - Map? get phoneNumberErrors => phoneNumberControl.errors; + Map? get phoneNumberErrors => phoneNumberControl.errors; - Map? get countryIsoErrors => countryIsoControl.errors; + Map? get countryIsoErrors => countryIsoControl.errors; void get phoneNumberFocus => form.focus(phoneNumberControlPath()); @@ -1845,11 +1847,11 @@ class AddressOForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get zipErrors => zipControl.errors; + Map? get zipErrors => zipControl.errors; void get streetFocus => form.focus(streetControlPath()); diff --git a/packages/generator_tests/test/doc/group_test.dart b/packages/generator_tests/test/doc/group_test.dart index 5befe174..f2fc81d7 100644 --- a/packages/generator_tests/test/doc/group_test.dart +++ b/packages/generator_tests/test/doc/group_test.dart @@ -133,7 +133,7 @@ class ReactiveGroupForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -142,7 +142,8 @@ class ReactiveGroupForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static GroupForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -165,7 +166,7 @@ class ReactiveGroupForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -184,7 +185,7 @@ class GroupFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -195,7 +196,8 @@ class GroupFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -282,7 +284,7 @@ class _GroupFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -379,13 +381,13 @@ class GroupForm implements FormModel { } } - Map? get personalErrors => personalControl.errors; + Map? get personalErrors => personalControl.errors; - Map? get phoneErrors => phoneControl.errors; + Map? get phoneErrors => phoneControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; - Map? get address2Errors => address2Control.errors; + Map? get address2Errors => address2Control.errors; void get personalFocus => form.focus(personalControlPath()); @@ -973,9 +975,9 @@ class PersonalForm implements FormModel { } } - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; void get nameFocus => form.focus(nameControlPath()); @@ -1393,9 +1395,9 @@ class PhoneForm implements FormModel { } } - Map? get phoneNumberErrors => phoneNumberControl.errors; + Map? get phoneNumberErrors => phoneNumberControl.errors; - Map? get countryIsoErrors => countryIsoControl.errors; + Map? get countryIsoErrors => countryIsoControl.errors; void get phoneNumberFocus => form.focus(phoneNumberControlPath()); @@ -1826,11 +1828,11 @@ class AddressForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get zipErrors => zipControl.errors; + Map? get zipErrors => zipControl.errors; void get streetFocus => form.focus(streetControlPath()); diff --git a/packages/generator_tests/test/doc/login_extended_nullable_output_test.dart b/packages/generator_tests/test/doc/login_extended_nullable_output_test.dart index 7c46276a..1792fa6f 100644 --- a/packages/generator_tests/test/doc/login_extended_nullable_output_test.dart +++ b/packages/generator_tests/test/doc/login_extended_nullable_output_test.dart @@ -109,7 +109,7 @@ class ReactiveLoginExtendedNullableOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -118,7 +118,8 @@ class ReactiveLoginExtendedNullableOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginExtendedNullableOForm? of( BuildContext context, { @@ -148,7 +149,7 @@ class ReactiveLoginExtendedNullableOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -169,7 +170,7 @@ class LoginExtendedNullableOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -180,7 +181,8 @@ class LoginExtendedNullableOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -279,7 +281,7 @@ class _LoginExtendedNullableOFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -431,19 +433,19 @@ class LoginExtendedNullableOForm } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map? get passwordErrors => passwordControl.errors; + Map? get passwordErrors => passwordControl.errors; - Map? get rememberMeErrors => rememberMeControl.errors; + Map? get rememberMeErrors => rememberMeControl.errors; - Map? get themeErrors => themeControl.errors; + Map? get themeErrors => themeControl.errors; - Map? get modeErrors => modeControl.errors; + Map? get modeErrors => modeControl.errors; - Map? get timeoutErrors => timeoutControl.errors; + Map? get timeoutErrors => timeoutControl.errors; - Map? get heightErrors => heightControl.errors; + Map? get heightErrors => heightControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/login_extended_nullable_test.dart b/packages/generator_tests/test/doc/login_extended_nullable_test.dart index 2cf420d1..2c6cd01a 100644 --- a/packages/generator_tests/test/doc/login_extended_nullable_test.dart +++ b/packages/generator_tests/test/doc/login_extended_nullable_test.dart @@ -109,7 +109,7 @@ class ReactiveLoginExtendedNullableForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -118,7 +118,8 @@ class ReactiveLoginExtendedNullableForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginExtendedNullableForm? of( BuildContext context, { @@ -148,7 +149,7 @@ class ReactiveLoginExtendedNullableForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -169,7 +170,7 @@ class LoginExtendedNullableFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -180,7 +181,8 @@ class LoginExtendedNullableFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -279,7 +281,7 @@ class _LoginExtendedNullableFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -431,19 +433,19 @@ class LoginExtendedNullableForm } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map? get passwordErrors => passwordControl.errors; + Map? get passwordErrors => passwordControl.errors; - Map? get rememberMeErrors => rememberMeControl.errors; + Map? get rememberMeErrors => rememberMeControl.errors; - Map? get themeErrors => themeControl.errors; + Map? get themeErrors => themeControl.errors; - Map? get modeErrors => modeControl.errors; + Map? get modeErrors => modeControl.errors; - Map? get timeoutErrors => timeoutControl.errors; + Map? get timeoutErrors => timeoutControl.errors; - Map? get heightErrors => heightControl.errors; + Map? get heightErrors => heightControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/login_extended_output_test.dart b/packages/generator_tests/test/doc/login_extended_output_test.dart index 82b132bd..8bf0f7ba 100644 --- a/packages/generator_tests/test/doc/login_extended_output_test.dart +++ b/packages/generator_tests/test/doc/login_extended_output_test.dart @@ -163,7 +163,7 @@ class ReactiveLoginExtendedOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -172,7 +172,8 @@ class ReactiveLoginExtendedOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginExtendedOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -199,7 +200,7 @@ class ReactiveLoginExtendedOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -220,7 +221,7 @@ class LoginExtendedOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -231,7 +232,8 @@ class LoginExtendedOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -324,7 +326,7 @@ class _LoginExtendedOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -524,25 +526,25 @@ class LoginExtendedOForm } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map get email2Errors => email2Control.errors; + Map get email2Errors => email2Control.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; - Map get rememberMeErrors => rememberMeControl.errors; + Map get rememberMeErrors => rememberMeControl.errors; - Map get themeErrors => themeControl.errors; + Map get themeErrors => themeControl.errors; - Map get modeErrors => modeControl.errors; + Map get modeErrors => modeControl.errors; - Map get timeoutErrors => timeoutControl.errors; + Map get timeoutErrors => timeoutControl.errors; - Map get heightErrors => heightControl.errors; + Map get heightErrors => heightControl.errors; - Map? get unAnnotatedErrors => unAnnotatedControl.errors; + Map? get unAnnotatedErrors => unAnnotatedControl.errors; - Map get someIntListErrors => someIntListControl.errors; + Map get someIntListErrors => someIntListControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/login_extended_test.dart b/packages/generator_tests/test/doc/login_extended_test.dart index 4832a2ef..6aba0296 100644 --- a/packages/generator_tests/test/doc/login_extended_test.dart +++ b/packages/generator_tests/test/doc/login_extended_test.dart @@ -158,7 +158,7 @@ class ReactiveLoginExtendedForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -167,7 +167,8 @@ class ReactiveLoginExtendedForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginExtendedForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -194,7 +195,7 @@ class ReactiveLoginExtendedForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -215,7 +216,7 @@ class LoginExtendedFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -226,7 +227,8 @@ class LoginExtendedFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -319,7 +321,7 @@ class _LoginExtendedFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -501,23 +503,23 @@ class LoginExtendedForm implements FormModel { } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; - Map get rememberMeErrors => rememberMeControl.errors; + Map get rememberMeErrors => rememberMeControl.errors; - Map get themeErrors => themeControl.errors; + Map get themeErrors => themeControl.errors; - Map get modeErrors => modeControl.errors; + Map get modeErrors => modeControl.errors; - Map get timeoutErrors => timeoutControl.errors; + Map get timeoutErrors => timeoutControl.errors; - Map get heightErrors => heightControl.errors; + Map get heightErrors => heightControl.errors; - Map? get unAnnotatedErrors => unAnnotatedControl.errors; + Map? get unAnnotatedErrors => unAnnotatedControl.errors; - Map get someIntListErrors => someIntListControl.errors; + Map get someIntListErrors => someIntListControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/login_output_test.dart b/packages/generator_tests/test/doc/login_output_test.dart index 1e28ca45..378d5020 100644 --- a/packages/generator_tests/test/doc/login_output_test.dart +++ b/packages/generator_tests/test/doc/login_output_test.dart @@ -124,7 +124,7 @@ class ReactiveLoginOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -133,7 +133,8 @@ class ReactiveLoginOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -156,7 +157,7 @@ class ReactiveLoginOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -175,7 +176,7 @@ class LoginOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -186,7 +187,8 @@ class LoginOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -273,7 +275,7 @@ class _LoginOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -334,9 +336,9 @@ class LoginOForm implements FormModel { } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map? get passwordErrors => passwordControl.errors; + Map? get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/login_test.dart b/packages/generator_tests/test/doc/login_test.dart index 9261b6b7..06e96e7b 100644 --- a/packages/generator_tests/test/doc/login_test.dart +++ b/packages/generator_tests/test/doc/login_test.dart @@ -108,7 +108,7 @@ class ReactiveLoginForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -117,7 +117,8 @@ class ReactiveLoginForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -140,7 +141,7 @@ class ReactiveLoginForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -159,7 +160,7 @@ class LoginFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -170,7 +171,8 @@ class LoginFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -257,7 +259,7 @@ class _LoginFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -317,9 +319,9 @@ class LoginForm implements FormModel { } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/mailing_list_output_test.dart b/packages/generator_tests/test/doc/mailing_list_output_test.dart index b27181e1..6110f280 100644 --- a/packages/generator_tests/test/doc/mailing_list_output_test.dart +++ b/packages/generator_tests/test/doc/mailing_list_output_test.dart @@ -102,7 +102,7 @@ class ReactiveMailingListOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -111,7 +111,8 @@ class ReactiveMailingListOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static MailingListOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -138,7 +139,7 @@ class ReactiveMailingListOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -159,7 +160,7 @@ class MailingListOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -170,7 +171,8 @@ class MailingListOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -263,7 +265,7 @@ class _MailingListOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -309,7 +311,7 @@ class MailingListOForm implements FormModel { } } - Map get emailListErrors => emailListControl.errors; + Map get emailListErrors => emailListControl.errors; void get emailListFocus => form.focus(emailListControlPath()); diff --git a/packages/generator_tests/test/doc/mailing_list_test.dart b/packages/generator_tests/test/doc/mailing_list_test.dart index 9c4b1fd1..99fe08f3 100644 --- a/packages/generator_tests/test/doc/mailing_list_test.dart +++ b/packages/generator_tests/test/doc/mailing_list_test.dart @@ -102,7 +102,7 @@ class ReactiveMailingListForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -111,7 +111,8 @@ class ReactiveMailingListForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static MailingListForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -138,7 +139,7 @@ class ReactiveMailingListForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -158,7 +159,7 @@ class MailingListFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -169,7 +170,8 @@ class MailingListFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -261,7 +263,7 @@ class _MailingListFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -307,7 +309,7 @@ class MailingListForm implements FormModel { } } - Map get emailListErrors => emailListControl.errors; + Map get emailListErrors => emailListControl.errors; void get emailListFocus => form.focus(emailListControlPath()); diff --git a/packages/generator_tests/test/doc/nested_generics_output_test.dart b/packages/generator_tests/test/doc/nested_generics_output_test.dart index 144b90a3..84fc42a5 100644 --- a/packages/generator_tests/test/doc/nested_generics_output_test.dart +++ b/packages/generator_tests/test/doc/nested_generics_output_test.dart @@ -126,7 +126,7 @@ class ReactiveProductDetailsOForm

required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -135,7 +135,8 @@ class ReactiveProductDetailsOForm

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ProductDetailsOForm? of

( BuildContext context, { @@ -165,7 +166,7 @@ class ReactiveProductDetailsOForm

stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -189,7 +190,7 @@ class ProductDetailsOFormBuilder

this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -200,7 +201,8 @@ class ProductDetailsOFormBuilder

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -297,7 +299,7 @@ class _ProductDetailsOFormBuilderState

child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -361,9 +363,9 @@ class ProductDetailsOForm

} } - Map? get descriptionErrors => descriptionControl.errors; + Map? get descriptionErrors => descriptionControl.errors; - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; void get descriptionFocus => form.focus(descriptionControlPath()); @@ -781,9 +783,9 @@ class IdOForm

} } - Map? get companyNameErrors => companyNameControl.errors; + Map? get companyNameErrors => companyNameControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; void get companyNameFocus => form.focus(companyNameControlPath()); @@ -1460,7 +1462,7 @@ class ReactiveIdOForm

required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -1469,7 +1471,8 @@ class ReactiveIdOForm

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static IdOForm? of

( BuildContext context, { @@ -1497,7 +1500,7 @@ class ReactiveIdOForm

stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -1518,7 +1521,7 @@ class IdOFormBuilder

extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -1529,7 +1532,8 @@ class IdOFormBuilder

extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -1621,7 +1625,7 @@ class _IdOFormBuilderState

child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, diff --git a/packages/generator_tests/test/doc/nested_generics_test.dart b/packages/generator_tests/test/doc/nested_generics_test.dart index 94116b23..4d8e31f2 100644 --- a/packages/generator_tests/test/doc/nested_generics_test.dart +++ b/packages/generator_tests/test/doc/nested_generics_test.dart @@ -126,7 +126,7 @@ class ReactiveProductDetailsForm

required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -135,7 +135,8 @@ class ReactiveProductDetailsForm

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ProductDetailsForm? of

( BuildContext context, { @@ -165,7 +166,7 @@ class ReactiveProductDetailsForm

stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -189,7 +190,7 @@ class ProductDetailsFormBuilder

this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -200,7 +201,8 @@ class ProductDetailsFormBuilder

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -294,7 +296,7 @@ class _ProductDetailsFormBuilderState

child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -358,9 +360,9 @@ class ProductDetailsForm

} } - Map? get descriptionErrors => descriptionControl.errors; + Map? get descriptionErrors => descriptionControl.errors; - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; void get descriptionFocus => form.focus(descriptionControlPath()); @@ -774,9 +776,9 @@ class IdForm

} } - Map? get companyNameErrors => companyNameControl.errors; + Map? get companyNameErrors => companyNameControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; void get companyNameFocus => form.focus(companyNameControlPath()); @@ -1429,7 +1431,7 @@ class ReactiveIdForm

required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -1438,7 +1440,8 @@ class ReactiveIdForm

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static IdForm? of

( BuildContext context, { @@ -1466,7 +1469,7 @@ class ReactiveIdForm

stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -1487,7 +1490,7 @@ class IdFormBuilder

extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -1498,7 +1501,8 @@ class IdFormBuilder

extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -1590,7 +1594,7 @@ class _IdFormBuilderState

child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, diff --git a/packages/generator_tests/test/doc/nested_output.test.dart b/packages/generator_tests/test/doc/nested_output.test.dart index 27d4fc33..c86cd893 100644 --- a/packages/generator_tests/test/doc/nested_output.test.dart +++ b/packages/generator_tests/test/doc/nested_output.test.dart @@ -118,7 +118,7 @@ class ReactiveSubGroupOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -127,7 +127,8 @@ class ReactiveSubGroupOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SubGroupOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -152,7 +153,7 @@ class ReactiveSubGroupOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -172,7 +173,7 @@ class SubGroupOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -183,7 +184,8 @@ class SubGroupOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -274,7 +276,7 @@ class _SubGroupOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -318,7 +320,7 @@ class SubGroupOForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; void get idFocus => form.focus(idControlPath()); @@ -862,7 +864,7 @@ class ReactiveGroupOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -871,7 +873,8 @@ class ReactiveGroupOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static GroupOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -894,7 +897,7 @@ class ReactiveGroupOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -913,7 +916,7 @@ class GroupOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -924,7 +927,8 @@ class GroupOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -1011,7 +1015,7 @@ class _GroupOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -1073,9 +1077,9 @@ class GroupOForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get subGroupListErrors => subGroupListControl.errors; + Map get subGroupListErrors => subGroupListControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1767,7 +1771,7 @@ class ReactiveNestedOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -1776,7 +1780,8 @@ class ReactiveNestedOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static NestedOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -1801,7 +1806,7 @@ class ReactiveNestedOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -1820,7 +1825,7 @@ class NestedOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -1831,7 +1836,8 @@ class NestedOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -1922,7 +1928,7 @@ class _NestedOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -1967,7 +1973,7 @@ class NestedOForm implements FormModel { } } - Map get groupListErrors => groupListControl.errors; + Map get groupListErrors => groupListControl.errors; void get groupListFocus => form.focus(groupListControlPath()); diff --git a/packages/generator_tests/test/doc/profile_output_test.dart b/packages/generator_tests/test/doc/profile_output_test.dart index a7c85b44..1faf181f 100644 --- a/packages/generator_tests/test/doc/profile_output_test.dart +++ b/packages/generator_tests/test/doc/profile_output_test.dart @@ -339,7 +339,7 @@ class ReactiveProfileOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -348,7 +348,8 @@ class ReactiveProfileOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ProfileOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -373,7 +374,7 @@ class ReactiveProfileOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -393,7 +394,7 @@ class ProfileOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -404,7 +405,8 @@ class ProfileOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -495,7 +497,7 @@ class _ProfileOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -700,28 +702,28 @@ class ProfileOForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get anotherIdErrors => anotherIdControl.errors; + Map get anotherIdErrors => anotherIdControl.errors; - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map get chartingOrderErrors => chartingOrderControl.errors; + Map get chartingOrderErrors => chartingOrderControl.errors; - Map get numberingStandardErrors => + Map get numberingStandardErrors => numberingStandardControl.errors; - Map get measurementTypeErrors => + Map get measurementTypeErrors => measurementTypeControl.errors; - Map get audioGuidanceErrors => audioGuidanceControl.errors; + Map get audioGuidanceErrors => audioGuidanceControl.errors; - Map get incidenceFilterErrors => + Map get incidenceFilterErrors => incidenceFilterControl.errors; - Map get thresholdErrors => thresholdControl.errors; + Map get thresholdErrors => thresholdControl.errors; - Map get timerErrors => timerControl.errors; + Map get timerErrors => timerControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1737,22 +1739,22 @@ class IncidenceFilterOForm } } - Map get isMobilityEnabledErrors => + Map get isMobilityEnabledErrors => isMobilityEnabledControl.errors; - Map get isFurcationEnabledErrors => + Map get isFurcationEnabledErrors => isFurcationEnabledControl.errors; - Map get isBleedingEnabledErrors => + Map get isBleedingEnabledErrors => isBleedingEnabledControl.errors; - Map get isSuppurationEnabledErrors => + Map get isSuppurationEnabledErrors => isSuppurationEnabledControl.errors; - Map get isCalculusEnabledErrors => + Map get isCalculusEnabledErrors => isCalculusEnabledControl.errors; - Map get isPlaqueEnabledErrors => + Map get isPlaqueEnabledErrors => isPlaqueEnabledControl.errors; void get isMobilityEnabledFocus => form.focus(isMobilityEnabledControlPath()); @@ -2417,9 +2419,9 @@ class ThresholdSettingOForm } } - Map get isEnabledErrors => isEnabledControl.errors; + Map get isEnabledErrors => isEnabledControl.errors; - Map get valueErrors => valueControl.errors; + Map get valueErrors => valueControl.errors; void get isEnabledFocus => form.focus(isEnabledControlPath()); @@ -2797,9 +2799,9 @@ class TimerSettingOForm } } - Map get isEnabledErrors => isEnabledControl.errors; + Map get isEnabledErrors => isEnabledControl.errors; - Map get valueErrors => valueControl.errors; + Map get valueErrors => valueControl.errors; void get isEnabledFocus => form.focus(isEnabledControlPath()); diff --git a/packages/generator_tests/test/doc/profile_test.dart b/packages/generator_tests/test/doc/profile_test.dart index b42210aa..e8e11417 100644 --- a/packages/generator_tests/test/doc/profile_test.dart +++ b/packages/generator_tests/test/doc/profile_test.dart @@ -334,7 +334,7 @@ class ReactiveProfileForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -343,7 +343,8 @@ class ReactiveProfileForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ProfileForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -368,7 +369,7 @@ class ReactiveProfileForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -387,7 +388,7 @@ class ProfileFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -398,7 +399,8 @@ class ProfileFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -489,7 +491,7 @@ class _ProfileFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -694,28 +696,28 @@ class ProfileForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get anotherIdErrors => anotherIdControl.errors; + Map get anotherIdErrors => anotherIdControl.errors; - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map get chartingOrderErrors => chartingOrderControl.errors; + Map get chartingOrderErrors => chartingOrderControl.errors; - Map get numberingStandardErrors => + Map get numberingStandardErrors => numberingStandardControl.errors; - Map get measurementTypeErrors => + Map get measurementTypeErrors => measurementTypeControl.errors; - Map get audioGuidanceErrors => audioGuidanceControl.errors; + Map get audioGuidanceErrors => audioGuidanceControl.errors; - Map get incidenceFilterErrors => + Map get incidenceFilterErrors => incidenceFilterControl.errors; - Map get thresholdErrors => thresholdControl.errors; + Map get thresholdErrors => thresholdControl.errors; - Map get timerErrors => timerControl.errors; + Map get timerErrors => timerControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1730,22 +1732,22 @@ class IncidenceFilterForm } } - Map get isMobilityEnabledErrors => + Map get isMobilityEnabledErrors => isMobilityEnabledControl.errors; - Map get isFurcationEnabledErrors => + Map get isFurcationEnabledErrors => isFurcationEnabledControl.errors; - Map get isBleedingEnabledErrors => + Map get isBleedingEnabledErrors => isBleedingEnabledControl.errors; - Map get isSuppurationEnabledErrors => + Map get isSuppurationEnabledErrors => isSuppurationEnabledControl.errors; - Map get isCalculusEnabledErrors => + Map get isCalculusEnabledErrors => isCalculusEnabledControl.errors; - Map get isPlaqueEnabledErrors => + Map get isPlaqueEnabledErrors => isPlaqueEnabledControl.errors; void get isMobilityEnabledFocus => form.focus(isMobilityEnabledControlPath()); @@ -2408,9 +2410,9 @@ class ThresholdSettingForm } } - Map get isEnabledErrors => isEnabledControl.errors; + Map get isEnabledErrors => isEnabledControl.errors; - Map get valueErrors => valueControl.errors; + Map get valueErrors => valueControl.errors; void get isEnabledFocus => form.focus(isEnabledControlPath()); @@ -2783,9 +2785,9 @@ class TimerSettingForm implements FormModel { } } - Map get isEnabledErrors => isEnabledControl.errors; + Map get isEnabledErrors => isEnabledControl.errors; - Map get valueErrors => valueControl.errors; + Map get valueErrors => valueControl.errors; void get isEnabledFocus => form.focus(isEnabledControlPath()); diff --git a/packages/generator_tests/test/doc/recursive_test.dart b/packages/generator_tests/test/doc/recursive_test.dart index 07eb2209..8762d4a8 100644 --- a/packages/generator_tests/test/doc/recursive_test.dart +++ b/packages/generator_tests/test/doc/recursive_test.dart @@ -109,7 +109,7 @@ class ReactiveSecuredAreaForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -118,7 +118,8 @@ class ReactiveSecuredAreaForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SecuredAreaForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -145,7 +146,7 @@ class ReactiveSecuredAreaForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -165,7 +166,7 @@ class SecuredAreaFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -176,7 +177,8 @@ class SecuredAreaFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -268,7 +270,7 @@ class _SecuredAreaFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -370,13 +372,13 @@ class SecuredAreaForm implements FormModel { } } - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; - Map? get securedAreaErrors => securedAreaControl.errors; + Map? get securedAreaErrors => securedAreaControl.errors; - Map? get parcelSystemErrors => parcelSystemControl.errors; + Map? get parcelSystemErrors => parcelSystemControl.errors; - Map get subSecuredAreasErrors => + Map get subSecuredAreasErrors => subSecuredAreasControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1072,10 +1074,10 @@ class ParcelSystemForm implements FormModel { } } - Map get hasParcelSystemErrors => + Map get hasParcelSystemErrors => hasParcelSystemControl.errors; - Map get dataErrors => dataControl.errors; + Map get dataErrors => dataControl.errors; void get hasParcelSystemFocus => form.focus(hasParcelSystemControlPath()); @@ -1429,7 +1431,7 @@ class ParcelSystemDataForm } } - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; void get idFocus => form.focus(idControlPath()); diff --git a/packages/generator_tests/test/doc/renamed_basic_output_test.dart b/packages/generator_tests/test/doc/renamed_basic_output_test.dart index 233296a7..c10375cc 100644 --- a/packages/generator_tests/test/doc/renamed_basic_output_test.dart +++ b/packages/generator_tests/test/doc/renamed_basic_output_test.dart @@ -99,7 +99,7 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -108,7 +108,8 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SomeWiredNameForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -135,7 +136,7 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -156,7 +157,7 @@ class SomeWiredNameFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -167,7 +168,8 @@ class SomeWiredNameFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -260,7 +262,7 @@ class _SomeWiredNameFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -323,9 +325,9 @@ class SomeWiredNameForm } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map? get passwordErrors => passwordControl.errors; + Map? get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/renamed_basic_test.dart b/packages/generator_tests/test/doc/renamed_basic_test.dart index ccb04a7a..da7d63f4 100644 --- a/packages/generator_tests/test/doc/renamed_basic_test.dart +++ b/packages/generator_tests/test/doc/renamed_basic_test.dart @@ -99,7 +99,7 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -108,7 +108,8 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SomeWiredNameForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -135,7 +136,7 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -156,7 +157,7 @@ class SomeWiredNameFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -167,7 +168,8 @@ class SomeWiredNameFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -260,7 +262,7 @@ class _SomeWiredNameFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -321,9 +323,9 @@ class SomeWiredNameForm implements FormModel { } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/generator_tests/test/doc/user_profile_output_test.dart b/packages/generator_tests/test/doc/user_profile_output_test.dart index 6e1dfe4a..abc82a6d 100644 --- a/packages/generator_tests/test/doc/user_profile_output_test.dart +++ b/packages/generator_tests/test/doc/user_profile_output_test.dart @@ -125,7 +125,7 @@ class ReactiveUserProfileOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -134,7 +134,8 @@ class ReactiveUserProfileOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static UserProfileOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -161,7 +162,7 @@ class ReactiveUserProfileOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -182,7 +183,7 @@ class UserProfileOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -193,7 +194,8 @@ class UserProfileOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -286,7 +288,7 @@ class _UserProfileOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -400,15 +402,15 @@ class UserProfileOForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map? get firstNameErrors => firstNameControl.errors; + Map? get firstNameErrors => firstNameControl.errors; - Map? get lastNameErrors => lastNameControl.errors; + Map? get lastNameErrors => lastNameControl.errors; - Map get homeErrors => homeControl.errors; + Map get homeErrors => homeControl.errors; - Map? get officeErrors => officeControl.errors; + Map? get officeErrors => officeControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1069,11 +1071,11 @@ class AddressOForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get zipErrors => zipControl.errors; + Map? get zipErrors => zipControl.errors; void get streetFocus => form.focus(streetControlPath()); diff --git a/packages/generator_tests/test/doc/user_profile_test.dart b/packages/generator_tests/test/doc/user_profile_test.dart index 42a9a8e8..add9ce22 100644 --- a/packages/generator_tests/test/doc/user_profile_test.dart +++ b/packages/generator_tests/test/doc/user_profile_test.dart @@ -125,7 +125,7 @@ class ReactiveUserProfileForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -134,7 +134,8 @@ class ReactiveUserProfileForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static UserProfileForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -161,7 +162,7 @@ class ReactiveUserProfileForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -181,7 +182,7 @@ class UserProfileFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -192,7 +193,8 @@ class UserProfileFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -284,7 +286,7 @@ class _UserProfileFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -396,15 +398,15 @@ class UserProfileForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get firstNameErrors => firstNameControl.errors; + Map get firstNameErrors => firstNameControl.errors; - Map get lastNameErrors => lastNameControl.errors; + Map get lastNameErrors => lastNameControl.errors; - Map get homeErrors => homeControl.errors; + Map get homeErrors => homeControl.errors; - Map? get officeErrors => officeControl.errors; + Map? get officeErrors => officeControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1018,11 +1020,11 @@ class AddressForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get zipErrors => zipControl.errors; + Map? get zipErrors => zipControl.errors; void get streetFocus => form.focus(streetControlPath()); diff --git a/packages/reactive_forms_annotations/CHANGELOG.md b/packages/reactive_forms_annotations/CHANGELOG.md index 38600dbe..30df6424 100644 --- a/packages/reactive_forms_annotations/CHANGELOG.md +++ b/packages/reactive_forms_annotations/CHANGELOG.md @@ -1,3 +1,15 @@ +## [8.1.0-beta2] + +* build 4 + +## [8.1.0-beta0] + +* build 3 + +## [8.0.1] + +* bugfix + ## [8.0.0] * Rf18 diff --git a/packages/reactive_forms_annotations/pubspec.yaml b/packages/reactive_forms_annotations/pubspec.yaml index 42fc5e3e..8b5ae7a9 100644 --- a/packages/reactive_forms_annotations/pubspec.yaml +++ b/packages/reactive_forms_annotations/pubspec.yaml @@ -2,14 +2,14 @@ name: reactive_forms_annotations description: Annotations for reactive_forms_generator repository: https://github.com/artflutter/reactive_forms_generator -version: 7.5.0-beta-1 +version: 8.2.0 environment: sdk: ">=3.8.0 <4.0.0" resolution: workspace dependencies: - reactive_forms: ^17.0.0 + reactive_forms: ^18.2.2 collection: ^1.18.0 logging: ^1.3.0 flutter: diff --git a/packages/reactive_forms_generator/CHANGELOG.md b/packages/reactive_forms_generator/CHANGELOG.md index 44cd59eb..1990038a 100644 --- a/packages/reactive_forms_generator/CHANGELOG.md +++ b/packages/reactive_forms_generator/CHANGELOG.md @@ -1,3 +1,27 @@ +## [8.1.0-beta2] + +* build 4 + +## [8.1.0-beta0] + +* build 3 + +## [8.0.3] + +* Recursive forms bugfix fix + +## [8.0.1] + +* bugfix + +## [8.0.0] + +* Rf18 + +## [8.0.0-beta0] + +* Rf18 + ## [7.5.0-beta1] * properly handle missing controls in form @@ -48,7 +72,23 @@ ## [7.0.4] -* fixes +* ReactiveFormArrayItemBuilder + +## [7.0.3] + +* fix + +## [7.0.2] + +* fix + +## [7.0.1] + +* array builder improvements + +## [7.0.0] + +* v7 release ## [7.0.0-beta4] diff --git a/packages/reactive_forms_generator/example/lib/docs/animated_url_list/animated_url_list.gform.dart b/packages/reactive_forms_generator/example/lib/docs/animated_url_list/animated_url_list.gform.dart index ca81c12d..ad752b89 100644 --- a/packages/reactive_forms_generator/example/lib/docs/animated_url_list/animated_url_list.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/animated_url_list/animated_url_list.gform.dart @@ -53,7 +53,7 @@ class ReactiveAnimatedUrlListForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveAnimatedUrlListForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static AnimatedUrlListForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveAnimatedUrlListForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class AnimatedUrlListFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class AnimatedUrlListFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -215,7 +217,7 @@ class _AnimatedUrlListFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -262,7 +264,7 @@ class AnimatedUrlListForm } } - Map get urlListErrors => urlListControl.errors; + Map get urlListErrors => urlListControl.errors; void get urlListFocus => form.focus(urlListControlPath()); @@ -668,9 +670,9 @@ class UrlEntityForm implements FormModel { } } - Map get labelErrors => labelControl.errors; + Map get labelErrors => labelControl.errors; - Map get urlErrors => urlControl.errors; + Map get urlErrors => urlControl.errors; void get labelFocus => form.focus(labelControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/animated_url_list/animated_url_list_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/animated_url_list/animated_url_list_output.gform.dart index 200ffa9f..4a4fa788 100644 --- a/packages/reactive_forms_generator/example/lib/docs/animated_url_list/animated_url_list_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/animated_url_list/animated_url_list_output.gform.dart @@ -53,7 +53,7 @@ class ReactiveAnimatedUrlLisOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveAnimatedUrlLisOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static AnimatedUrlLisOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveAnimatedUrlLisOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class AnimatedUrlLisOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class AnimatedUrlLisOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -215,7 +217,7 @@ class _AnimatedUrlLisOFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -262,7 +264,7 @@ class AnimatedUrlLisOForm } } - Map get urlListErrors => urlListControl.errors; + Map get urlListErrors => urlListControl.errors; void get urlListFocus => form.focus(urlListControlPath()); @@ -669,9 +671,9 @@ class UrlEntityOForm implements FormModel { } } - Map? get labelErrors => labelControl.errors; + Map? get labelErrors => labelControl.errors; - Map? get urlErrors => urlControl.errors; + Map? get urlErrors => urlControl.errors; void get labelFocus => form.focus(labelControlPath()); @@ -1038,7 +1040,6 @@ class UrlEntityOForm implements FormModel { @Rf(output: true) class AnimatedUrlLisOOutput { final List urlList; - AnimatedUrlLisOOutput({@RfArray() required this.urlList}); } @@ -1046,7 +1047,6 @@ class AnimatedUrlLisOOutput { class UrlEntityOOutput { final String label; final String url; - UrlEntityOOutput({ @RfControl(validators: [RequiredValidator()]) required this.label, @RfControl(validators: [RequiredValidator()]) required this.url, 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 6d3babe7..954ce156 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 @@ -53,7 +53,7 @@ class ReactiveAnnotatelessForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveAnnotatelessForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static AnnotatelessForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveAnnotatelessForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class AnnotatelessFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class AnnotatelessFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _AnnotatelessFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -275,9 +277,9 @@ class AnnotatelessForm implements FormModel { } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 b7f6707a..d8018e4c 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 @@ -53,7 +53,7 @@ class ReactiveAnnotatelessOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveAnnotatelessOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static AnnotatelessOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveAnnotatelessOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class AnnotatelessOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class AnnotatelessOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _AnnotatelessOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -276,9 +278,9 @@ class AnnotatelessOForm } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 79c4d7fd..230e0720 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 @@ -53,7 +53,7 @@ class ReactiveArrayNullableForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveArrayNullableForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ArrayNullableForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveArrayNullableForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class ArrayNullableFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class ArrayNullableFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _ArrayNullableFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -360,18 +362,19 @@ class ArrayNullableForm implements FormModel { } } - Map? get someListErrors => someListControl.errors; + Map? get someListErrors => someListControl.errors; - Map get someListRequiredErrors => + Map get someListRequiredErrors => someListRequiredControl.errors; - Map get emailListErrors => emailListControl.errors; + Map get emailListErrors => emailListControl.errors; - Map get fruitListErrors => fruitListControl.errors; + Map get fruitListErrors => fruitListControl.errors; - Map? get vegetablesListErrors => vegetablesListControl.errors; + Map? get vegetablesListErrors => + vegetablesListControl.errors; - Map? get modeListErrors => modeListControl.errors; + Map? get modeListErrors => modeListControl.errors; void get someListFocus => form.focus(someListControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable_output.gform.dart index 7abb7680..48f47903 100644 --- a/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/array_nullable/array_nullable_output.gform.dart @@ -53,7 +53,7 @@ class ReactiveArrayNullableOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveArrayNullableOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ArrayNullableOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveArrayNullableOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class ArrayNullableOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class ArrayNullableOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _ArrayNullableOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -341,15 +343,16 @@ class ArrayNullableOForm } } - Map? get someListErrors => someListControl.errors; + Map? get someListErrors => someListControl.errors; - Map get emailListErrors => emailListControl.errors; + Map get emailListErrors => emailListControl.errors; - Map get fruitListErrors => fruitListControl.errors; + Map get fruitListErrors => fruitListControl.errors; - Map? get vegetablesListErrors => vegetablesListControl.errors; + Map? get vegetablesListErrors => + vegetablesListControl.errors; - Map? get modeListErrors => modeListControl.errors; + Map? get modeListErrors => modeListControl.errors; void get someListFocus => form.focus(someListControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/create/create_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/create/create_output.gform.dart index 194141d9..82e1873a 100644 --- a/packages/reactive_forms_generator/example/lib/docs/create/create_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/create/create_output.gform.dart @@ -53,7 +53,7 @@ class ReactiveMSICreateForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveMSICreateForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static MSICreateForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -87,7 +88,7 @@ class ReactiveMSICreateForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -107,7 +108,7 @@ class MSICreateFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -118,7 +119,8 @@ class MSICreateFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -209,7 +211,7 @@ class _MSICreateFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -416,26 +418,27 @@ class MSICreateForm implements FormModel { } } - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; - Map? get businessNumberErrors => businessNumberControl.errors; + Map? get businessNumberErrors => + businessNumberControl.errors; - Map? get fileIdsErrors => fileIdsControl.errors; + Map? get fileIdsErrors => fileIdsControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map get sameMailingAddressAsCompanyErrors => + Map get sameMailingAddressAsCompanyErrors => sameMailingAddressAsCompanyControl.errors; - Map get companyAddressErrors => companyAddressControl.errors; + Map get companyAddressErrors => companyAddressControl.errors; - Map get primaryContactErrors => primaryContactControl.errors; + Map get primaryContactErrors => primaryContactControl.errors; - Map get mailingAddressErrors => mailingAddressControl.errors; + Map get mailingAddressErrors => mailingAddressControl.errors; - Map get adminsErrors => adminsControl.errors; + Map get adminsErrors => adminsControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1645,14 +1648,14 @@ class AddressForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get stateOrProvinceErrors => + Map? get stateOrProvinceErrors => stateOrProvinceControl.errors; - Map? get zipCodeErrors => zipCodeControl.errors; + Map? get zipCodeErrors => zipCodeControl.errors; void get streetFocus => form.focus(streetControlPath()); @@ -2285,11 +2288,11 @@ class PrimaryContactForm } } - Map? get fullNameErrors => fullNameControl.errors; + Map? get fullNameErrors => fullNameControl.errors; - Map? get jobTitleErrors => jobTitleControl.errors; + Map? get jobTitleErrors => jobTitleControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; void get fullNameFocus => form.focus(fullNameControlPath()); @@ -2828,11 +2831,11 @@ class AdminContactInformationForm } } - Map? get firstNameErrors => firstNameControl.errors; + Map? get firstNameErrors => firstNameControl.errors; - Map? get lastNameErrors => lastNameControl.errors; + Map? get lastNameErrors => lastNameControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; void get firstNameFocus => form.focus(firstNameControlPath()); 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 653ff1c9..61277527 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 @@ -53,7 +53,7 @@ class ReactiveDeliveryListForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveDeliveryListForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static DeliveryListForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveDeliveryListForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class DeliveryListFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class DeliveryListFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _DeliveryListFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -281,9 +283,9 @@ class DeliveryListForm implements FormModel { } } - Map get deliveryListErrors => deliveryListControl.errors; + Map get deliveryListErrors => deliveryListControl.errors; - Map? get clientListErrors => clientListControl.errors; + Map? get clientListErrors => clientListControl.errors; void get deliveryListFocus => form.focus(deliveryListControlPath()); @@ -903,9 +905,9 @@ class DeliveryPointForm implements FormModel { } } - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; void get nameFocus => form.focus(nameControlPath()); @@ -1292,9 +1294,9 @@ class AddressForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; void get streetFocus => form.focus(streetControlPath()); @@ -1725,11 +1727,11 @@ class ClientForm implements FormModel { } } - Map get clientTypeErrors => clientTypeControl.errors; + Map get clientTypeErrors => clientTypeControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get notesErrors => notesControl.errors; + Map? get notesErrors => notesControl.errors; void get clientTypeFocus => form.focus(clientTypeControlPath()); @@ -2444,7 +2446,7 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -2453,7 +2455,8 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static StandaloneDeliveryPointForm? of( BuildContext context, { @@ -2483,7 +2486,7 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -2504,7 +2507,7 @@ class StandaloneDeliveryPointFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -2515,7 +2518,8 @@ class StandaloneDeliveryPointFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -2614,7 +2618,7 @@ class _StandaloneDeliveryPointFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -2679,9 +2683,9 @@ class StandaloneDeliveryPointForm } } - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; void get nameFocus => form.focus(nameControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/delivery_list/delivery_list_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/delivery_list/delivery_list_output.gform.dart index 81275f12..5ef4a483 100644 --- a/packages/reactive_forms_generator/example/lib/docs/delivery_list/delivery_list_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/delivery_list/delivery_list_output.gform.dart @@ -53,7 +53,7 @@ class ReactiveDeliveryListOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveDeliveryListOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static DeliveryListOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveDeliveryListOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class DeliveryListOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class DeliveryListOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _DeliveryListOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -282,9 +284,9 @@ class DeliveryListOForm } } - Map get deliveryListErrors => deliveryListControl.errors; + Map get deliveryListErrors => deliveryListControl.errors; - Map? get clientListErrors => clientListControl.errors; + Map? get clientListErrors => clientListControl.errors; void get deliveryListFocus => form.focus(deliveryListControlPath()); @@ -907,9 +909,9 @@ class DeliveryPointOForm } } - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; void get nameFocus => form.focus(nameControlPath()); @@ -1297,9 +1299,9 @@ class AddressOForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; void get streetFocus => form.focus(streetControlPath()); @@ -1731,11 +1733,11 @@ class ClientOForm implements FormModel { } } - Map get clientTypeErrors => clientTypeControl.errors; + Map get clientTypeErrors => clientTypeControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get notesErrors => notesControl.errors; + Map? get notesErrors => notesControl.errors; void get clientTypeFocus => form.focus(clientTypeControlPath()); @@ -2502,7 +2504,7 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -2511,7 +2513,8 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static StandaloneDeliveryPointForm? of( BuildContext context, { @@ -2541,7 +2544,7 @@ class ReactiveStandaloneDeliveryPointForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -2562,7 +2565,7 @@ class StandaloneDeliveryPointFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -2573,7 +2576,8 @@ class StandaloneDeliveryPointFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -2672,7 +2676,7 @@ class _StandaloneDeliveryPointFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -2738,9 +2742,9 @@ class StandaloneDeliveryPointForm } } - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; void get nameFocus => form.focus(nameControlPath()); 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 75b6174a..db163103 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 @@ -53,7 +53,7 @@ class ReactiveFreezedClassForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveFreezedClassForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static FreezedClassForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveFreezedClassForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class FreezedClassFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class FreezedClassFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _FreezedClassFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -345,17 +347,17 @@ class FreezedClassForm implements FormModel { } } - Map? get genderErrors => genderControl.errors; + Map? get genderErrors => genderControl.errors; - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get logoImageErrors => logoImageControl.errors; + Map? get logoImageErrors => logoImageControl.errors; - Map? get yearErrors => yearControl.errors; + Map? get yearErrors => yearControl.errors; - Map get selectedSpacesErrors => selectedSpacesControl.errors; + Map get selectedSpacesErrors => selectedSpacesControl.errors; void get genderFocus => form.focus(genderControlPath()); 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 412dd485..9cd2ed9e 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 @@ -53,7 +53,7 @@ class ReactiveFreezedClassOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveFreezedClassOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static FreezedClassOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveFreezedClassOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class FreezedClassOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class FreezedClassOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _FreezedClassOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -397,23 +399,23 @@ class FreezedClassOForm } } - Map? get genderErrors => genderControl.errors; + Map? get genderErrors => genderControl.errors; - Map? get genderRErrors => genderRControl.errors; + Map? get genderRErrors => genderRControl.errors; - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; - Map? get idRErrors => idRControl.errors; + Map? get idRErrors => idRControl.errors; - Map get idR2Errors => idR2Control.errors; + Map get idR2Errors => idR2Control.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get logoImageErrors => logoImageControl.errors; + Map? get logoImageErrors => logoImageControl.errors; - Map? get yearErrors => yearControl.errors; + Map? get yearErrors => yearControl.errors; - Map get selectedSpacesErrors => selectedSpacesControl.errors; + Map get selectedSpacesErrors => selectedSpacesControl.errors; void get genderFocus => form.focus(genderControlPath()); 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 72a1bb1f..596eed40 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 @@ -46,7 +46,7 @@ class ReactiveTestForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -55,7 +55,8 @@ class ReactiveTestForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static TestForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -78,7 +79,7 @@ class ReactiveTestForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -97,7 +98,7 @@ class TestFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -108,7 +109,8 @@ class TestFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function(BuildContext context, TestForm formModel, Widget? child) builder; @@ -191,7 +193,7 @@ class _TestFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -253,9 +255,9 @@ class TestForm implements FormModel { } } - Map get titleErrors => titleControl.errors; + Map get titleErrors => titleControl.errors; - Map? get descriptionErrors => descriptionControl.errors; + Map? get descriptionErrors => descriptionControl.errors; void get titleFocus => form.focus(titleControlPath()); 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 e24b0e61..66a29f92 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 @@ -50,7 +50,7 @@ class ReactiveTagsForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -59,7 +59,8 @@ class ReactiveTagsForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static TagsForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -84,7 +85,7 @@ class ReactiveTagsForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -103,7 +104,7 @@ class TagsFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -114,7 +115,8 @@ class TagsFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -205,7 +207,7 @@ class _TagsFormBuilderState extends State> { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -248,7 +250,7 @@ class TagsForm implements FormModel, Tags> { } } - Map? get tagsErrors => tagsControl.errors; + Map? get tagsErrors => tagsControl.errors; void get tagsFocus => form.focus(tagsControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/generic/generic_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/generic/generic_output.gform.dart index 1704a8e8..ac3af5fc 100644 --- a/packages/reactive_forms_generator/example/lib/docs/generic/generic_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/generic/generic_output.gform.dart @@ -50,7 +50,7 @@ class ReactiveTagsOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -59,7 +59,8 @@ class ReactiveTagsOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static TagsOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -84,7 +85,7 @@ class ReactiveTagsOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -104,7 +105,7 @@ class TagsOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -115,7 +116,8 @@ class TagsOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -206,7 +208,7 @@ class _TagsOFormBuilderState extends State> { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -249,7 +251,7 @@ class TagsOForm implements FormModel, TagsOOutput> { } } - Map? get tagsErrors => tagsControl.errors; + Map? get tagsErrors => tagsControl.errors; void get tagsFocus => form.focus(tagsControlPath()); 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 78c42dff..8c2be228 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 @@ -54,7 +54,7 @@ class ReactiveStatusListForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -63,7 +63,8 @@ class ReactiveStatusListForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static StatusListForm? of( BuildContext context, { @@ -93,7 +94,7 @@ class ReactiveStatusListForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -114,7 +115,7 @@ class StatusListFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -125,7 +126,8 @@ class StatusListFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -219,7 +221,7 @@ class _StatusListFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -264,7 +266,7 @@ class StatusListForm } } - Map get listErrors => listControl.errors; + Map get listErrors => listControl.errors; void get listFocus => form.focus(listControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/generic_status_list/generic_status_list_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/generic_status_list/generic_status_list_output.gform.dart index d51f8812..c912d9a6 100644 --- a/packages/reactive_forms_generator/example/lib/docs/generic_status_list/generic_status_list_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/generic_status_list/generic_status_list_output.gform.dart @@ -54,7 +54,7 @@ class ReactiveStatusListOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -63,7 +63,8 @@ class ReactiveStatusListOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static StatusListOForm? of( BuildContext context, { @@ -93,7 +94,7 @@ class ReactiveStatusListOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -114,7 +115,7 @@ class StatusListOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -125,7 +126,8 @@ class StatusListOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -219,7 +221,7 @@ class _StatusListOFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -264,7 +266,7 @@ class StatusListOForm } } - Map get listErrors => listControl.errors; + Map get listErrors => listControl.errors; void get listFocus => form.focus(listControlPath()); 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 d24cada0..fcece4d9 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 @@ -50,7 +50,7 @@ class ReactiveGroupForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -59,7 +59,8 @@ class ReactiveGroupForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static GroupForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -82,7 +83,7 @@ class ReactiveGroupForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -101,7 +102,7 @@ class GroupFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -112,7 +113,8 @@ class GroupFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -199,7 +201,7 @@ class _GroupFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -296,13 +298,13 @@ class GroupForm implements FormModel { } } - Map? get personalErrors => personalControl.errors; + Map? get personalErrors => personalControl.errors; - Map? get phoneErrors => phoneControl.errors; + Map? get phoneErrors => phoneControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; - Map? get address2Errors => address2Control.errors; + Map? get address2Errors => address2Control.errors; void get personalFocus => form.focus(personalControlPath()); @@ -890,9 +892,9 @@ class PersonalForm implements FormModel { } } - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; void get nameFocus => form.focus(nameControlPath()); @@ -1310,9 +1312,9 @@ class PhoneForm implements FormModel { } } - Map? get phoneNumberErrors => phoneNumberControl.errors; + Map? get phoneNumberErrors => phoneNumberControl.errors; - Map? get countryIsoErrors => countryIsoControl.errors; + Map? get countryIsoErrors => countryIsoControl.errors; void get phoneNumberFocus => form.focus(phoneNumberControlPath()); @@ -1743,11 +1745,11 @@ class AddressForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get zipErrors => zipControl.errors; + Map? get zipErrors => zipControl.errors; void get streetFocus => form.focus(streetControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/group/group_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/group/group_output.gform.dart index 39b6120b..ddbcc197 100644 --- a/packages/reactive_forms_generator/example/lib/docs/group/group_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/group/group_output.gform.dart @@ -53,7 +53,7 @@ class ReactiveGroupOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveGroupOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static GroupOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -85,7 +86,7 @@ class ReactiveGroupOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -104,7 +105,7 @@ class GroupOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -115,7 +116,8 @@ class GroupOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -202,7 +204,7 @@ class _GroupOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -302,13 +304,13 @@ class GroupOForm implements FormModel { } } - Map? get personalErrors => personalControl.errors; + Map? get personalErrors => personalControl.errors; - Map? get phoneErrors => phoneControl.errors; + Map? get phoneErrors => phoneControl.errors; - Map? get addressErrors => addressControl.errors; + Map? get addressErrors => addressControl.errors; - Map? get address2Errors => address2Control.errors; + Map? get address2Errors => address2Control.errors; void get personalFocus => form.focus(personalControlPath()); @@ -901,9 +903,9 @@ class PersonalOForm implements FormModel { } } - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; void get nameFocus => form.focus(nameControlPath()); @@ -1322,9 +1324,9 @@ class PhoneOForm implements FormModel { } } - Map? get phoneNumberErrors => phoneNumberControl.errors; + Map? get phoneNumberErrors => phoneNumberControl.errors; - Map? get countryIsoErrors => countryIsoControl.errors; + Map? get countryIsoErrors => countryIsoControl.errors; void get phoneNumberFocus => form.focus(phoneNumberControlPath()); @@ -1762,11 +1764,11 @@ class AddressOForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get zipErrors => zipControl.errors; + Map? get zipErrors => zipControl.errors; void get streetFocus => form.focus(streetControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/issue_203/issue_203.dart b/packages/reactive_forms_generator/example/lib/docs/issue_203/issue_203.dart new file mode 100644 index 00000000..9ae82a75 --- /dev/null +++ b/packages/reactive_forms_generator/example/lib/docs/issue_203/issue_203.dart @@ -0,0 +1,19 @@ + +import 'package:reactive_forms_annotations/reactive_forms_annotations.dart'; + +part 'issue_203.gform.dart'; + +@Rf() +final class LoginFormModel { + final String domain; + final String username; + final String password; + final bool rememberMe; + + const LoginFormModel({ + @RfControl(validators: [RequiredValidator()]) this.domain = '', + @RfControl(validators: [RequiredValidator()]) this.username = '', + @RfControl(validators: [RequiredValidator()]) this.password = '', + @RfControl() this.rememberMe = true, + }); +} \ No newline at end of file diff --git a/packages/reactive_forms_generator/example/lib/docs/issue_203/issue_203.gform.dart b/packages/reactive_forms_generator/example/lib/docs/issue_203/issue_203.gform.dart new file mode 100644 index 00000000..a3e4a3c5 --- /dev/null +++ b/packages/reactive_forms_generator/example/lib/docs/issue_203/issue_203.gform.dart @@ -0,0 +1,1021 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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 'issue_203.dart'; + +// ************************************************************************** +// ReactiveFormsGenerator +// ************************************************************************** + +class ReactiveLoginFormModelFormConsumer extends StatelessWidget { + const ReactiveLoginFormModelFormConsumer({ + Key? key, + required this.builder, + this.child, + }) : super(key: key); + + final Widget? child; + + final Widget Function( + BuildContext context, + LoginFormModelForm formModel, + Widget? child, + ) + builder; + + @override + Widget build(BuildContext context) { + final formModel = ReactiveLoginFormModelForm.of(context); + + if (formModel is! LoginFormModelForm) { + throw FormControlParentNotFoundException(this); + } + return builder(context, formModel, child); + } +} + +class LoginFormModelFormInheritedStreamer extends InheritedStreamer { + const LoginFormModelFormInheritedStreamer({ + Key? key, + required this.form, + required Stream stream, + required Widget child, + }) : super(stream, child, key: key); + + final LoginFormModelForm form; +} + +class ReactiveLoginFormModelForm extends StatelessWidget { + const ReactiveLoginFormModelForm({ + Key? key, + required this.form, + required this.child, + this.canPop, + this.onPopInvokedWithResult, + }) : super(key: key); + + final Widget child; + + final LoginFormModelForm form; + + final bool Function(FormGroup formGroup)? canPop; + + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; + + static LoginFormModelForm? of(BuildContext context, {bool listen = true}) { + if (listen) { + return context + .dependOnInheritedWidgetOfExactType< + LoginFormModelFormInheritedStreamer + >() + ?.form; + } + + final element = context + .getElementForInheritedWidgetOfExactType< + LoginFormModelFormInheritedStreamer + >(); + return element == null + ? null + : (element.widget as LoginFormModelFormInheritedStreamer).form; + } + + @override + Widget build(BuildContext context) { + return LoginFormModelFormInheritedStreamer( + form: form, + stream: form.form.statusChanged, + child: ReactiveFormPopScope( + canPop: canPop, + onPopInvokedWithResult: onPopInvokedWithResult, + child: child, + ), + ); + } +} + +extension ReactiveReactiveLoginFormModelFormExt on BuildContext { + LoginFormModelForm? loginFormModelFormWatch() => + ReactiveLoginFormModelForm.of(this); + + LoginFormModelForm? loginFormModelFormRead() => + ReactiveLoginFormModelForm.of(this, listen: false); +} + +class LoginFormModelFormBuilder extends StatefulWidget { + const LoginFormModelFormBuilder({ + Key? key, + this.model, + this.child, + this.canPop, + this.onPopInvokedWithResult, + required this.builder, + this.initState, + }) : super(key: key); + + final LoginFormModel? model; + + final Widget? child; + + final bool Function(FormGroup formGroup)? canPop; + + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; + + final Widget Function( + BuildContext context, + LoginFormModelForm formModel, + Widget? child, + ) + builder; + + final void Function(BuildContext context, LoginFormModelForm formModel)? + initState; + + @override + _LoginFormModelFormBuilderState createState() => + _LoginFormModelFormBuilderState(); +} + +class _LoginFormModelFormBuilderState extends State { + late LoginFormModelForm _formModel; + + StreamSubscription? _logSubscription; + + @override + void initState() { + _formModel = LoginFormModelForm( + LoginFormModelForm.formElements(widget.model), + null, + null, + ); + + if (_formModel.form.disabled) { + _formModel.form.markAsDisabled(); + } + + widget.initState?.call(context, _formModel); + + _logSubscription = _logLoginFormModelForm.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 + if (e.level >= Level.SEVERE) { + final Object? error = e.error; + FlutterError.dumpErrorToConsole( + FlutterErrorDetails( + exception: error is Exception ? error : Exception(error), + stack: e.stackTrace, + library: e.loggerName, + context: ErrorDescription(e.message), + ), + ); + } else { + log( + e.message, + time: e.time, + sequenceNumber: e.sequenceNumber, + level: e.level.value, + name: e.loggerName, + zone: e.zone, + error: e.error, + stackTrace: e.stackTrace, + ); + } + }); + + super.initState(); + } + + @override + void didUpdateWidget(covariant LoginFormModelFormBuilder oldWidget) { + if (widget.model != oldWidget.model) { + _formModel.updateValue(widget.model); + } + + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _formModel.form.dispose(); + _logSubscription?.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return ReactiveLoginFormModelForm( + key: ObjectKey(_formModel), + form: _formModel, + // canPop: widget.canPop, + // onPopInvoked: widget.onPopInvoked, + child: ReactiveFormBuilder( + form: () => _formModel.form, + canPop: widget.canPop, + onPopInvokedWithResult: widget.onPopInvokedWithResult, + builder: (context, formGroup, child) => + widget.builder(context, _formModel, widget.child), + child: widget.child, + ), + ); + } +} + +final _logLoginFormModelForm = Logger.detached('LoginFormModelForm'); + +class LoginFormModelForm implements FormModel { + LoginFormModelForm(this.form, this.path, this._formModel) + : initial = form.rawValue; + + static const String domainControlName = "domain"; + + static const String usernameControlName = "username"; + + static const String passwordControlName = "password"; + + static const String rememberMeControlName = "rememberMe"; + + final FormGroup form; + + final String? path; + + // ignore: unused_field + final FormModel? _formModel; + + final Map _disabled = {}; + + @override + final Map initial; + + String domainControlPath() => pathBuilder(domainControlName); + + String usernameControlPath() => pathBuilder(usernameControlName); + + String passwordControlPath() => pathBuilder(passwordControlName); + + String rememberMeControlPath() => pathBuilder(rememberMeControlName); + + String get _domainValue => domainControl.value ?? ''; + + String get _usernameValue => usernameControl.value ?? ''; + + String get _passwordValue => passwordControl.value ?? ''; + + bool get _rememberMeValue => rememberMeControl.value ?? true; + + String get _domainRawValue => domainControl.value ?? ''; + + String get _usernameRawValue => usernameControl.value ?? ''; + + String get _passwordRawValue => passwordControl.value ?? ''; + + bool get _rememberMeRawValue => rememberMeControl.value ?? true; + + bool get containsDomain { + try { + form.control(domainControlPath()); + return true; + } catch (e) { + return false; + } + } + + bool get containsUsername { + try { + form.control(usernameControlPath()); + return true; + } catch (e) { + return false; + } + } + + bool get containsPassword { + try { + form.control(passwordControlPath()); + return true; + } catch (e) { + return false; + } + } + + bool get containsRememberMe { + try { + form.control(rememberMeControlPath()); + return true; + } catch (e) { + return false; + } + } + + Map get domainErrors => domainControl.errors; + + Map get usernameErrors => usernameControl.errors; + + Map get passwordErrors => passwordControl.errors; + + Map get rememberMeErrors => rememberMeControl.errors; + + void get domainFocus => form.focus(domainControlPath()); + + void get usernameFocus => form.focus(usernameControlPath()); + + void get passwordFocus => form.focus(passwordControlPath()); + + void get rememberMeFocus => form.focus(rememberMeControlPath()); + + void domainValueUpdate( + String value, { + bool updateParent = true, + bool emitEvent = true, + }) { + domainControl.updateValue( + value, + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + void usernameValueUpdate( + String value, { + bool updateParent = true, + bool emitEvent = true, + }) { + usernameControl.updateValue( + value, + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + void passwordValueUpdate( + String value, { + bool updateParent = true, + bool emitEvent = true, + }) { + passwordControl.updateValue( + value, + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + void rememberMeValueUpdate( + bool value, { + bool updateParent = true, + bool emitEvent = true, + }) { + rememberMeControl.updateValue( + value, + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + void domainValuePatch( + String value, { + bool updateParent = true, + bool emitEvent = true, + }) { + domainControl.patchValue( + value, + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + void usernameValuePatch( + String value, { + bool updateParent = true, + bool emitEvent = true, + }) { + usernameControl.patchValue( + value, + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + void passwordValuePatch( + String value, { + bool updateParent = true, + bool emitEvent = true, + }) { + passwordControl.patchValue( + value, + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + void rememberMeValuePatch( + bool value, { + bool updateParent = true, + bool emitEvent = true, + }) { + rememberMeControl.patchValue( + value, + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + void domainValueReset( + String value, { + bool updateParent = true, + bool emitEvent = true, + bool removeFocus = false, + bool? disabled, + }) => domainControl.reset( + value: value, + updateParent: updateParent, + emitEvent: emitEvent, + removeFocus: removeFocus, + disabled: disabled, + ); + + void usernameValueReset( + String value, { + bool updateParent = true, + bool emitEvent = true, + bool removeFocus = false, + bool? disabled, + }) => usernameControl.reset( + value: value, + updateParent: updateParent, + emitEvent: emitEvent, + removeFocus: removeFocus, + disabled: disabled, + ); + + void passwordValueReset( + String value, { + bool updateParent = true, + bool emitEvent = true, + bool removeFocus = false, + bool? disabled, + }) => passwordControl.reset( + value: value, + updateParent: updateParent, + emitEvent: emitEvent, + removeFocus: removeFocus, + disabled: disabled, + ); + + void rememberMeValueReset( + bool value, { + bool updateParent = true, + bool emitEvent = true, + bool removeFocus = false, + bool? disabled, + }) => rememberMeControl.reset( + value: value, + updateParent: updateParent, + emitEvent: emitEvent, + removeFocus: removeFocus, + disabled: disabled, + ); + + FormControl get domainControl => + form.control(domainControlPath()) as FormControl; + + FormControl get usernameControl => + form.control(usernameControlPath()) as FormControl; + + FormControl get passwordControl => + form.control(passwordControlPath()) as FormControl; + + FormControl get rememberMeControl => + form.control(rememberMeControlPath()) as FormControl; + + void domainSetDisabled( + bool disabled, { + bool updateParent = true, + bool emitEvent = true, + }) { + if (disabled) { + domainControl.markAsDisabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } else { + domainControl.markAsEnabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + } + + void usernameSetDisabled( + bool disabled, { + bool updateParent = true, + bool emitEvent = true, + }) { + if (disabled) { + usernameControl.markAsDisabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } else { + usernameControl.markAsEnabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + } + + void passwordSetDisabled( + bool disabled, { + bool updateParent = true, + bool emitEvent = true, + }) { + if (disabled) { + passwordControl.markAsDisabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } else { + passwordControl.markAsEnabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + } + + void rememberMeSetDisabled( + bool disabled, { + bool updateParent = true, + bool emitEvent = true, + }) { + if (disabled) { + rememberMeControl.markAsDisabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } else { + rememberMeControl.markAsEnabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + } + + @override + LoginFormModel get model { + final isValid = !currentForm.hasErrors && currentForm.errors.isEmpty; + + if (!isValid) { + _logLoginFormModelForm.warning( + 'Avoid calling `model` on invalid form.Possible exceptions for non-nullable fields which should be guarded by `required` validator.', + null, + StackTrace.current, + ); + } + return LoginFormModel( + domain: _domainValue, + username: _usernameValue, + password: _passwordValue, + rememberMe: _rememberMeValue, + ); + } + + @override + LoginFormModel get rawModel { + return LoginFormModel( + domain: _domainRawValue, + username: _usernameRawValue, + password: _passwordRawValue, + rememberMe: _rememberMeRawValue, + ); + } + + @override + void toggleDisabled({bool updateParent = true, bool emitEvent = true}) { + if (_disabled.isEmpty) { + currentForm.controls.forEach((key, control) { + _disabled[key] = control.disabled; + }); + + currentForm.markAsDisabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } else { + currentForm.controls.forEach((key, control) { + if (_disabled[key] == false) { + currentForm.controls[key]?.markAsEnabled( + updateParent: updateParent, + emitEvent: emitEvent, + ); + } + + _disabled.remove(key); + }); + } + } + + @override + bool equalsTo(LoginFormModel? other) { + final currentForm = this.currentForm; + + return const DeepCollectionEquality().equals( + currentForm.rawValue, + LoginFormModelForm.formElements(other).rawValue, + ); + } + + @override + void submit({ + required void Function(LoginFormModel model) onValid, + void Function()? onNotValid, + }) { + currentForm.markAllAsTouched(); + if (currentForm.valid) { + onValid(model); + } else { + _logLoginFormModelForm.info('Errors'); + _logLoginFormModelForm.info('┗━━ ${form.errors}'); + onNotValid?.call(); + } + } + + @override + bool get hasChanged { + return !const DeepCollectionEquality().equals( + currentForm.rawValue, + initial, + ); + } + + @override + FormGroup get currentForm { + return path == null ? form : form.control(path!) as FormGroup; + } + + @override + void updateValue( + LoginFormModel? value, { + bool updateParent = true, + bool emitEvent = true, + }) => currentForm.updateValue( + LoginFormModelForm.formElements(value).rawValue, + updateParent: updateParent, + emitEvent: emitEvent, + ); + + @override + void upsertValue( + LoginFormModel? value, { + bool updateParent = true, + bool emitEvent = true, + }) { + final formElements = LoginFormModelForm.formElements(value); + + currentForm.addAll(formElements.controls); + } + + @override + void reset({ + LoginFormModel? value, + bool updateParent = true, + bool emitEvent = true, + }) => currentForm.reset( + value: value != null ? formElements(value).rawValue : null, + updateParent: updateParent, + emitEvent: emitEvent, + ); + + @override + void updateInitial(Map? value, String? path) { + if (_formModel != null) { + _formModel?.updateInitial(currentForm.rawValue, path); + return; + } + + if (value == null) return; + + if (path == null || path.isEmpty) { + initial.addAll(value); + return; + } + + final keys = path.split('.'); + Object? current = initial; + for (var i = 0; i < keys.length - 1; i++) { + final key = keys[i]; + + if (current is List) { + final index = int.tryParse(key); + if (index != null && index >= 0 && index < current.length) { + current = current[index]; + continue; + } + } + + if (current is Map) { + if (!current.containsKey(key)) { + current[key] = {}; + } + current = current[key]; + continue; + } + + return; + } + + final key = keys.last; + if (current is List) { + final index = int.tryParse(key); + if (index != null && index >= 0 && index < current.length) { + current[index] = value; + } + } else if (current is Map) { + current[key] = value; + } + } + + String pathBuilder(String? pathItem) => + [path, pathItem].whereType().join("."); + + static FormGroup formElements(LoginFormModel? loginFormModel) => FormGroup( + { + domainControlName: FormControl( + value: loginFormModel?.domain, + validators: [RequiredValidator()], + asyncValidators: [], + asyncValidatorsDebounceTime: 250, + disabled: false, + touched: false, + ), + usernameControlName: FormControl( + value: loginFormModel?.username, + validators: [RequiredValidator()], + asyncValidators: [], + asyncValidatorsDebounceTime: 250, + disabled: false, + touched: false, + ), + passwordControlName: FormControl( + value: loginFormModel?.password, + validators: [RequiredValidator()], + asyncValidators: [], + asyncValidatorsDebounceTime: 250, + disabled: false, + touched: false, + ), + rememberMeControlName: FormControl( + value: loginFormModel?.rememberMe, + validators: [], + asyncValidators: [], + asyncValidatorsDebounceTime: 250, + disabled: false, + touched: false, + ), + }, + validators: [], + asyncValidators: [], + asyncValidatorsDebounceTime: 250, + disabled: false, + ); +} + +class ReactiveLoginFormModelFormArrayBuilder< + ReactiveLoginFormModelFormArrayBuilderT +> + extends StatelessWidget { + const ReactiveLoginFormModelFormArrayBuilder({ + Key? key, + this.control, + this.formControl, + this.builder, + required this.itemBuilder, + this.emptyBuilder, + this.controlFilter, + }) : assert( + control != null || formControl != null, + "You have to specify `control` or `formControl`!", + ), + super(key: key); + + final FormArray? formControl; + + final FormArray? Function( + LoginFormModelForm formModel, + )? + control; + + final Widget Function( + BuildContext context, + List itemList, + LoginFormModelForm formModel, + )? + builder; + + final Widget Function( + BuildContext context, + int i, + FormControl control, + ReactiveLoginFormModelFormArrayBuilderT? item, + LoginFormModelForm formModel, + ) + itemBuilder; + + final Widget Function(BuildContext context)? emptyBuilder; + + final bool Function( + FormControl control, + )? + controlFilter; + + @override + Widget build(BuildContext context) { + final formModel = ReactiveLoginFormModelForm.of(context); + + if (formModel == null) { + throw FormControlParentNotFoundException(this); + } + + final builder = this.builder; + final itemBuilder = this.itemBuilder; + + return ReactiveFormArrayItemBuilder< + ReactiveLoginFormModelFormArrayBuilderT + >( + formControl: formControl ?? control?.call(formModel), + builder: builder != null + ? (context, itemList) => builder(context, itemList, formModel) + : null, + itemBuilder: (context, i, control, item) => + itemBuilder(context, i, control, item, formModel), + emptyBuilder: emptyBuilder, + controlFilter: controlFilter, + ); + } +} + +class ReactiveLoginFormModelFormArrayBuilder2< + ReactiveLoginFormModelFormArrayBuilderT +> + extends StatelessWidget { + const ReactiveLoginFormModelFormArrayBuilder2({ + Key? key, + this.control, + this.formControl, + this.builder, + required this.itemBuilder, + this.emptyBuilder, + this.controlFilter, + }) : assert( + control != null || formControl != null, + "You have to specify `control` or `formControl`!", + ), + super(key: key); + + final FormArray? formControl; + + final FormArray? Function( + LoginFormModelForm formModel, + )? + control; + + final Widget Function( + ({ + BuildContext context, + List itemList, + LoginFormModelForm formModel, + }) + params, + )? + builder; + + final Widget Function( + ({ + BuildContext context, + int i, + FormControl control, + ReactiveLoginFormModelFormArrayBuilderT? item, + LoginFormModelForm formModel, + }) + params, + ) + itemBuilder; + + final Widget Function(BuildContext context)? emptyBuilder; + + final bool Function( + FormControl control, + )? + controlFilter; + + @override + Widget build(BuildContext context) { + final formModel = ReactiveLoginFormModelForm.of(context); + + if (formModel == null) { + throw FormControlParentNotFoundException(this); + } + + final builder = this.builder; + final itemBuilder = this.itemBuilder; + + return ReactiveFormArrayItemBuilder< + ReactiveLoginFormModelFormArrayBuilderT + >( + formControl: formControl ?? control?.call(formModel), + builder: builder != null + ? (context, itemList) => builder(( + context: context, + itemList: itemList, + formModel: formModel, + )) + : null, + itemBuilder: (context, i, control, item) => itemBuilder(( + context: context, + i: i, + control: control, + item: item, + formModel: formModel, + )), + emptyBuilder: emptyBuilder, + controlFilter: controlFilter, + ); + } +} + +class ReactiveLoginFormModelFormFormGroupArrayBuilder< + ReactiveLoginFormModelFormFormGroupArrayBuilderT +> + extends StatelessWidget { + const ReactiveLoginFormModelFormFormGroupArrayBuilder({ + Key? key, + this.extended, + this.getExtended, + this.builder, + required this.itemBuilder, + }) : assert( + extended != null || getExtended != null, + "You have to specify `control` or `formControl`!", + ), + super(key: key); + + final ExtendedControl< + List?>, + List + >? + extended; + + final ExtendedControl< + List?>, + List + > + Function(LoginFormModelForm formModel)? + getExtended; + + final Widget Function( + BuildContext context, + List itemList, + LoginFormModelForm formModel, + )? + builder; + + final Widget Function( + BuildContext context, + int i, + ReactiveLoginFormModelFormFormGroupArrayBuilderT? item, + LoginFormModelForm formModel, + ) + itemBuilder; + + @override + Widget build(BuildContext context) { + final formModel = ReactiveLoginFormModelForm.of(context); + + if (formModel == null) { + throw FormControlParentNotFoundException(this); + } + + final value = (extended ?? getExtended?.call(formModel))!; + + return StreamBuilder?>?>( + stream: value.control.valueChanges, + builder: (context, snapshot) { + final itemList = + (value.value() ?? + []) + .asMap() + .map( + (i, item) => + MapEntry(i, itemBuilder(context, i, item, formModel)), + ) + .values + .toList(); + + return builder?.call(context, itemList, formModel) ?? + Column(children: itemList); + }, + ); + } +} 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 5a7aa425..3f7666cd 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 @@ -50,7 +50,7 @@ class ReactiveLoginForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -59,7 +59,8 @@ class ReactiveLoginForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -82,7 +83,7 @@ class ReactiveLoginForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -101,7 +102,7 @@ class LoginFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -112,7 +113,8 @@ class LoginFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -199,7 +201,7 @@ class _LoginFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -259,9 +261,9 @@ class LoginForm implements FormModel { } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/login/login_form.dart b/packages/reactive_forms_generator/example/lib/docs/login/login_form.dart index 298cc84b..91ea116e 100644 --- a/packages/reactive_forms_generator/example/lib/docs/login/login_form.dart +++ b/packages/reactive_forms_generator/example/lib/docs/login/login_form.dart @@ -23,7 +23,7 @@ class _LoginFormWidgetState extends State { title: const Text('Login'), body: LoginFormBuilder( canPop: (formGroup) => true, - onPopInvoked: (formGroup, didPop) => {}, + onPopInvokedWithResult: (formGroup, didPop, result) => {}, model: _emptyModel, builder: (context, formModel, child) { return Column( 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 9fde7b4f..e18f5ec5 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 @@ -53,7 +53,7 @@ class ReactiveLoginOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveLoginOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -85,7 +86,7 @@ class ReactiveLoginOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -104,7 +105,7 @@ class LoginOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -115,7 +116,8 @@ class LoginOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -202,7 +204,7 @@ class _LoginOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -263,9 +265,9 @@ class LoginOForm implements FormModel { } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map? get passwordErrors => passwordControl.errors; + Map? get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 8caf2c29..97154175 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 @@ -53,7 +53,7 @@ class ReactiveLoginExtendedForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveLoginExtendedForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginExtendedForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveLoginExtendedForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class LoginExtendedFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class LoginExtendedFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _LoginExtendedFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -396,23 +398,23 @@ class LoginExtendedForm implements FormModel { } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; - Map get rememberMeErrors => rememberMeControl.errors; + Map get rememberMeErrors => rememberMeControl.errors; - Map get themeErrors => themeControl.errors; + Map get themeErrors => themeControl.errors; - Map get modeErrors => modeControl.errors; + Map get modeErrors => modeControl.errors; - Map get timeoutErrors => timeoutControl.errors; + Map get timeoutErrors => timeoutControl.errors; - Map get heightErrors => heightControl.errors; + Map get heightErrors => heightControl.errors; - Map? get unAnnotatedErrors => unAnnotatedControl.errors; + Map? get unAnnotatedErrors => unAnnotatedControl.errors; - Map get someIntListErrors => someIntListControl.errors; + Map get someIntListErrors => someIntListControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 8bbf5502..d9e086e7 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 @@ -53,7 +53,7 @@ class ReactiveLoginExtendedOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveLoginExtendedOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginExtendedOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveLoginExtendedOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class LoginExtendedOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class LoginExtendedOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _LoginExtendedOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -414,25 +416,25 @@ class LoginExtendedOForm } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map get email2Errors => email2Control.errors; + Map get email2Errors => email2Control.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; - Map get rememberMeErrors => rememberMeControl.errors; + Map get rememberMeErrors => rememberMeControl.errors; - Map get themeErrors => themeControl.errors; + Map get themeErrors => themeControl.errors; - Map get modeErrors => modeControl.errors; + Map get modeErrors => modeControl.errors; - Map get timeoutErrors => timeoutControl.errors; + Map get timeoutErrors => timeoutControl.errors; - Map get heightErrors => heightControl.errors; + Map get heightErrors => heightControl.errors; - Map? get unAnnotatedErrors => unAnnotatedControl.errors; + Map? get unAnnotatedErrors => unAnnotatedControl.errors; - Map get someIntListErrors => someIntListControl.errors; + Map get someIntListErrors => someIntListControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 b7609e1a..65bfd3d1 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 @@ -54,7 +54,7 @@ class ReactiveLoginExtendedNullableForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -63,7 +63,8 @@ class ReactiveLoginExtendedNullableForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginExtendedNullableForm? of( BuildContext context, { @@ -93,7 +94,7 @@ class ReactiveLoginExtendedNullableForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -114,7 +115,7 @@ class LoginExtendedNullableFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -125,7 +126,8 @@ class LoginExtendedNullableFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -224,7 +226,7 @@ class _LoginExtendedNullableFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -376,19 +378,19 @@ class LoginExtendedNullableForm } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map? get passwordErrors => passwordControl.errors; + Map? get passwordErrors => passwordControl.errors; - Map? get rememberMeErrors => rememberMeControl.errors; + Map? get rememberMeErrors => rememberMeControl.errors; - Map? get themeErrors => themeControl.errors; + Map? get themeErrors => themeControl.errors; - Map? get modeErrors => modeControl.errors; + Map? get modeErrors => modeControl.errors; - Map? get timeoutErrors => timeoutControl.errors; + Map? get timeoutErrors => timeoutControl.errors; - Map? get heightErrors => heightControl.errors; + Map? get heightErrors => heightControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 f65bedf4..841a1e72 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 @@ -54,7 +54,7 @@ class ReactiveLoginExtendedNullableOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -63,7 +63,8 @@ class ReactiveLoginExtendedNullableOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static LoginExtendedNullableOForm? of( BuildContext context, { @@ -93,7 +94,7 @@ class ReactiveLoginExtendedNullableOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -114,7 +115,7 @@ class LoginExtendedNullableOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -125,7 +126,8 @@ class LoginExtendedNullableOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -224,7 +226,7 @@ class _LoginExtendedNullableOFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -376,19 +378,19 @@ class LoginExtendedNullableOForm } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map? get passwordErrors => passwordControl.errors; + Map? get passwordErrors => passwordControl.errors; - Map? get rememberMeErrors => rememberMeControl.errors; + Map? get rememberMeErrors => rememberMeControl.errors; - Map? get themeErrors => themeControl.errors; + Map? get themeErrors => themeControl.errors; - Map? get modeErrors => modeControl.errors; + Map? get modeErrors => modeControl.errors; - Map? get timeoutErrors => timeoutControl.errors; + Map? get timeoutErrors => timeoutControl.errors; - Map? get heightErrors => heightControl.errors; + Map? get heightErrors => heightControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 ad61f703..dbc01d47 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 @@ -53,7 +53,7 @@ class ReactiveMailingListForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveMailingListForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static MailingListForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveMailingListForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -109,7 +110,7 @@ class MailingListFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -120,7 +121,8 @@ class MailingListFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -212,7 +214,7 @@ class _MailingListFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -258,7 +260,7 @@ class MailingListForm implements FormModel { } } - Map get emailListErrors => emailListControl.errors; + Map get emailListErrors => emailListControl.errors; void get emailListFocus => form.focus(emailListControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list_output.gform.dart index 31ba0b4e..e52daab5 100644 --- a/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/mailing_list/mailing_list_output.gform.dart @@ -53,7 +53,7 @@ class ReactiveMailingListOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveMailingListOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static MailingListOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveMailingListOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class MailingListOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class MailingListOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _MailingListOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -260,7 +262,7 @@ class MailingListOForm implements FormModel { } } - Map get emailListErrors => emailListControl.errors; + Map get emailListErrors => emailListControl.errors; void get emailListFocus => form.focus(emailListControlPath()); 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 31a712f7..bd8bcab6 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 @@ -53,7 +53,7 @@ class ReactiveModelExtendsForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveModelExtendsForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ModelExtendsForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveModelExtendsForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class ModelExtendsFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class ModelExtendsFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _ModelExtendsFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -275,9 +277,9 @@ class ModelExtendsForm implements FormModel { } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 a42d02d0..10c337d4 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 @@ -53,7 +53,7 @@ class ReactiveModelImplementsForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveModelImplementsForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ModelImplementsForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveModelImplementsForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class ModelImplementsFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class ModelImplementsFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -215,7 +217,7 @@ class _ModelImplementsFormBuilderState child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -277,9 +279,9 @@ class ModelImplementsForm } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 cc25cab8..4ab2177c 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 @@ -53,7 +53,7 @@ class ReactiveSubGroupForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveSubGroupForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SubGroupForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -87,7 +88,7 @@ class ReactiveSubGroupForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -107,7 +108,7 @@ class SubGroupFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -118,7 +119,8 @@ class SubGroupFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -209,7 +211,7 @@ class _SubGroupFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -252,7 +254,7 @@ class SubGroupForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; void get idFocus => form.focus(idControlPath()); @@ -759,7 +761,7 @@ class ReactiveGroupForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -768,7 +770,8 @@ class ReactiveGroupForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static GroupForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -791,7 +794,7 @@ class ReactiveGroupForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -810,7 +813,7 @@ class GroupFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -821,7 +824,8 @@ class GroupFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -908,7 +912,7 @@ class _GroupFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -970,9 +974,9 @@ class GroupForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get subGroupListErrors => subGroupListControl.errors; + Map get subGroupListErrors => subGroupListControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1659,7 +1663,7 @@ class ReactiveNestedForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -1668,7 +1672,8 @@ class ReactiveNestedForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static NestedForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -1691,7 +1696,7 @@ class ReactiveNestedForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -1710,7 +1715,7 @@ class NestedFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -1721,7 +1726,8 @@ class NestedFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -1808,7 +1814,7 @@ class _NestedFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -1853,7 +1859,7 @@ class NestedForm implements FormModel { } } - Map get groupListErrors => groupListControl.errors; + Map get groupListErrors => groupListControl.errors; void get groupListFocus => form.focus(groupListControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/nested/nested_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/nested/nested_output.gform.dart index fa6215bc..7f8d8a71 100644 --- a/packages/reactive_forms_generator/example/lib/docs/nested/nested_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/nested/nested_output.gform.dart @@ -53,7 +53,7 @@ class ReactiveSubGroupOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveSubGroupOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SubGroupOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -87,7 +88,7 @@ class ReactiveSubGroupOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -107,7 +108,7 @@ class SubGroupOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -118,7 +119,8 @@ class SubGroupOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -209,7 +211,7 @@ class _SubGroupOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -253,7 +255,7 @@ class SubGroupOForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; void get idFocus => form.focus(idControlPath()); @@ -797,7 +799,7 @@ class ReactiveGroupOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -806,7 +808,8 @@ class ReactiveGroupOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static GroupOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -829,7 +832,7 @@ class ReactiveGroupOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -848,7 +851,7 @@ class GroupOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -859,7 +862,8 @@ class GroupOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -946,7 +950,7 @@ class _GroupOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -1008,9 +1012,9 @@ class GroupOForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get subGroupListErrors => subGroupListControl.errors; + Map get subGroupListErrors => subGroupListControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1702,7 +1706,7 @@ class ReactiveNestedOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -1711,7 +1715,8 @@ class ReactiveNestedOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static NestedOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -1736,7 +1741,7 @@ class ReactiveNestedOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -1755,7 +1760,7 @@ class NestedOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -1766,7 +1771,8 @@ class NestedOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -1857,7 +1863,7 @@ class _NestedOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -1902,7 +1908,7 @@ class NestedOForm implements FormModel { } } - Map get groupListErrors => groupListControl.errors; + Map get groupListErrors => groupListControl.errors; void get groupListFocus => form.focus(groupListControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/nested_generics/nested_generics.gform.dart b/packages/reactive_forms_generator/example/lib/docs/nested_generics/nested_generics.gform.dart index d027d22d..725801fe 100644 --- a/packages/reactive_forms_generator/example/lib/docs/nested_generics/nested_generics.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/nested_generics/nested_generics.gform.dart @@ -56,7 +56,7 @@ class ReactiveProductDetailsForm

required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -65,7 +65,8 @@ class ReactiveProductDetailsForm

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ProductDetailsForm? of

( BuildContext context, { @@ -95,7 +96,7 @@ class ReactiveProductDetailsForm

stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -119,7 +120,7 @@ class ProductDetailsFormBuilder

this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -130,7 +131,8 @@ class ProductDetailsFormBuilder

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -224,7 +226,7 @@ class _ProductDetailsFormBuilderState

child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -288,9 +290,9 @@ class ProductDetailsForm

} } - Map? get descriptionErrors => descriptionControl.errors; + Map? get descriptionErrors => descriptionControl.errors; - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; void get descriptionFocus => form.focus(descriptionControlPath()); @@ -704,9 +706,9 @@ class IdForm

} } - Map? get companyNameErrors => companyNameControl.errors; + Map? get companyNameErrors => companyNameControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; void get companyNameFocus => form.focus(companyNameControlPath()); @@ -1359,7 +1361,7 @@ class ReactiveIdForm

required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -1368,7 +1370,8 @@ class ReactiveIdForm

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static IdForm? of

( BuildContext context, { @@ -1396,7 +1399,7 @@ class ReactiveIdForm

stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -1417,7 +1420,7 @@ class IdFormBuilder

extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -1428,7 +1431,8 @@ class IdFormBuilder

extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -1520,7 +1524,7 @@ class _IdFormBuilderState

child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, diff --git a/packages/reactive_forms_generator/example/lib/docs/nested_generics/nested_generics_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/nested_generics/nested_generics_output.gform.dart index 0fef5d7f..baccc8ca 100644 --- a/packages/reactive_forms_generator/example/lib/docs/nested_generics/nested_generics_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/nested_generics/nested_generics_output.gform.dart @@ -56,7 +56,7 @@ class ReactiveProductDetailsOForm

required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -65,7 +65,8 @@ class ReactiveProductDetailsOForm

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ProductDetailsOForm? of

( BuildContext context, { @@ -95,7 +96,7 @@ class ReactiveProductDetailsOForm

stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -119,7 +120,7 @@ class ProductDetailsOFormBuilder

this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -130,7 +131,8 @@ class ProductDetailsOFormBuilder

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -227,7 +229,7 @@ class _ProductDetailsOFormBuilderState

child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -291,9 +293,9 @@ class ProductDetailsOForm

} } - Map? get descriptionErrors => descriptionControl.errors; + Map? get descriptionErrors => descriptionControl.errors; - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; void get descriptionFocus => form.focus(descriptionControlPath()); @@ -711,9 +713,9 @@ class IdOForm

} } - Map? get companyNameErrors => companyNameControl.errors; + Map? get companyNameErrors => companyNameControl.errors; - Map? get nameErrors => nameControl.errors; + Map? get nameErrors => nameControl.errors; void get companyNameFocus => form.focus(companyNameControlPath()); @@ -1390,7 +1392,7 @@ class ReactiveIdOForm

required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -1399,7 +1401,8 @@ class ReactiveIdOForm

final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static IdOForm? of

( BuildContext context, { @@ -1427,7 +1430,7 @@ class ReactiveIdOForm

stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -1448,7 +1451,7 @@ class IdOFormBuilder

extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -1459,7 +1462,8 @@ class IdOFormBuilder

extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -1551,7 +1555,7 @@ class _IdOFormBuilderState

child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, 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 d281b721..54332a33 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 @@ -53,7 +53,7 @@ class ReactiveProfileForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveProfileForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ProfileForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -87,7 +88,7 @@ class ReactiveProfileForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -106,7 +107,7 @@ class ProfileFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -117,7 +118,8 @@ class ProfileFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -208,7 +210,7 @@ class _ProfileFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -413,28 +415,28 @@ class ProfileForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get anotherIdErrors => anotherIdControl.errors; + Map get anotherIdErrors => anotherIdControl.errors; - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map get chartingOrderErrors => chartingOrderControl.errors; + Map get chartingOrderErrors => chartingOrderControl.errors; - Map get numberingStandardErrors => + Map get numberingStandardErrors => numberingStandardControl.errors; - Map get measurementTypeErrors => + Map get measurementTypeErrors => measurementTypeControl.errors; - Map get audioGuidanceErrors => audioGuidanceControl.errors; + Map get audioGuidanceErrors => audioGuidanceControl.errors; - Map get incidenceFilterErrors => + Map get incidenceFilterErrors => incidenceFilterControl.errors; - Map get thresholdErrors => thresholdControl.errors; + Map get thresholdErrors => thresholdControl.errors; - Map get timerErrors => timerControl.errors; + Map get timerErrors => timerControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1449,22 +1451,22 @@ class IncidenceFilterForm } } - Map get isMobilityEnabledErrors => + Map get isMobilityEnabledErrors => isMobilityEnabledControl.errors; - Map get isFurcationEnabledErrors => + Map get isFurcationEnabledErrors => isFurcationEnabledControl.errors; - Map get isBleedingEnabledErrors => + Map get isBleedingEnabledErrors => isBleedingEnabledControl.errors; - Map get isSuppurationEnabledErrors => + Map get isSuppurationEnabledErrors => isSuppurationEnabledControl.errors; - Map get isCalculusEnabledErrors => + Map get isCalculusEnabledErrors => isCalculusEnabledControl.errors; - Map get isPlaqueEnabledErrors => + Map get isPlaqueEnabledErrors => isPlaqueEnabledControl.errors; void get isMobilityEnabledFocus => form.focus(isMobilityEnabledControlPath()); @@ -2127,9 +2129,9 @@ class ThresholdSettingForm } } - Map get isEnabledErrors => isEnabledControl.errors; + Map get isEnabledErrors => isEnabledControl.errors; - Map get valueErrors => valueControl.errors; + Map get valueErrors => valueControl.errors; void get isEnabledFocus => form.focus(isEnabledControlPath()); @@ -2502,9 +2504,9 @@ class TimerSettingForm implements FormModel { } } - Map get isEnabledErrors => isEnabledControl.errors; + Map get isEnabledErrors => isEnabledControl.errors; - Map get valueErrors => valueControl.errors; + Map get valueErrors => valueControl.errors; void get isEnabledFocus => form.focus(isEnabledControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/profile/profile_output.gform.dart b/packages/reactive_forms_generator/example/lib/docs/profile/profile_output.gform.dart index 00d4c835..f4f902e5 100644 --- a/packages/reactive_forms_generator/example/lib/docs/profile/profile_output.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/profile/profile_output.gform.dart @@ -53,7 +53,7 @@ class ReactiveProfileOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveProfileOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static ProfileOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -87,7 +88,7 @@ class ReactiveProfileOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -107,7 +108,7 @@ class ProfileOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -118,7 +119,8 @@ class ProfileOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -209,7 +211,7 @@ class _ProfileOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -414,28 +416,28 @@ class ProfileOForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get anotherIdErrors => anotherIdControl.errors; + Map get anotherIdErrors => anotherIdControl.errors; - Map get nameErrors => nameControl.errors; + Map get nameErrors => nameControl.errors; - Map get chartingOrderErrors => chartingOrderControl.errors; + Map get chartingOrderErrors => chartingOrderControl.errors; - Map get numberingStandardErrors => + Map get numberingStandardErrors => numberingStandardControl.errors; - Map get measurementTypeErrors => + Map get measurementTypeErrors => measurementTypeControl.errors; - Map get audioGuidanceErrors => audioGuidanceControl.errors; + Map get audioGuidanceErrors => audioGuidanceControl.errors; - Map get incidenceFilterErrors => + Map get incidenceFilterErrors => incidenceFilterControl.errors; - Map get thresholdErrors => thresholdControl.errors; + Map get thresholdErrors => thresholdControl.errors; - Map get timerErrors => timerControl.errors; + Map get timerErrors => timerControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1451,22 +1453,22 @@ class IncidenceFilterOForm } } - Map get isMobilityEnabledErrors => + Map get isMobilityEnabledErrors => isMobilityEnabledControl.errors; - Map get isFurcationEnabledErrors => + Map get isFurcationEnabledErrors => isFurcationEnabledControl.errors; - Map get isBleedingEnabledErrors => + Map get isBleedingEnabledErrors => isBleedingEnabledControl.errors; - Map get isSuppurationEnabledErrors => + Map get isSuppurationEnabledErrors => isSuppurationEnabledControl.errors; - Map get isCalculusEnabledErrors => + Map get isCalculusEnabledErrors => isCalculusEnabledControl.errors; - Map get isPlaqueEnabledErrors => + Map get isPlaqueEnabledErrors => isPlaqueEnabledControl.errors; void get isMobilityEnabledFocus => form.focus(isMobilityEnabledControlPath()); @@ -2131,9 +2133,9 @@ class ThresholdSettingOForm } } - Map get isEnabledErrors => isEnabledControl.errors; + Map get isEnabledErrors => isEnabledControl.errors; - Map get valueErrors => valueControl.errors; + Map get valueErrors => valueControl.errors; void get isEnabledFocus => form.focus(isEnabledControlPath()); @@ -2511,9 +2513,9 @@ class TimerSettingOForm } } - Map get isEnabledErrors => isEnabledControl.errors; + Map get isEnabledErrors => isEnabledControl.errors; - Map get valueErrors => valueControl.errors; + Map get valueErrors => valueControl.errors; void get isEnabledFocus => form.focus(isEnabledControlPath()); diff --git a/packages/reactive_forms_generator/example/lib/docs/recursive/recursive.gform.dart b/packages/reactive_forms_generator/example/lib/docs/recursive/recursive.gform.dart index ae9d87e2..13d0172d 100644 --- a/packages/reactive_forms_generator/example/lib/docs/recursive/recursive.gform.dart +++ b/packages/reactive_forms_generator/example/lib/docs/recursive/recursive.gform.dart @@ -53,7 +53,7 @@ class ReactiveSecuredAreaForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveSecuredAreaForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SecuredAreaForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveSecuredAreaForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -109,7 +110,7 @@ class SecuredAreaFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -120,7 +121,8 @@ class SecuredAreaFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -212,7 +214,7 @@ class _SecuredAreaFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -314,13 +316,13 @@ class SecuredAreaForm implements FormModel { } } - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; - Map? get securedAreaErrors => securedAreaControl.errors; + Map? get securedAreaErrors => securedAreaControl.errors; - Map? get parcelSystemErrors => parcelSystemControl.errors; + Map? get parcelSystemErrors => parcelSystemControl.errors; - Map get subSecuredAreasErrors => + Map get subSecuredAreasErrors => subSecuredAreasControl.errors; void get idFocus => form.focus(idControlPath()); @@ -1016,10 +1018,10 @@ class ParcelSystemForm implements FormModel { } } - Map get hasParcelSystemErrors => + Map get hasParcelSystemErrors => hasParcelSystemControl.errors; - Map get dataErrors => dataControl.errors; + Map get dataErrors => dataControl.errors; void get hasParcelSystemFocus => form.focus(hasParcelSystemControlPath()); @@ -1373,7 +1375,7 @@ class ParcelSystemDataForm } } - Map? get idErrors => idControl.errors; + Map? get idErrors => idControl.errors; void get idFocus => form.focus(idControlPath()); 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 b4496240..92bcdc84 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 @@ -53,7 +53,7 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SomeWiredNameForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class SomeWiredNameFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class SomeWiredNameFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _SomeWiredNameFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -275,9 +277,9 @@ class SomeWiredNameForm implements FormModel { } } - Map get emailErrors => emailControl.errors; + Map get emailErrors => emailControl.errors; - Map get passwordErrors => passwordControl.errors; + Map get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 f06e64ca..2d13e474 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 @@ -53,7 +53,7 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static SomeWiredNameForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveSomeWiredNameForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class SomeWiredNameFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class SomeWiredNameFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _SomeWiredNameFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -277,9 +279,9 @@ class SomeWiredNameForm } } - Map? get emailErrors => emailControl.errors; + Map? get emailErrors => emailControl.errors; - Map? get passwordErrors => passwordControl.errors; + Map? get passwordErrors => passwordControl.errors; void get emailFocus => form.focus(emailControlPath()); 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 e6fc5097..37c60ae2 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 @@ -53,7 +53,7 @@ class ReactiveUserProfileForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveUserProfileForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static UserProfileForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveUserProfileForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -109,7 +110,7 @@ class UserProfileFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -120,7 +121,8 @@ class UserProfileFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -212,7 +214,7 @@ class _UserProfileFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -324,15 +326,15 @@ class UserProfileForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map get firstNameErrors => firstNameControl.errors; + Map get firstNameErrors => firstNameControl.errors; - Map get lastNameErrors => lastNameControl.errors; + Map get lastNameErrors => lastNameControl.errors; - Map get homeErrors => homeControl.errors; + Map get homeErrors => homeControl.errors; - Map? get officeErrors => officeControl.errors; + Map? get officeErrors => officeControl.errors; void get idFocus => form.focus(idControlPath()); @@ -946,11 +948,11 @@ class AddressForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get zipErrors => zipControl.errors; + Map? get zipErrors => zipControl.errors; void get streetFocus => form.focus(streetControlPath()); 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 0820b57e..e3629246 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 @@ -53,7 +53,7 @@ class ReactiveUserProfileOForm extends StatelessWidget { required this.form, required this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, }) : super(key: key); final Widget child; @@ -62,7 +62,8 @@ class ReactiveUserProfileOForm extends StatelessWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; static UserProfileOForm? of(BuildContext context, {bool listen = true}) { if (listen) { @@ -89,7 +90,7 @@ class ReactiveUserProfileOForm extends StatelessWidget { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); @@ -110,7 +111,7 @@ class UserProfileOFormBuilder extends StatefulWidget { this.model, this.child, this.canPop, - this.onPopInvoked, + this.onPopInvokedWithResult, required this.builder, this.initState, }) : super(key: key); @@ -121,7 +122,8 @@ class UserProfileOFormBuilder extends StatefulWidget { final bool Function(FormGroup formGroup)? canPop; - final void Function(FormGroup formGroup, bool didPop)? onPopInvoked; + final ReactiveFormPopInvokedWithResultCallback? + onPopInvokedWithResult; final Widget Function( BuildContext context, @@ -214,7 +216,7 @@ class _UserProfileOFormBuilderState extends State { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, @@ -328,15 +330,15 @@ class UserProfileOForm implements FormModel { } } - Map get idErrors => idControl.errors; + Map get idErrors => idControl.errors; - Map? get firstNameErrors => firstNameControl.errors; + Map? get firstNameErrors => firstNameControl.errors; - Map? get lastNameErrors => lastNameControl.errors; + Map? get lastNameErrors => lastNameControl.errors; - Map get homeErrors => homeControl.errors; + Map get homeErrors => homeControl.errors; - Map? get officeErrors => officeControl.errors; + Map? get officeErrors => officeControl.errors; void get idFocus => form.focus(idControlPath()); @@ -997,11 +999,11 @@ class AddressOForm implements FormModel { } } - Map? get streetErrors => streetControl.errors; + Map? get streetErrors => streetControl.errors; - Map? get cityErrors => cityControl.errors; + Map? get cityErrors => cityControl.errors; - Map? get zipErrors => zipControl.errors; + Map? get zipErrors => zipControl.errors; void get streetFocus => form.focus(streetControlPath()); diff --git a/packages/reactive_forms_generator/example/pubspec.yaml b/packages/reactive_forms_generator/example/pubspec.yaml index f439a447..b4d2ebf1 100644 --- a/packages/reactive_forms_generator/example/pubspec.yaml +++ b/packages/reactive_forms_generator/example/pubspec.yaml @@ -13,14 +13,17 @@ dependencies: sdk: flutter reactive_forms_annotations: path: ../../reactive_forms_annotations - reactive_forms: ^17.0.1 + reactive_forms: ^18.2.2 intl: ">=0.19.0 <1.0.0" freezed_annotation: ^3.1.0 dartz: ^0.10.1 json_annotation: ^4.9.0 # reactive_text_field: ^1.0.0 equatable: ^2.0.7 - reactive_forms_lbc: ^4.0.5 + reactive_forms_lbc: ^4.0.4 + +dependency_overrides: + reactive_forms: ^18.2.2 dev_dependencies: reactive_forms_generator: diff --git a/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form.dart b/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form.dart index b2c62682..8d0036e2 100644 --- a/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form.dart +++ b/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form.dart @@ -44,7 +44,7 @@ class ReactiveForm { ), Parameter( (b) => b - ..name = 'onPopInvoked' + ..name = 'onPopInvokedWithResult' ..toThis = true ..named = true, ), @@ -83,10 +83,10 @@ class ReactiveForm { ), Field( (b) => b - ..name = 'onPopInvoked' + ..name = 'onPopInvokedWithResult' ..modifier = FieldModifier.final$ ..type = const Reference( - 'void Function(FormGroup formGroup, bool didPop)?', + 'ReactiveFormPopInvokedWithResultCallback?', ), ), ]) @@ -145,7 +145,7 @@ class ReactiveForm { stream: form.form.statusChanged, child: ReactiveFormPopScope( canPop: canPop, - onPopInvoked: onPopInvoked, + onPopInvokedWithResult: onPopInvokedWithResult, child: child, ), ); diff --git a/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form_builder.dart b/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form_builder.dart index a4b05eb2..9e34a422 100644 --- a/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form_builder.dart +++ b/packages/reactive_forms_generator/lib/src/reactive_forms/reactive_form_builder.dart @@ -70,7 +70,7 @@ class ReactiveFormBuilder { ), Parameter( (b) => b - ..name = 'onPopInvoked' + ..name = 'onPopInvokedWithResult' ..named = true ..toThis = true, ), @@ -117,11 +117,11 @@ class ReactiveFormBuilder { ), Field( (b) => b - ..name = 'onPopInvoked' + ..name = 'onPopInvokedWithResult' + ..modifier = FieldModifier.final$ ..type = const Reference( - 'void Function(FormGroup formGroup, bool didPop)?', - ) - ..modifier = FieldModifier.final$, + 'ReactiveFormPopInvokedWithResultCallback?', + ), ), Field( (b) => b @@ -250,7 +250,7 @@ class ReactiveFormBuilder { child: ReactiveFormBuilder( form: () => _formModel.form, canPop: widget.canPop, - onPopInvoked: widget.onPopInvoked, + onPopInvokedWithResult: widget.onPopInvokedWithResult, builder: (context, formGroup, child) => widget.builder(context, _formModel, widget.child), child: widget.child, ), diff --git a/packages/reactive_forms_generator/lib/src/reactive_forms_generator/errors_method.dart b/packages/reactive_forms_generator/lib/src/reactive_forms_generator/errors_method.dart index 2cc3dd65..0affa9d9 100644 --- a/packages/reactive_forms_generator/lib/src/reactive_forms_generator/errors_method.dart +++ b/packages/reactive_forms_generator/lib/src/reactive_forms_generator/errors_method.dart @@ -11,7 +11,7 @@ class ErrorsMethod extends ReactiveFormGeneratorMethod { ..name = field.errorsMethodName ..lambda = true ..type = MethodType.getter - ..returns = Reference('Map${field.nullabilitySuffix}') + ..returns = Reference('Map${field.nullabilitySuffix}') ..body = Code('${field.fieldControlName}.errors'), ); } diff --git a/packages/reactive_forms_generator/pubspec.yaml b/packages/reactive_forms_generator/pubspec.yaml index a17ddf77..33e7e405 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: 7.5.0-beta1 +version: 8.2.0 environment: sdk: ">=3.8.0 <4.0.0" diff --git a/pubspec.lock b/pubspec.lock index ded7be08..a7833fdb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -109,10 +109,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" charcode: dependency: transitive description: @@ -376,14 +376,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" - js: - dependency: transitive - description: - name: js - sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" - url: "https://pub.dev" - source: hosted - version: "0.7.2" json_annotation: dependency: transitive description: @@ -444,18 +436,18 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" melos: dependency: "direct dev" description: @@ -585,13 +577,13 @@ packages: source: hosted version: "1.5.0" reactive_forms: - dependency: transitive + dependency: "direct overridden" description: name: reactive_forms - sha256: "9b1fb18e0aae9c50cfa0aaabaaa38bc4d78eefc9b7b95fa9c947b051f6524b8e" + sha256: b8dcd47f933927a0da76ec366f24377710595596a3253283927c18560a01e902 url: "https://pub.dev" source: hosted - version: "17.0.1" + version: "18.2.2" reactive_forms_lbc: dependency: transitive description: @@ -729,10 +721,10 @@ packages: dependency: transitive description: name: test - sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7" + sha256: "8d9ceddbab833f180fbefed08afa76d7c03513dfdba87ffcec2718b02bbcbf20" url: "https://pub.dev" source: hosted - version: "1.26.3" + version: "1.31.0" test_api: dependency: "direct overridden" description: