


# submit method




    *[<Null safety>](https://dart.dev/null-safety)*



- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)

[FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void> submit
()





<p>Sends a password reset email to the user</p>



## Implementation

```dart
@override
FutureOr<void> submit() async {
  if (!state.status.isValidated) {
    return;
  }

  emit(state.copyWith(status: FormStatus.submissionInProgress));

  final form = formRepository.accessForm(formName);
  final email = form.valueOf<String?>(AuthFormField.email);

  if (email.isNullOrEmpty) {
    emit(
      state.copyWith(
        errorMessage: 'An error occured while retrieving data from the form.',
        status: FormStatus.submissionFailure,
      ),
    );
  }

  final response = await authenticationRepository.sendPasswordResetEmail(
    email: email!,
  );

  emit(
    response.fold(
      (value) => state.copyWith(status: FormStatus.submissionSuccess),
      (error) => state.copyWith(
        errorMessage: error.message,
        status: FormStatus.submissionFailure,
      ),
    ),
  );
}
```







