@@ -85,10 +85,10 @@ class _DeleteAccountButtonState extends State<DeleteAccountButton> {
85
85
void Function () pop <T >(BuildContext context, T result) =>
86
86
() => Navigator .of (context).pop (result);
87
87
88
- Future <void > _deleteAccount () async {
88
+ Future <void > _deleteAccount ({ bool skipConfirmation = false } ) async {
89
89
bool ? confirmed = ! widget.showDeleteConfirmationDialog;
90
90
91
- if (! confirmed) {
91
+ if (! confirmed && ! skipConfirmation ) {
92
92
final l = FirebaseUILocalizations .labelsOf (context);
93
93
94
94
confirmed = await showCupertinoDialog <bool ?>(
@@ -116,17 +116,16 @@ class _DeleteAccountButtonState extends State<DeleteAccountButton> {
116
116
final user = auth.currentUser! ;
117
117
await auth.currentUser? .delete ();
118
118
119
- FirebaseUIAction .ofType <AccountDeletedAction >(context) ? . callback (
119
+ FirebaseUIAction .ofType <AccountDeletedAction >(
120
120
context,
121
- user,
122
- );
121
+ )? .callback (context, user);
123
122
await FirebaseUIAuth .signOut (context: context, auth: auth);
124
123
} on fba.FirebaseAuthException catch (err) {
125
124
if (err.code == 'requires-recent-login' ) {
126
125
if (widget.onSignInRequired != null ) {
127
126
final signedIn = await widget.onSignInRequired !();
128
127
if (signedIn) {
129
- await _deleteAccount ();
128
+ await _deleteAccount (skipConfirmation : true );
130
129
}
131
130
}
132
131
}
0 commit comments