realWithField<TField extends FormField<double>> method

void realWithField<TField extends FormField<double>>({
  1. required String name,
  2. List<FormFieldValidatorFactory<double>>? validatorFactories,
  3. List<AsyncValidatorFactory<double>>? asyncValidatorFactories,
  4. double? initialValue,
  5. PropertyValueTraits? valueTraits,
})

Defines a new property with property value type double and preferred form field type TField for form field value type String.

Note that name must be unique, and validators are registered as factories instead of normal closures (function objects) because some validation framework requires live BuildContext to initialize validator, and current Locale of the application should be stored to BuildContext.

TField affects FormFieldFactory generation by form_companion_generator.

Implementation

void realWithField<TField extends FormField<double>>({
  required String name,
  List<FormFieldValidatorFactory<double>>? validatorFactories,
  List<AsyncValidatorFactory<double>>? asyncValidatorFactories,
  double? initialValue,
  PropertyValueTraits? valueTraits,
}) =>
    addWithField<double, double, TField>(
      name: name,
      validatorFactories: validatorFactories,
      asyncValidatorFactories: asyncValidatorFactories,
      initialValue: initialValue,
      valueTraits: valueTraits,
      restorableValueFactory: doubleRestorableValueFactory,
    );