Skip to content

Commit 3f5db90

Browse files
committed
fix camera not being closed (preventing qr scanner from working 2nd time)
fix qr code color on restore screen
1 parent 705bffa commit 3f5db90

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

lib/coins/monero/wallet.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class MoneroWallet implements CoinWallet {
8585
Coin.L.all_key_images: allImages,
8686
},
8787
currentWallet: this,
88-
).push(context);
88+
).pushReplacement(context);
8989
}
9090

9191
@override
@@ -148,10 +148,10 @@ class MoneroWallet implements CoinWallet {
148148
await AnimatedURPage(
149149
urqrList: {"signedTx": signedTx},
150150
currentWallet: this,
151-
).push(context);
151+
).pushReplacement(context);
152152
},
153153
cancelCallback: () => {},
154-
).push(context);
154+
).pushReplacement(context);
155155
save();
156156
default:
157157
throw UnimplementedError(Coin.L.error_ur_tag_unsupported(ur.tag));

lib/views/abstract.dart

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ class AbstractView extends StatefulWidget {
4747
);
4848
}
4949

50+
Future<void> pushReplacement(final BuildContext context) async {
51+
await Navigator.of(context).pushReplacement(
52+
CupertinoPageRoute(
53+
builder: (final context) {
54+
return this;
55+
},
56+
),
57+
);
58+
}
59+
5060
late final ViewModel viewModel = throw UnimplementedError();
5161

5262
@override

lib/views/security_backup.dart

+4-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class SecurityBackup extends AbstractView {
9393
text: d.name,
9494
icon: Icons.qr_code_rounded,
9595
onPressed: () async {
96-
await _showQrCode(context, d, color: Colors.transparent);
96+
await _showQrCode(context, d, color: Colors.transparent, color2: Colors.white);
9797
},
9898
);
9999
}
@@ -103,6 +103,7 @@ class SecurityBackup extends AbstractView {
103103
final BuildContext context,
104104
final WalletSeedDetail d, {
105105
final Color color = Colors.black,
106+
final Color? color2,
106107
}) async {
107108
await showAlertWidget(
108109
context: context,
@@ -114,11 +115,11 @@ class SecurityBackup extends AbstractView {
114115
data: d.value,
115116
backgroundColor: color,
116117
dataModuleStyle: QrDataModuleStyle(
117-
color: Colors.black,
118+
color: color2 ?? Colors.black,
118119
dataModuleShape: QrDataModuleShape.square,
119120
),
120121
eyeStyle: QrEyeStyle(
121-
color: Colors.black,
122+
color: color2 ?? Colors.black,
122123
eyeShape: QrEyeShape.square,
123124
),
124125
),

0 commit comments

Comments
 (0)