From a22312f2430a0c674cf7f64c5c58850f3e0c5afc Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sat, 31 Dec 2022 10:46:58 +0530 Subject: [PATCH] Switch to new dialogBox + copy change --- lib/ui/home/landing_page_widget.dart | 32 +++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/lib/ui/home/landing_page_widget.dart b/lib/ui/home/landing_page_widget.dart index e74b098a4..3ae962d5b 100644 --- a/lib/ui/home/landing_page_widget.dart +++ b/lib/ui/home/landing_page_widget.dart @@ -10,8 +10,10 @@ import 'package:photos/ui/account/email_entry_page.dart'; import 'package:photos/ui/account/login_page.dart'; import 'package:photos/ui/account/password_entry_page.dart'; import 'package:photos/ui/account/password_reentry_page.dart'; -import 'package:photos/ui/common/dialogs.dart'; import 'package:photos/ui/common/gradient_button.dart'; +import 'package:photos/ui/components/button_widget.dart'; +import 'package:photos/ui/components/dialog_widget.dart'; +import 'package:photos/ui/components/models/button_type.dart'; import 'package:photos/ui/payment/subscription.dart'; class LandingPageWidget extends StatefulWidget { @@ -151,7 +153,7 @@ class _LandingPageWidgetState extends State { ); } - void _navigateToSignUpPage() { + Future _navigateToSignUpPage() async { UpdateService.instance.hideChangeLog().ignore(); UserRemoteFlagService.instance.stopPasswordReminder().ignore(); Widget page; @@ -210,17 +212,23 @@ class _LandingPageWidgetState extends State { Future _showAutoLogoutDialogIfRequired() async { final bool autoLogout = Configuration.instance.showAutoLogoutDialog(); if (autoLogout) { - final result = await showChoiceDialog( - context, - "Please login again", - '''The developer account we use to publish ente on App Store has - changed. Because of this, you will need to login again.\n\nOur - apologies for the inconvenience, but this was unavoidable.''', - firstAction: "Cancel", - secondAction: "Login", + final ButtonAction? result = await showDialogWidget( + context: context, + title: "Please login again", + body: "The developer account we use to publish ente on App Store has " + "changed. Because of this, you will need to login again.\n\nOur " + "apologies for the inconvenience, but this was unavoidable.", + buttons: const [ + ButtonWidget( + buttonType: ButtonType.neutral, + buttonAction: ButtonAction.first, + labelText: "Ok", + isInAlert: true, + ), + ], ); - await Configuration.instance.clearAutoLogoutFlag(); - if (result != null && result == DialogUserChoice.secondChoice) { + Configuration.instance.clearAutoLogoutFlag().ignore(); + if (result != null && result == ButtonAction.first) { _navigateToSignInPage(); } }