mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-03-31 18:56:21 +00:00
fix: reset password link dialog UI fix
This commit is contained in:
parent
676415cf1c
commit
65f8d33634
1 changed files with 21 additions and 19 deletions
|
@ -22,22 +22,7 @@ class ResetPasswordLinkDialog extends StatelessWidget {
|
|||
child: BlocBuilder<ResetPasswordBloc, ResetPasswordState>(builder:
|
||||
(final BuildContext context, final ResetPasswordState state) {
|
||||
late final Widget content;
|
||||
|
||||
if (state.errorMessage.isNotEmpty) {
|
||||
content = Text(
|
||||
state.errorMessage,
|
||||
style: TextStyle(
|
||||
fontSize: 21,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
);
|
||||
} else if (state.isLoading) {
|
||||
content = const SizedBox(
|
||||
height: 52,
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
} else {
|
||||
if (state.passwordResetMessage.isNotEmpty) {
|
||||
content = ListTile(
|
||||
onTap: () {
|
||||
launchUrl(
|
||||
|
@ -57,6 +42,21 @@ class ResetPasswordLinkDialog extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
);
|
||||
} else if (state.errorMessage.isNotEmpty) {
|
||||
content = Text(
|
||||
state.errorMessage,
|
||||
style: TextStyle(
|
||||
fontSize: 21,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// loading state
|
||||
content = const SizedBox(
|
||||
height: 52,
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
|
||||
return PopScope(
|
||||
|
@ -64,9 +64,11 @@ class ResetPasswordLinkDialog extends StatelessWidget {
|
|||
_log('Pop scope: isPopped: $isPopped');
|
||||
|
||||
_log('Pop scope: cancel reset password ');
|
||||
context.read<ResetPasswordBloc>().add(
|
||||
const CancelNewPasswordRequest(),
|
||||
);
|
||||
if (state.isLoading) {
|
||||
context.read<ResetPasswordBloc>().add(
|
||||
const CancelNewPasswordRequest(),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: AlertDialog(
|
||||
key: _key,
|
||||
|
|
Loading…
Add table
Reference in a new issue