desktop send info message popups

This commit is contained in:
julian 2022-10-31 12:21:58 -06:00
parent 7540e593a3
commit 5f28a8cb36

View file

@ -32,7 +32,10 @@ import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/animated_text.dart'; import 'package:stackwallet/widgets/animated_text.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart'; import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/icon_widgets/addressbook_icon.dart'; import 'package:stackwallet/widgets/icon_widgets/addressbook_icon.dart';
import 'package:stackwallet/widgets/icon_widgets/clipboard_icon.dart'; import 'package:stackwallet/widgets/icon_widgets/clipboard_icon.dart';
import 'package:stackwallet/widgets/icon_widgets/qrcode_icon.dart'; import 'package:stackwallet/widgets/icon_widgets/qrcode_icon.dart';
@ -107,23 +110,55 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
useSafeArea: false, useSafeArea: false,
barrierDismissible: true, barrierDismissible: true,
builder: (context) { builder: (context) {
return StackDialog( return DesktopDialog(
title: "Transaction failed", maxWidth: 400,
message: "Sending to self is currently disabled", maxHeight: double.infinity,
rightButton: TextButton( child: Padding(
style: Theme.of(context) padding: const EdgeInsets.only(
.extension<StackColors>()! left: 32,
.getSecondaryEnabledButtonColor(context), bottom: 32,
child: Text( ),
"Ok", child: Column(
style: STextStyles.button(context).copyWith( crossAxisAlignment: CrossAxisAlignment.start,
color: Theme.of(context) children: [
.extension<StackColors>()! Row(
.accentColorDark), mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Transaction failed",
style: STextStyles.desktopH3(context),
),
const DesktopDialogCloseButton(),
],
),
const SizedBox(
height: 12,
),
Text(
"Sending to self is currently disabled",
textAlign: TextAlign.left,
style: STextStyles.desktopTextExtraExtraSmall(context)
.copyWith(
fontSize: 18,
),
),
const SizedBox(
height: 40,
),
Padding(
padding: const EdgeInsets.only(
right: 32,
),
child: SecondaryButton(
desktopMed: true,
label: "Ok",
onPressed: () {
Navigator.of(context).pop();
},
),
),
],
), ),
onPressed: () {
Navigator.of(context).pop();
},
), ),
); );
}, },
@ -154,36 +189,78 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
useSafeArea: false, useSafeArea: false,
barrierDismissible: true, barrierDismissible: true,
builder: (context) { builder: (context) {
return StackDialog( return DesktopDialog(
title: "Confirm send all", maxWidth: 450,
message: maxHeight: double.infinity,
"You are about to send your entire balance. Would you like to continue?", child: Padding(
leftButton: TextButton( padding: const EdgeInsets.only(
style: Theme.of(context) left: 32,
.extension<StackColors>()! bottom: 32,
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
), ),
onPressed: () { child: Column(
Navigator.of(context).pop(false); crossAxisAlignment: CrossAxisAlignment.start,
}, children: [
), Row(
rightButton: TextButton( mainAxisAlignment: MainAxisAlignment.spaceBetween,
style: Theme.of(context) children: [
.extension<StackColors>()! Text(
.getPrimaryEnabledButtonColor(context), "Confirm send all",
child: Text( style: STextStyles.desktopH3(context),
"Yes", ),
style: STextStyles.button(context), const DesktopDialogCloseButton(),
],
),
const SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.only(
right: 32,
),
child: Text(
"You are about to send your entire balance. Would you like to continue?",
textAlign: TextAlign.left,
style: STextStyles.desktopTextExtraExtraSmall(context)
.copyWith(
fontSize: 18,
),
),
),
const SizedBox(
height: 40,
),
Padding(
padding: const EdgeInsets.only(
right: 32,
),
child: Row(
children: [
Expanded(
child: SecondaryButton(
desktopMed: true,
label: "Cancel",
onPressed: () {
Navigator.of(context).pop(false);
},
),
),
const SizedBox(
width: 16,
),
Expanded(
child: PrimaryButton(
desktopMed: true,
label: "Yes",
onPressed: () {
Navigator.of(context).pop(true);
},
),
),
],
),
),
],
), ),
onPressed: () {
Navigator.of(context).pop(true);
},
), ),
); );
}, },