mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-25 08:38:45 +00:00
desktop connect confirm dialog layout
This commit is contained in:
parent
039508ee32
commit
12477e8fb5
1 changed files with 110 additions and 24 deletions
|
@ -3,7 +3,11 @@ import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/format.dart';
|
import 'package:stackwallet/utilities/format.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/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/desktop/secondary_button.dart';
|
||||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||||
|
@ -22,31 +26,113 @@ class ConfirmPaynymConnectDialog extends StatelessWidget {
|
||||||
final int amount;
|
final int amount;
|
||||||
final Coin coin;
|
final Coin coin;
|
||||||
|
|
||||||
|
String get title => "Connect to $nymName";
|
||||||
|
|
||||||
|
String get message => "A one-time connection fee of "
|
||||||
|
"${Format.satoshisToAmount(amount, coin: coin)} ${coin.ticker} "
|
||||||
|
"will be charged to connect to this PayNym.\n\nThis fee "
|
||||||
|
"covers the cost of creating a one-time transaction to create a "
|
||||||
|
"record on the blockchain. This keeps PayNyms decentralized.";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return StackDialog(
|
if (Util.isDesktop) {
|
||||||
title: "Connect to $nymName",
|
return DesktopDialog(
|
||||||
icon: SvgPicture.asset(
|
maxHeight: double.infinity,
|
||||||
Assets.svg.userPlus,
|
child: Column(
|
||||||
color: Theme.of(context).extension<StackColors>()!.textDark,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
width: 24,
|
children: [
|
||||||
height: 24,
|
Row(
|
||||||
),
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
message: "A one-time connection fee of "
|
children: [
|
||||||
"${Format.satoshisToAmount(amount, coin: coin)} ${coin.ticker} "
|
Padding(
|
||||||
"will be charged to connect to this PayNym.\n\nThis fee "
|
padding: const EdgeInsets.only(left: 40),
|
||||||
"covers the cost of creating a one-time transaction to create a "
|
child: SvgPicture.asset(
|
||||||
"record on the blockchain. This keeps PayNyms decentralized.",
|
Assets.svg.userPlus,
|
||||||
leftButton: SecondaryButton(
|
color: Theme.of(context).extension<StackColors>()!.textDark,
|
||||||
buttonHeight: ButtonHeight.xl,
|
width: 32,
|
||||||
label: "Cancel",
|
height: 32,
|
||||||
onPressed: Navigator.of(context).pop,
|
),
|
||||||
),
|
),
|
||||||
rightButton: PrimaryButton(
|
const DesktopDialogCloseButton(),
|
||||||
buttonHeight: ButtonHeight.xl,
|
],
|
||||||
label: "Connect",
|
),
|
||||||
onPressed: onConfirmPressed,
|
Padding(
|
||||||
),
|
padding: const EdgeInsets.only(
|
||||||
);
|
left: 40,
|
||||||
|
bottom: 32,
|
||||||
|
right: 40,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: STextStyles.desktopH3(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 40,
|
||||||
|
right: 40,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
message,
|
||||||
|
style: STextStyles.desktopTextMedium(context).copyWith(
|
||||||
|
color: Theme.of(context).extension<StackColors>()!.textDark3,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 40,
|
||||||
|
bottom: 40,
|
||||||
|
right: 40,
|
||||||
|
top: 32,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: SecondaryButton(
|
||||||
|
buttonHeight: ButtonHeight.l,
|
||||||
|
label: "Cancel",
|
||||||
|
onPressed: Navigator.of(context).pop,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 16,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: PrimaryButton(
|
||||||
|
buttonHeight: ButtonHeight.l,
|
||||||
|
label: "Connect",
|
||||||
|
onPressed: onConfirmPressed,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return StackDialog(
|
||||||
|
title: title,
|
||||||
|
icon: SvgPicture.asset(
|
||||||
|
Assets.svg.userPlus,
|
||||||
|
color: Theme.of(context).extension<StackColors>()!.textDark,
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
),
|
||||||
|
message: message,
|
||||||
|
leftButton: SecondaryButton(
|
||||||
|
buttonHeight: ButtonHeight.xl,
|
||||||
|
label: "Cancel",
|
||||||
|
onPressed: Navigator.of(context).pop,
|
||||||
|
),
|
||||||
|
rightButton: PrimaryButton(
|
||||||
|
buttonHeight: ButtonHeight.xl,
|
||||||
|
label: "Connect",
|
||||||
|
onPressed: onConfirmPressed,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue