desktop dialog for cancel stack restore

This commit is contained in:
ryleedavis 2022-11-10 22:14:47 -07:00
parent de896d30bc
commit 7a0ef96851

View file

@ -1,6 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:stackwallet/widgets/stack_dialog.dart';
class CancelStackRestoreDialog extends StatelessWidget { class CancelStackRestoreDialog extends StatelessWidget {
@ -14,38 +19,95 @@ class CancelStackRestoreDialog extends StatelessWidget {
onWillPop: () async { onWillPop: () async {
return false; return false;
}, },
child: StackDialog( child: !Util.isDesktop
title: "Cancel restore process", ? StackDialog(
message: title: "Cancel restore process",
"Cancelling will revert any changes that may have been applied", message:
leftButton: TextButton( "Cancelling will revert any changes that may have been applied",
style: Theme.of(context) leftButton: TextButton(
.extension<StackColors>()! style: Theme.of(context)
.getSecondaryEnabledButtonColor(context), .extension<StackColors>()!
child: Text( .getSecondaryEnabledButtonColor(context),
"Back", child: Text(
style: STextStyles.itemSubtitle12(context), "Back",
), style: STextStyles.itemSubtitle12(context),
onPressed: () { ),
Navigator.of(context).pop(false); onPressed: () {
}, Navigator.of(context).pop(false);
), },
rightButton: TextButton( ),
style: Theme.of(context) rightButton: TextButton(
.extension<StackColors>()! style: Theme.of(context)
.getPrimaryEnabledButtonColor(context), .extension<StackColors>()!
child: Text( .getPrimaryEnabledButtonColor(context),
"Yes, cancel", child: Text(
style: STextStyles.itemSubtitle12(context).copyWith( "Yes, cancel",
color: style: STextStyles.itemSubtitle12(context).copyWith(
Theme.of(context).extension<StackColors>()!.buttonTextPrimary, color: Theme.of(context)
.extension<StackColors>()!
.buttonTextPrimary,
),
),
onPressed: () {
Navigator.of(context).pop(true);
},
),
)
: DesktopDialog(
maxHeight: 250,
maxWidth: 600,
child: Padding(
padding: const EdgeInsets.only(
top: 20, left: 32, right: 32, bottom: 20),
child: Column(
children: [
Text(
"Cancel Restore Process",
style: STextStyles.desktopH3(context),
),
const SizedBox(height: 24),
SizedBox(
width: 500,
child: RoundedContainer(
color: Theme.of(context)
.extension<StackColors>()!
.snackBarBackError,
child: Text(
"If you cancel, the restore will not complete, and "
"the wallets will not appear in your Stack.",
style: STextStyles.desktopTextMedium(context),
),
),
),
const Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SecondaryButton(
width: 248,
desktopMed: true,
enabled: true,
label: "Keep restoring",
onPressed: () {
Navigator.of(context).pop(false);
},
),
const SizedBox(width: 20),
PrimaryButton(
width: 248,
desktopMed: true,
enabled: true,
label: "Cancel anyway",
onPressed: () {
Navigator.of(context).pop(true);
},
)
],
),
],
),
),
), ),
),
onPressed: () {
Navigator.of(context).pop(true);
},
),
),
); );
} }
} }