fix: request focus after authentication success

This commit is contained in:
Prateek Sunal
2024-02-18 22:31:52 +05:30
parent 545bdc537e
commit 110ddac0c5
7 changed files with 12 additions and 0 deletions

View File

@@ -150,6 +150,7 @@ class DeleteAccountPage extends StatelessWidget {
);
if (hasAuthenticated) {
FocusScope.of(context).requestFocus();
final choice = await showChoiceDialogOld(
context,
l10n.confirmAccountDeleteTitle,

View File

@@ -89,6 +89,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
"Please authenticate to view your recovery key",
);
if (hasAuthenticated) {
FocusScope.of(context).requestFocus();
String recoveryKey;
try {
recoveryKey =

View File

@@ -377,6 +377,7 @@ class _CodeWidgetState extends State<CodeWidget> {
if (!isAuthSuccessful) {
return;
}
FocusScope.of(context).requestFocus();
final Code? code = await Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
@@ -395,6 +396,7 @@ class _CodeWidgetState extends State<CodeWidget> {
if (!isAuthSuccessful) {
return;
}
FocusScope.of(context).requestFocus();
// ignore: unused_local_variable
final Code? code = await Navigator.of(context).push(
MaterialPageRoute(
@@ -414,6 +416,7 @@ class _CodeWidgetState extends State<CodeWidget> {
if (!isAuthSuccessful) {
return;
}
FocusScope.of(context).requestFocus();
final l10n = context.l10n;
await showChoiceActionSheet(
context,

View File

@@ -44,6 +44,7 @@ class AccountSectionWidget extends StatelessWidget {
l10n.authToChangeYourEmail,
);
if (hasAuthenticated) {
FocusScope.of(context).requestFocus();
showDialog(
context: context,
builder: (BuildContext context) {

View File

@@ -133,6 +133,7 @@ Future<void> _exportCodes(BuildContext context, String fileContent) async {
if (!hasAuthenticated) {
return;
}
FocusScope.of(context).requestFocus();
Future.delayed(
const Duration(milliseconds: 1200),
() async => await shareDialog(

View File

@@ -78,6 +78,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
l10n.authToViewYourRecoveryKey,
);
if (hasAuthenticated) {
FocusScope.of(context).requestFocus();
String recoveryKey;
try {
recoveryKey =
@@ -113,6 +114,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
final isEmailMFAEnabled =
UserService.instance.hasEmailMFAEnabled();
if (hasAuthenticated) {
FocusScope.of(context).requestFocus();
await updateEmailMFA(!isEmailMFAEnabled);
if (mounted) {
setState(() {});
@@ -136,6 +138,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
context.l10n.authToViewYourActiveSessions,
);
if (hasAuthenticated) {
FocusScope.of(context).requestFocus();
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
@@ -166,6 +169,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
context.l10n.lockScreenEnablePreSteps,
);
if (hasAuthenticated) {
FocusScope.of(context).requestFocus();
setState(() {});
}
},

View File

@@ -119,6 +119,7 @@ class SettingsPage extends StatelessWidget {
return;
}
}
FocusScope.of(context).requestFocus();
await routeToPage(
context,
const OnboardingPage(),