login method
[Future<[void>]]
Performs the login operation.
Handles the login process by performing the following steps:
- Unfocusing the email and password text fields.
- Setting validation mode to
AutovalidateMode.always. - Validating the email and password fields using the form key.
- If validation is successful, disabling auto-validation mode and initiating the login process.
- Displaying a custom progress dialog during login.
- Initializing database functions.
- Performing a GraphQL mutation to login the user by providing the email and encrypted password.
- Handling the result of the login operation:
- Updating the current user with the received data.
- Redirecting the user based on their status in the application.
- Handling Firebase options for Android and iOS if available.
- Configuring Firebase and saving FCM token to the database.
In case of any exceptions during the login process, this function catches and prints the error.
params: None
returns: None
Implementation
Future<void> async
- talawa
- login_view_model
- LoginViewModel
- login method