Color adjustments.

This commit is contained in:
Dain Nilsson 2022-05-20 14:10:17 +02:00
parent f76e6799af
commit 98f5d811dd
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
6 changed files with 71 additions and 45 deletions

View File

@ -46,7 +46,7 @@ class DeviceAvatar extends StatelessWidget {
CircleAvatar(
radius: 22,
backgroundColor: selected
? Theme.of(context).colorScheme.secondary
? Theme.of(context).colorScheme.primary
: Colors.transparent,
child: CircleAvatar(
backgroundColor: Theme.of(context).colorScheme.background,

View File

@ -170,8 +170,8 @@ class DrawerItem extends StatelessWidget {
minLeadingWidth: 24,
minVerticalPadding: 18,
selected: selected,
selectedColor: Colors.black,
selectedTileColor: Theme.of(context).colorScheme.secondary,
selectedColor: Theme.of(context).colorScheme.onPrimary,
selectedTileColor: Theme.of(context).colorScheme.primary,
leading: IconTheme.merge(
data: const IconThemeData(size: 24),
child: icon,

View File

@ -133,26 +133,27 @@ class _AddFingerprintDialogState extends ConsumerState<AddFingerprintDialog>
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Step 1/2: Capture fingerprint'),
Card(
child: Column(
children: [
AnimatedBuilder(
Column(
children: [
Padding(
padding: const EdgeInsets.all(36.0),
child: AnimatedBuilder(
animation: _color,
builder: (context, _) {
return Icon(
_fingerprint == null ? Icons.fingerprint : Icons.check,
size: 200.0,
size: 128.0,
color: _color.value,
);
},
),
LinearProgressIndicator(value: progress),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(_getMessage()),
),
],
),
),
LinearProgressIndicator(value: progress),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(_getMessage()),
),
],
),
const Text('Step 2/2: Name fingerprint'),
TextFormField(

View File

@ -31,10 +31,23 @@ class FidoUnlockedPage extends ConsumerWidget {
? [
const ListTile(title: Text('Credentials')),
...creds.map((cred) => ListTile(
leading:
const CircleAvatar(child: Icon(Icons.link)),
title: Text(cred.userName),
subtitle: Text(cred.rpId),
leading: CircleAvatar(
foregroundColor:
Theme.of(context).colorScheme.onPrimary,
backgroundColor:
Theme.of(context).colorScheme.primary,
child: const Icon(Icons.person),
),
title: Text(
cred.userName,
softWrap: false,
overflow: TextOverflow.fade,
),
subtitle: Text(
cred.rpId,
softWrap: false,
overflow: TextOverflow.fade,
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -47,7 +60,7 @@ class FidoUnlockedPage extends ConsumerWidget {
node.path, cred),
);
},
icon: const Icon(Icons.delete)),
icon: const Icon(Icons.delete_outline)),
],
),
)),
@ -61,10 +74,18 @@ class FidoUnlockedPage extends ConsumerWidget {
? [
const ListTile(title: Text('Fingerprints')),
...fingerprints.map((fp) => ListTile(
leading: const CircleAvatar(
child: Icon(Icons.fingerprint),
leading: CircleAvatar(
foregroundColor:
Theme.of(context).colorScheme.onSecondary,
backgroundColor:
Theme.of(context).colorScheme.secondary,
child: const Icon(Icons.fingerprint),
),
title: Text(
fp.label,
softWrap: false,
overflow: TextOverflow.fade,
),
title: Text(fp.label),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -77,7 +98,7 @@ class FidoUnlockedPage extends ConsumerWidget {
node.path, fp),
);
},
icon: const Icon(Icons.edit)),
icon: const Icon(Icons.edit_outlined)),
IconButton(
onPressed: () {
showDialog(
@ -87,7 +108,7 @@ class FidoUnlockedPage extends ConsumerWidget {
node.path, fp),
);
},
icon: const Icon(Icons.delete)),
icon: const Icon(Icons.delete_outline)),
],
),
))
@ -129,7 +150,9 @@ class FidoUnlockedPage extends ConsumerWidget {
List<Widget> _buildActions(BuildContext context) => [
if (state.bioEnroll != null)
OutlinedButton.icon(
style: AppTheme.primaryOutlinedButtonStyle(context),
style: state.bioEnroll == true
? null
: AppTheme.primaryOutlinedButtonStyle(context),
label: const Text('Add fingerprint'),
icon: const Icon(Icons.fingerprint),
onPressed: () {

View File

@ -79,7 +79,7 @@ class _UnlockedView extends ConsumerWidget {
title: const Text('Authenticator'),
graphic: noAccounts,
header: 'No accounts',
actions: _buildActions(context),
actions: _buildActions(context, true),
);
}
@ -112,15 +112,15 @@ class _UnlockedView extends ConsumerWidget {
);
}),
),
actions: _buildActions(context),
actions: _buildActions(context, false),
child: AccountList(devicePath, oathState),
);
}
List<Widget> _buildActions(BuildContext context) {
List<Widget> _buildActions(BuildContext context, bool isEmpty) {
return [
OutlinedButton.icon(
style: AppTheme.primaryOutlinedButtonStyle(context),
style: isEmpty ? AppTheme.primaryOutlinedButtonStyle(context) : null,
label: const Text('Add account'),
icon: const Icon(Icons.person_add_alt_1),
onPressed: () {

View File

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
const primaryGreen = Color(0xffaed581);
const accentGreen = Color(0xff9aca3c);
const primaryBlue = Color(0xff325f74);
const primaryRed = Color(0xffea4335);
class AppTheme {
static ThemeData get lightTheme => ThemeData(
@ -24,18 +25,18 @@ class AppTheme {
elevation: 0,
toolbarHeight: 48,
//shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
backgroundColor: Colors.white,
backgroundColor: Colors.transparent,
foregroundColor: Colors.grey.shade800,
),
// Mainly used for the OATH dialog view at the moment
buttonTheme: ButtonThemeData(
colorScheme: ColorScheme.light(
secondary: Colors.grey.shade300,
onSecondary: Colors.black,
onSecondary: Colors.grey.shade900,
primary: primaryGreen,
onPrimary: Colors.black,
error: const Color(0xffea4335),
onError: Colors.white,
onPrimary: Colors.grey.shade900,
error: primaryRed,
onError: Colors.grey.shade100,
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
@ -52,7 +53,7 @@ class AppTheme {
),
chipTheme: ChipThemeData(
backgroundColor: Colors.transparent,
selectedColor: const Color(0xffc2e7ff),
selectedColor: const Color(0xffd2dbdf),
side: BorderSide(width: 1, color: Colors.grey.shade400),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
@ -88,7 +89,8 @@ class AppTheme {
colorScheme:
ColorScheme.fromSwatch(brightness: Brightness.dark).copyWith(
primary: primaryGreen,
secondary: primaryGreen,
onPrimary: Colors.black,
secondary: const Color(0xff5d7d90),
),
iconTheme: const IconThemeData(
color: Colors.white70,
@ -108,14 +110,14 @@ class AppTheme {
secondary: Colors.grey.shade800,
onSecondary: Colors.white70,
primary: primaryGreen,
onPrimary: Colors.black,
error: const Color(0xffea4335),
onError: Colors.white,
onPrimary: Colors.grey.shade900,
error: primaryRed,
onError: Colors.grey.shade100,
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
primary: Colors.white,
primary: Colors.white70,
side: const BorderSide(width: 1, color: Colors.white12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
@ -163,9 +165,9 @@ class AppTheme {
static ButtonStyle primaryOutlinedButtonStyle(BuildContext context) =>
OutlinedButton.styleFrom(
primary: Theme.of(context).colorScheme.onSecondary,
backgroundColor: Theme.of(context).colorScheme.secondary,
side: BorderSide(
width: 1, color: Theme.of(context).colorScheme.secondary),
primary: Theme.of(context).colorScheme.onPrimary,
backgroundColor: Theme.of(context).colorScheme.primary,
side:
BorderSide(width: 1, color: Theme.of(context).colorScheme.primary),
);
}