Delete user account
Invoke the deleteUser
API to delete a user from the Auth category. This action will also sign your user out.
If your application uses a Cognito User Pool, which is the default configuration for the Amazon Cognito plugin, this action will delete the user from the Cognito User Pool. It will have no effect if you are federating with a Cognito Identity Pool alone.
Future<void> deleteUser() async { try { await Amplify.Auth.deleteUser(); safePrint('Delete user succeeded'); } on AuthException catch (e) { safePrint('Delete user failed with error: $e'); }}