flutter_form_builder icon indicating copy to clipboard operation
flutter_form_builder copied to clipboard

Type safe forms values

Open sultanmyrza opened this issue 4 years ago • 4 comments
trafficstars

currently FormBuilder.initialValue(formSchema) formSchema is Map<String, dynamic> any plans for making "form schema" type safe?

  /// An optional Map of field initialValues. Keys correspond to the field's
  /// name and value to the initialValue of the field.
  ///
  /// The initialValues set here will be ignored if the field has a local
  /// initialValue set.
  final Map<String, dynamic> initialValue; // current solution

  final T initialValue; // Maybe someday in the future?

sultanmyrza avatar Jun 09 '21 06:06 sultanmyrza

I don't sure if this is possible, because form use a map to fieldNames (String key) and your values (dynamic value). If do you have a solution, please feel free to make comments or a pull request

deandreamatias avatar Jun 10 '22 13:06 deandreamatias