desktop create sign tweaks

making things wider and scrollable but the qr code not overflowingly wide
This commit is contained in:
sneurlax 2024-03-12 07:05:05 -05:00
parent 778795139a
commit 64b0f23910

View file

@ -71,6 +71,8 @@ class _FrostCreateSignConfigViewState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double qrImageSize =
Util.isDesktop ? 360 : MediaQuery.of(context).size.width - 32;
return ConditionalParent( return ConditionalParent(
condition: Util.isDesktop, condition: Util.isDesktop,
builder: (child) => DesktopScaffold( builder: (child) => DesktopScaffold(
@ -79,9 +81,11 @@ class _FrostCreateSignConfigViewState
isCompactHeight: false, isCompactHeight: false,
leading: AppBarBackButton(), leading: AppBarBackButton(),
), ),
body: SizedBox( body: SingleChildScrollView(
width: 480, child: SizedBox(
child: child, width: 600, // Was 480, may look better but overflows the bottom.
child: child,
),
), ),
), ),
child: ConditionalParent( child: ConditionalParent(
@ -126,13 +130,13 @@ class _FrostCreateSignConfigViewState
children: [ children: [
if (!Util.isDesktop) const Spacer(), if (!Util.isDesktop) const Spacer(),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.width - 32, height: qrImageSize,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
QrImageView( QrImageView(
data: ref.watch(pFrostTxData.state).state!.frostMSConfig!, data: ref.watch(pFrostTxData.state).state!.frostMSConfig!,
size: MediaQuery.of(context).size.width - 32, size: qrImageSize,
backgroundColor: backgroundColor:
Theme.of(context).extension<StackColors>()!.background, Theme.of(context).extension<StackColors>()!.background,
foregroundColor: Theme.of(context) foregroundColor: Theme.of(context)
@ -142,9 +146,10 @@ class _FrostCreateSignConfigViewState
], ],
), ),
), ),
const SizedBox( if (!Util.isDesktop)
height: 32, const SizedBox(
), height: 32,
),
DetailItem( DetailItem(
title: "Encoded config", title: "Encoded config",
detail: ref.watch(pFrostTxData.state).state!.frostMSConfig!, detail: ref.watch(pFrostTxData.state).state!.frostMSConfig!,
@ -157,7 +162,7 @@ class _FrostCreateSignConfigViewState
), ),
), ),
SizedBox( SizedBox(
height: Util.isDesktop ? 64 : 16, height: Util.isDesktop ? 20 : 16,
), ),
if (!Util.isDesktop) if (!Util.isDesktop)
const Spacer( const Spacer(