Add logo in drawer.

This commit is contained in:
Dain Nilsson 2022-08-12 09:53:34 +02:00
parent 6bad16315c
commit 9cc66db682
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
3 changed files with 14 additions and 1 deletions

BIN
assets/graphics/yubico-green.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/graphics/yubico-white.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -11,6 +11,7 @@ import '../../settings_page.dart';
import '../message.dart';
import '../models.dart';
import '../state.dart';
import 'graphics.dart';
extension on Application {
IconData get _icon {
@ -48,6 +49,9 @@ class MainPageDrawer extends ConsumerWidget {
context.findAncestorWidgetOfExactType<MediaQuery>();
final width = mediaQuery?.data.size.width ?? 400;
final color =
Theme.of(context).brightness == Brightness.dark ? 'white' : 'green';
return Drawer(
width: width < 357 ? 0.85 * width : null,
shape: const RoundedRectangleBorder(
@ -57,7 +61,16 @@ class MainPageDrawer extends ConsumerWidget {
child: ListView(
primary: false, //Prevents conflict with the MainPage scroll view.
children: [
const SizedBox(height: 24.0),
Padding(
padding: const EdgeInsets.only(top: 19.0, left: 30.0, bottom: 12.0),
child: Image.asset(
'assets/graphics/yubico-$color.png',
alignment: Alignment.centerLeft,
height: 28,
filterQuality: FilterQuality.medium,
),
),
const Divider(indent: 16.0, endIndent: 28.0),
if (data != null) ...[
// Normal YubiKey Applications
...supportedApps