mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 19:05:51 +00:00
address popup desktop conditional layout
This commit is contained in:
parent
0746fe36b7
commit
33926d2b5e
2 changed files with 74 additions and 18 deletions
|
@ -9,8 +9,10 @@ import 'package:stackwallet/pages/paynym/subwidgets/paynym_bot.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.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/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.dart';
|
||||||
|
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||||
|
|
||||||
class PaynymQrPopup extends StatelessWidget {
|
class PaynymQrPopup extends StatelessWidget {
|
||||||
const PaynymQrPopup({
|
const PaynymQrPopup({
|
||||||
|
@ -22,15 +24,31 @@ class PaynymQrPopup extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final isDesktop = Util.isDesktop;
|
||||||
|
|
||||||
return DesktopDialog(
|
return DesktopDialog(
|
||||||
maxWidth: MediaQuery.of(context).size.width - 32,
|
maxWidth: isDesktop ? 580 : MediaQuery.of(context).size.width - 32,
|
||||||
maxHeight: double.infinity,
|
maxHeight: double.infinity,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
if (isDesktop)
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 32),
|
||||||
|
child: Text(
|
||||||
|
"Address details",
|
||||||
|
style: STextStyles.desktopH3(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const DesktopDialogCloseButton(),
|
||||||
|
],
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
left: 24,
|
left: isDesktop ? 32 : 24,
|
||||||
top: 24,
|
top: isDesktop ? 16 : 24,
|
||||||
right: 24,
|
right: 24,
|
||||||
bottom: 16,
|
bottom: 16,
|
||||||
),
|
),
|
||||||
|
@ -38,22 +56,26 @@ class PaynymQrPopup extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
PayNymBot(
|
PayNymBot(
|
||||||
paymentCodeString: paynymAccount.codes.first.code,
|
paymentCodeString: paynymAccount.codes.first.code,
|
||||||
size: 32,
|
size: isDesktop ? 56 : 32,
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 12,
|
width: 12,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
paynymAccount.nymName,
|
paynymAccount.nymName,
|
||||||
style: STextStyles.w600_12(context),
|
style: isDesktop
|
||||||
|
? STextStyles.w500_24(context)
|
||||||
|
: STextStyles.w600_12(context),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
if (!isDesktop)
|
||||||
color: Theme.of(context).extension<StackColors>()!.backgroundAppBar,
|
Container(
|
||||||
height: 1,
|
color:
|
||||||
),
|
Theme.of(context).extension<StackColors>()!.backgroundAppBar,
|
||||||
|
height: 1,
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 24,
|
left: 24,
|
||||||
|
@ -71,26 +93,34 @@ class PaynymQrPopup extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Your PayNym address",
|
isDesktop ? "PayNym address" : "Your PayNym address",
|
||||||
style: STextStyles.infoSmall(context),
|
style: isDesktop
|
||||||
|
? STextStyles.desktopTextSmall(context).copyWith(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.textSubtitle1,
|
||||||
|
)
|
||||||
|
: STextStyles.infoSmall(context),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 6,
|
height: 6,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
paynymAccount.codes.first.code,
|
paynymAccount.codes.first.code,
|
||||||
style: STextStyles.infoSmall(context).copyWith(
|
style: isDesktop
|
||||||
color: Theme.of(context)
|
? STextStyles.desktopTextSmall(context)
|
||||||
.extension<StackColors>()!
|
: STextStyles.infoSmall(context).copyWith(
|
||||||
.textDark,
|
color: Theme.of(context)
|
||||||
),
|
.extension<StackColors>()!
|
||||||
|
.textDark,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 6,
|
height: 6,
|
||||||
),
|
),
|
||||||
BlueTextButton(
|
BlueTextButton(
|
||||||
text: "Copy",
|
text: "Copy",
|
||||||
textSize: 10,
|
textSize: isDesktop ? 18 : 10,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await Clipboard.setData(
|
await Clipboard.setData(
|
||||||
ClipboardData(
|
ClipboardData(
|
||||||
|
|
|
@ -809,6 +809,32 @@ class STextStyles {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TextStyle w500_24(BuildContext context) {
|
||||||
|
switch (_theme(context).themeType) {
|
||||||
|
case ThemeType.light:
|
||||||
|
return GoogleFonts.inter(
|
||||||
|
color: _theme(context).textDark,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 24,
|
||||||
|
height: 24 / 24,
|
||||||
|
);
|
||||||
|
case ThemeType.oceanBreeze:
|
||||||
|
return GoogleFonts.inter(
|
||||||
|
color: _theme(context).textDark,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 24,
|
||||||
|
height: 24 / 24,
|
||||||
|
);
|
||||||
|
case ThemeType.dark:
|
||||||
|
return GoogleFonts.inter(
|
||||||
|
color: _theme(context).textDark,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 24,
|
||||||
|
height: 24 / 24,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static TextStyle desktopTextMedium(BuildContext context) {
|
static TextStyle desktopTextMedium(BuildContext context) {
|
||||||
switch (_theme(context).themeType) {
|
switch (_theme(context).themeType) {
|
||||||
case ThemeType.light:
|
case ThemeType.light:
|
||||||
|
|
Loading…
Reference in a new issue