You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually some if not allreactive_forms methods don't support generics meaning we have to manually cast to the right type each time. A normal way to avoid lots of as casts is using generics.
What you'd like to happen:
final form =ReactiveForm.of<FormGroup>(context); // returns a FormGroupfinal c = form.control<String>('control-name'); // returns a FormControl<String>final formArray = form.control<FormArray>('array-name'); // returns a FormArray// and so on
Alternatives you've considered:
There's actually no alternative to "manual" casting.
final form =ReactiveForm.of(context) asFormGroup;
final c = form.control('control-name') asFormControl<String>
final formArray = form.control('array-name') asFormArray<dynamic>; // returns a FormArray
I can start working on this if makes sense to you.
The text was updated successfully, but these errors were encountered:
Environment
Package version: ^17.0.1
Description
Actually some if not all
reactive_forms
methods don't support generics meaning we have to manually cast to the right type each time. A normal way to avoid lots ofas
casts is using generics.What you'd like to happen:
Alternatives you've considered:
There's actually no alternative to "manual" casting.
I can start working on this if makes sense to you.
The text was updated successfully, but these errors were encountered: