Switch to new dialogBox + copy change

This commit is contained in:
Neeraj Gupta 2022-12-31 10:46:58 +05:30
parent 18f4731eb3
commit a22312f243
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -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();
}
}