Skip to content

Commit 8930f37

Browse files
committed
mwc ui tweaks
1 parent 62c28ca commit 8930f37

4 files changed

Lines changed: 62 additions & 41 deletions

File tree

lib/pages/finalize_view/finalize_view.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ class _FinalizeViewState extends ConsumerState<FinalizeView> {
166166
),
167167
);
168168
} else {
169-
_slateController.text = "";
169+
setState(() {
170+
_slateController.text = "";
171+
});
170172
unawaited(
171173
showFloatingFlushBar(
172174
type: FlushBarType.success,

lib/pages/receive_view/receive_view.dart

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,32 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
124124
}
125125

126126
if (mounted) {
127-
await showDialog<void>(
128-
context: context,
129-
builder:
130-
(context) => SDialog(
131-
child: MwcSlatepackImportDialog(
132-
walletId: widget.walletId,
133-
clipboard: widget.clipboard,
134-
rawSlatepack: result.raw,
135-
decoded: result.result,
136-
slatepackType: result.type,
127+
final response =
128+
await showDialog<({String responseSlatepack, bool wasEncrypted})>(
129+
context: context,
130+
builder:
131+
(context) => SDialog(
132+
child: MwcSlatepackImportDialog(
133+
walletId: widget.walletId,
134+
clipboard: widget.clipboard,
135+
rawSlatepack: result.raw,
136+
decoded: result.result,
137+
slatepackType: result.type,
138+
),
139+
),
140+
);
141+
142+
if (mounted && response != null) {
143+
await showDialog<void>(
144+
context: context,
145+
barrierDismissible: false,
146+
builder:
147+
(context) => SlatepackResponseDialog(
148+
responseSlatepack: response.responseSlatepack,
149+
wasEncrypted: response.wasEncrypted,
137150
),
138-
),
139-
);
151+
);
152+
}
140153
}
141154
}
142155
}

lib/pages/receive_view/sub_widgets/mwc_slatepack_import_dialog.dart

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,7 @@ class _MwcSlatepackImportDialogState
101101
}
102102

103103
if (mounted) {
104-
await showDialog<void>(
105-
context: context,
106-
barrierDismissible: false,
107-
builder:
108-
(context) => _SlatepackResponseDialog(
109-
responseSlatepack: result.responseSlatepack,
110-
wasEncrypted: result.wasEncrypted,
111-
),
112-
);
104+
Navigator.of(context).pop(result);
113105
}
114106
}
115107

@@ -167,7 +159,7 @@ class _MwcSlatepackImportDialogState
167159
],
168160
),
169161
Padding(
170-
padding: EdgeInsets.symmetric(horizontal: isDesktop ? 32 : 16),
162+
padding: EdgeInsets.symmetric(horizontal: isDesktop ? 32 : 24),
171163
child: Column(
172164
mainAxisSize: MainAxisSize.min,
173165
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -191,7 +183,7 @@ class _MwcSlatepackImportDialogState
191183
children: [
192184
if (!isDesktop)
193185
Padding(
194-
padding: const EdgeInsets.only(top: 16, bottom: 24),
186+
padding: const EdgeInsets.only(top: 24, bottom: 24),
195187
child: Text(
196188
"Import slatepack",
197189
style: STextStyles.pageTitleH2(context),
@@ -270,14 +262,15 @@ class _MwcSlatepackImportDialogState
270262
],
271263
),
272264
),
273-
isDesktop ? const SizedBox(height: 32) : const SizedBox(height: 16),
265+
isDesktop ? const SizedBox(height: 32) : const SizedBox(height: 24),
274266
],
275267
);
276268
}
277269
}
278270

279-
class _SlatepackResponseDialog extends StatelessWidget {
280-
const _SlatepackResponseDialog({
271+
class SlatepackResponseDialog extends StatelessWidget {
272+
const SlatepackResponseDialog({
273+
super.key,
281274
required this.responseSlatepack,
282275
required this.wasEncrypted,
283276
});

lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,22 +142,35 @@ class _DesktopReceiveState extends ConsumerState<DesktopReceive> {
142142
}
143143

144144
if (mounted) {
145-
await showDialog<void>(
146-
context: context,
147-
builder:
148-
(context) => SDialog(
149-
child: SizedBox(
150-
width: 700,
151-
child: MwcSlatepackImportDialog(
152-
walletId: widget.walletId,
153-
clipboard: widget.clipboard,
154-
rawSlatepack: result.raw,
155-
decoded: result.result,
156-
slatepackType: result.type,
145+
final response =
146+
await showDialog<({String responseSlatepack, bool wasEncrypted})>(
147+
context: context,
148+
builder:
149+
(context) => SDialog(
150+
child: SizedBox(
151+
width: 700,
152+
child: MwcSlatepackImportDialog(
153+
walletId: widget.walletId,
154+
clipboard: widget.clipboard,
155+
rawSlatepack: result.raw,
156+
decoded: result.result,
157+
slatepackType: result.type,
158+
),
159+
),
157160
),
161+
);
162+
163+
if (mounted && response != null) {
164+
await showDialog<void>(
165+
context: context,
166+
barrierDismissible: false,
167+
builder:
168+
(context) => SlatepackResponseDialog(
169+
responseSlatepack: response.responseSlatepack,
170+
wasEncrypted: response.wasEncrypted,
158171
),
159-
),
160-
);
172+
);
173+
}
161174
}
162175
}
163176

0 commit comments

Comments
 (0)