save method

Future<bool> save()

Validate & saves every EasyFormField that is a descendant of this EasyForm.

Implementation

Future<bool> save() async {
  if (!validate()) return false;

  final Map<String, dynamic> values = {};

  for (final EasyFormFieldState<dynamic> field in _fields) {
    field.save();
    values[field.name] = field.value;
  }

  _isSaving.value = true;
  try {
    await doSave(values);
  } finally {
    _isSaving.value = false;
  }

  return true;
}