desktop frost ui bandaid

This commit is contained in:
julian 2024-05-02 10:50:28 -06:00
parent 7276cd41f0
commit a858e4924c
5 changed files with 31 additions and 14 deletions

View file

@ -33,6 +33,7 @@ enum FrostInterruptionDialogType {
} }
final pFrostCreateCurrentStep = StateProvider.autoDispose((ref) => 1); final pFrostCreateCurrentStep = StateProvider.autoDispose((ref) => 1);
final pFrostScaffoldCanPopDesktop = StateProvider.autoDispose((_) => false);
final pFrostScaffoldArgs = StateProvider< final pFrostScaffoldArgs = StateProvider<
({ ({
({String walletName, FrostCurrency frostCurrency}) info, ({String walletName, FrostCurrency frostCurrency}) info,

View file

@ -193,6 +193,10 @@ class _SelectNewFrostImportTypeViewState
stepRoutes: FrostRouteGenerator.joinReshareStepRoutes, stepRoutes: FrostRouteGenerator.joinReshareStepRoutes,
onSuccess: () { onSuccess: () {
// successful completion of steps // 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:
FrostInterruptionDialogType.resharing, FrostInterruptionDialogType.resharing,

View file

@ -180,6 +180,7 @@ class _FrostCreateStep5State extends ConsumerState<FrostCreateStep5> {
} }
if (mounted) { if (mounted) {
ref.read(pFrostScaffoldCanPopDesktop.notifier).state = true;
ref.read(pFrostScaffoldArgs)!.onSuccess(); ref.read(pFrostScaffoldArgs)!.onSuccess();
} }
} catch (e, s) { } catch (e, s) {

View file

@ -14,6 +14,7 @@ import 'package:stackwallet/themes/stack_colors.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/util.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/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/dialogs/simple_mobile_dialog.dart'; import 'package:stackwallet/widgets/dialogs/simple_mobile_dialog.dart';
import 'package:stackwallet/widgets/rounded_container.dart'; import 'package:stackwallet/widgets/rounded_container.dart';
@ -137,18 +138,27 @@ class _FrostStepQrDialogState extends State<FrostStepQrDialog> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Padding( ConditionalParent(
padding: const EdgeInsets.all(16), condition: Util.isDesktop,
child: AspectRatio( builder: (child) => ConstrainedBox(
aspectRatio: 1, constraints: const BoxConstraints(
child: QrImageView( maxWidth: 360,
data: widget.data, ),
padding: EdgeInsets.zero, child: child,
dataModuleStyle: QrDataModuleStyle( ),
dataModuleShape: QrDataModuleShape.square, child: Padding(
color: Theme.of(context) padding: const EdgeInsets.all(16),
.extension<StackColors>()! child: AspectRatio(
.accentColorDark, aspectRatio: 1,
child: QrImageView(
data: widget.data,
padding: EdgeInsets.zero,
dataModuleStyle: QrDataModuleStyle(
dataModuleShape: QrDataModuleShape.square,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
), ),
), ),
), ),

View file

@ -41,7 +41,8 @@ class _FrostScaffoldState extends ConsumerState<FrostStepScaffold> {
} }
Future<void> _requestPop(BuildContext context) async { Future<void> _requestPop(BuildContext context) async {
if (_requestPopLock) { if (_requestPopLock ||
(Util.isDesktop && ref.read(pFrostScaffoldCanPopDesktop))) {
return; return;
} }
_requestPopLock = true; _requestPopLock = true;
@ -98,7 +99,7 @@ class _FrostScaffoldState extends ConsumerState<FrostStepScaffold> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return PopScope( return PopScope(
canPop: false, canPop: Util.isDesktop && ref.watch(pFrostScaffoldCanPopDesktop),
onPopInvoked: (_) => _requestPop(context), onPopInvoked: (_) => _requestPop(context),
child: Material( child: Material(
child: ConditionalParent( child: ConditionalParent(