mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
feat: Disable Camera Action in Wallet Restore for Desktop (#2263)
This commit is contained in:
parent
82e3ebf4fa
commit
ca2c953cf4
1 changed files with 20 additions and 20 deletions
|
@ -64,7 +64,8 @@ class _RestoreOptionsBodyState extends State<_RestoreOptionsBody> {
|
||||||
final mainImageColor = Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor;
|
final mainImageColor = Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor;
|
||||||
final brightImageColor = Theme.of(context).extension<InfoTheme>()!.textColor;
|
final brightImageColor = Theme.of(context).extension<InfoTheme>()!.textColor;
|
||||||
final imageColor = widget.themeType == ThemeType.bright ? brightImageColor : mainImageColor;
|
final imageColor = widget.themeType == ThemeType.bright ? brightImageColor : mainImageColor;
|
||||||
final imageLedger = Image.asset('assets/images/hardware_wallet/ledger_nano_x.png', width: 40, color: imageColor);
|
final imageLedger = Image.asset('assets/images/hardware_wallet/ledger_nano_x.png',
|
||||||
|
width: 40, color: imageColor);
|
||||||
final imageSeedKeys = Image.asset('assets/images/restore_wallet_image.png', color: imageColor);
|
final imageSeedKeys = Image.asset('assets/images/restore_wallet_image.png', color: imageColor);
|
||||||
final imageBackup = Image.asset('assets/images/backup.png', color: imageColor);
|
final imageBackup = Image.asset('assets/images/backup.png', color: imageColor);
|
||||||
|
|
||||||
|
@ -78,9 +79,7 @@ class _RestoreOptionsBodyState extends State<_RestoreOptionsBody> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
OptionTile(
|
OptionTile(
|
||||||
key: ValueKey('restore_options_from_seeds_or_keys_button_key'),
|
key: ValueKey('restore_options_from_seeds_or_keys_button_key'),
|
||||||
onPressed: () => Navigator.pushNamed(
|
onPressed: () => Navigator.pushNamed(context, Routes.restoreWalletFromSeedKeys),
|
||||||
context,
|
|
||||||
Routes.restoreWalletFromSeedKeys),
|
|
||||||
image: imageSeedKeys,
|
image: imageSeedKeys,
|
||||||
title: S.of(context).restore_title_from_seed_keys,
|
title: S.of(context).restore_title_from_seed_keys,
|
||||||
description: S.of(context).restore_description_from_seed_keys,
|
description: S.of(context).restore_description_from_seed_keys,
|
||||||
|
@ -101,26 +100,27 @@ class _RestoreOptionsBodyState extends State<_RestoreOptionsBody> {
|
||||||
padding: EdgeInsets.only(top: 24),
|
padding: EdgeInsets.only(top: 24),
|
||||||
child: OptionTile(
|
child: OptionTile(
|
||||||
key: ValueKey('restore_options_from_hardware_wallet_button_key'),
|
key: ValueKey('restore_options_from_hardware_wallet_button_key'),
|
||||||
onPressed: () => Navigator.pushNamed(
|
onPressed: () =>
|
||||||
context, Routes.restoreWalletFromHardwareWallet),
|
Navigator.pushNamed(context, Routes.restoreWalletFromHardwareWallet),
|
||||||
image: imageLedger,
|
image: imageLedger,
|
||||||
title: S.of(context).restore_title_from_hardware_wallet,
|
title: S.of(context).restore_title_from_hardware_wallet,
|
||||||
description: S.of(context).restore_description_from_hardware_wallet,
|
description: S.of(context).restore_description_from_hardware_wallet,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
if (DeviceInfo.instance.isMobile)
|
||||||
padding: EdgeInsets.only(top: 24),
|
Padding(
|
||||||
child: OptionTile(
|
padding: EdgeInsets.only(top: 24),
|
||||||
key: ValueKey('restore_options_from_qr_button_key'),
|
child: OptionTile(
|
||||||
onPressed: () => _onScanQRCode(context),
|
key: ValueKey('restore_options_from_qr_button_key'),
|
||||||
icon: Icon(
|
onPressed: () => _onScanQRCode(context),
|
||||||
Icons.qr_code_rounded,
|
icon: Icon(
|
||||||
color: imageColor,
|
Icons.qr_code_rounded,
|
||||||
size: 50,
|
color: imageColor,
|
||||||
),
|
size: 50,
|
||||||
title: S.of(context).scan_qr_code,
|
),
|
||||||
description: S.of(context).cold_or_recover_wallet),
|
title: S.of(context).scan_qr_code,
|
||||||
)
|
description: S.of(context).cold_or_recover_wallet),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
@ -145,7 +145,7 @@ class _RestoreOptionsBodyState extends State<_RestoreOptionsBody> {
|
||||||
|
|
||||||
Future<void> _onScanQRCode(BuildContext context) async {
|
Future<void> _onScanQRCode(BuildContext context) async {
|
||||||
final isCameraPermissionGranted =
|
final isCameraPermissionGranted =
|
||||||
await PermissionHandler.checkPermission(Permission.camera, context);
|
await PermissionHandler.checkPermission(Permission.camera, context);
|
||||||
|
|
||||||
if (!isCameraPermissionGranted) return;
|
if (!isCameraPermissionGranted) return;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue