From 76e9ceabcff743f9fb5e316b2b641e6f242f9f1d Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Fri, 22 Dec 2023 14:07:56 +0100 Subject: [PATCH] Add graphics for NFC no/unknown device. --- lib/app/views/device_error_screen.dart | 31 +++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/lib/app/views/device_error_screen.dart b/lib/app/views/device_error_screen.dart index b8fe95ec..ebd76a4a 100755 --- a/lib/app/views/device_error_screen.dart +++ b/lib/app/views/device_error_screen.dart @@ -39,8 +39,11 @@ class DeviceErrorScreen extends ConsumerWidget { if (Platform.isWindows && !ref.watch(rpcStateProvider.select((state) => state.isAdmin))) { return MessagePage( - graphic: Icon(Icons.stop, - size: 96, color: Theme.of(context).colorScheme.primary), + graphic: Icon( + Icons.do_not_disturb_on_outlined, + size: 96, + color: Theme.of(context).colorScheme.primary, + ), message: l10n.p_elevated_permissions_required, actions: [ ElevatedButton.icon( @@ -77,12 +80,24 @@ class DeviceErrorScreen extends ConsumerWidget { final l10n = AppLocalizations.of(context)!; return node.map( usbYubiKey: (node) => _buildUsbPid(context, ref, node.pid), - nfcReader: (node) { - final message = switch (error) { - 'unknown-device' => l10n.s_unknown_device, - _ => l10n.l_place_on_nfc_reader, - }; - return MessagePage(message: message); + nfcReader: (node) => switch (error) { + 'unknown-device' => MessagePage( + graphic: Icon( + Icons.help_outline, + size: 96, + color: Theme.of(context).colorScheme.primary, + ), + message: l10n.s_unknown_device, + ), + _ => MessagePage( + graphic: Image.asset( + 'assets/graphics/no-key.png', + filterQuality: FilterQuality.medium, + scale: 2, + color: Theme.of(context).colorScheme.primary, + ), + message: l10n.l_place_on_nfc_reader, + ), }, ); }