mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-09 12:19:24 +00:00
desktop frost ui bandaid
This commit is contained in:
parent
7276cd41f0
commit
a858e4924c
5 changed files with 31 additions and 14 deletions
|
@ -33,6 +33,7 @@ enum FrostInterruptionDialogType {
|
|||
}
|
||||
|
||||
final pFrostCreateCurrentStep = StateProvider.autoDispose((ref) => 1);
|
||||
final pFrostScaffoldCanPopDesktop = StateProvider.autoDispose((_) => false);
|
||||
final pFrostScaffoldArgs = StateProvider<
|
||||
({
|
||||
({String walletName, FrostCurrency frostCurrency}) info,
|
||||
|
|
|
@ -193,6 +193,10 @@ class _SelectNewFrostImportTypeViewState
|
|||
stepRoutes: FrostRouteGenerator.joinReshareStepRoutes,
|
||||
onSuccess: () {
|
||||
// successful completion of steps
|
||||
ref.read(pFrostMultisigConfig.state).state = null;
|
||||
ref.read(pFrostStartKeyGenData.state).state = null;
|
||||
ref.read(pFrostSecretSharesData.state).state = null;
|
||||
ref.read(pFrostScaffoldArgs.state).state = null;
|
||||
},
|
||||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType.resharing,
|
||||
|
|
|
@ -180,6 +180,7 @@ class _FrostCreateStep5State extends ConsumerState<FrostCreateStep5> {
|
|||
}
|
||||
|
||||
if (mounted) {
|
||||
ref.read(pFrostScaffoldCanPopDesktop.notifier).state = true;
|
||||
ref.read(pFrostScaffoldArgs)!.onSuccess();
|
||||
}
|
||||
} catch (e, s) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import 'package:stackwallet/themes/stack_colors.dart';
|
|||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/simple_mobile_dialog.dart';
|
||||
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||
|
@ -137,7 +138,15 @@ class _FrostStepQrDialogState extends State<FrostStepQrDialog> {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
ConditionalParent(
|
||||
condition: Util.isDesktop,
|
||||
builder: (child) => ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 360,
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
|
@ -153,6 +162,7 @@ class _FrostStepQrDialogState extends State<FrostStepQrDialog> {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
SelectableText(
|
||||
widget.data,
|
||||
|
|
|
@ -41,7 +41,8 @@ class _FrostScaffoldState extends ConsumerState<FrostStepScaffold> {
|
|||
}
|
||||
|
||||
Future<void> _requestPop(BuildContext context) async {
|
||||
if (_requestPopLock) {
|
||||
if (_requestPopLock ||
|
||||
(Util.isDesktop && ref.read(pFrostScaffoldCanPopDesktop))) {
|
||||
return;
|
||||
}
|
||||
_requestPopLock = true;
|
||||
|
@ -98,7 +99,7 @@ class _FrostScaffoldState extends ConsumerState<FrostStepScaffold> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
canPop: Util.isDesktop && ref.watch(pFrostScaffoldCanPopDesktop),
|
||||
onPopInvoked: (_) => _requestPop(context),
|
||||
child: Material(
|
||||
child: ConditionalParent(
|
||||
|
|
Loading…
Reference in a new issue