Przeglądaj źródła

Switch to new dialogBox + copy change

Neeraj Gupta 2 lat temu
rodzic
commit
a22312f243
1 zmienionych plików z 20 dodań i 12 usunięć
  1. 20 12
      lib/ui/home/landing_page_widget.dart

+ 20 - 12
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<LandingPageWidget> {
     );
   }
 
-  void _navigateToSignUpPage() {
+  Future<void> _navigateToSignUpPage() async {
     UpdateService.instance.hideChangeLog().ignore();
     UserRemoteFlagService.instance.stopPasswordReminder().ignore();
     Widget page;
@@ -210,17 +212,23 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
   Future<void> _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();
       }
     }