mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 10:11:52 +03:00
Add logo in drawer.
This commit is contained in:
parent
6bad16315c
commit
9cc66db682
BIN
assets/graphics/yubico-green.png
Executable file
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
BIN
assets/graphics/yubico-white.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
@ -11,6 +11,7 @@ import '../../settings_page.dart';
|
|||||||
import '../message.dart';
|
import '../message.dart';
|
||||||
import '../models.dart';
|
import '../models.dart';
|
||||||
import '../state.dart';
|
import '../state.dart';
|
||||||
|
import 'graphics.dart';
|
||||||
|
|
||||||
extension on Application {
|
extension on Application {
|
||||||
IconData get _icon {
|
IconData get _icon {
|
||||||
@ -48,6 +49,9 @@ class MainPageDrawer extends ConsumerWidget {
|
|||||||
context.findAncestorWidgetOfExactType<MediaQuery>();
|
context.findAncestorWidgetOfExactType<MediaQuery>();
|
||||||
final width = mediaQuery?.data.size.width ?? 400;
|
final width = mediaQuery?.data.size.width ?? 400;
|
||||||
|
|
||||||
|
final color =
|
||||||
|
Theme.of(context).brightness == Brightness.dark ? 'white' : 'green';
|
||||||
|
|
||||||
return Drawer(
|
return Drawer(
|
||||||
width: width < 357 ? 0.85 * width : null,
|
width: width < 357 ? 0.85 * width : null,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
@ -57,7 +61,16 @@ class MainPageDrawer extends ConsumerWidget {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
primary: false, //Prevents conflict with the MainPage scroll view.
|
primary: false, //Prevents conflict with the MainPage scroll view.
|
||||||
children: [
|
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) ...[
|
if (data != null) ...[
|
||||||
// Normal YubiKey Applications
|
// Normal YubiKey Applications
|
||||||
...supportedApps
|
...supportedApps
|
||||||
|
Loading…
Reference in New Issue
Block a user