This commit is contained in:
Dain Nilsson 2024-01-22 10:53:26 +01:00
commit 9793af6405
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
16 changed files with 80 additions and 46 deletions

Binary file not shown.

View File

@ -32,7 +32,7 @@ Future<T?> showBlurDialog<T>({
required BuildContext context, required BuildContext context,
required Widget Function(BuildContext) builder, required Widget Function(BuildContext) builder,
RouteSettings? routeSettings, RouteSettings? routeSettings,
Color barrierColor = const Color(0x80000000), Color barrierColor = const Color(0x00cccccc),
}) async => }) async =>
await showGeneralDialog<T>( await showGeneralDialog<T>(
context: context, context: context,

View File

@ -63,7 +63,7 @@ class AppFailurePage extends ConsumerWidget {
header = null; header = null;
message = l10n.p_webauthn_elevated_permissions_required; message = l10n.p_webauthn_elevated_permissions_required;
actions = [ actions = [
ElevatedButton.icon( FilledButton.icon(
label: Text(l10n.s_unlock), label: Text(l10n.s_unlock),
icon: const Icon(Icons.lock_open), icon: const Icon(Icons.lock_open),
onPressed: () async { onPressed: () async {

View File

@ -46,7 +46,7 @@ class DeviceErrorScreen extends ConsumerWidget {
), ),
message: l10n.p_elevated_permissions_required, message: l10n.p_elevated_permissions_required,
actions: [ actions: [
ElevatedButton.icon( FilledButton.icon(
label: Text(l10n.s_unlock), label: Text(l10n.s_unlock),
icon: const Icon(Icons.lock_open), icon: const Icon(Icons.lock_open),
onPressed: () async { onPressed: () async {
@ -96,7 +96,7 @@ class DeviceErrorScreen extends ConsumerWidget {
scale: 2, scale: 2,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),
message: l10n.l_place_on_nfc_reader, header: l10n.l_place_on_nfc_reader,
), ),
}, },
); );

View File

@ -61,19 +61,30 @@ class MessagePage extends StatelessWidget {
delayedContent: delayedContent, delayedContent: delayedContent,
builder: (context, _) => Padding( builder: (context, _) => Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 8.0, top: 0.0, right: 8.0, bottom: 96.0), left: 32.0, top: 0.0, right: 32.0, bottom: 96.0),
child: Column( child: SizedBox(
children: [ width: 350,
if (graphic != null) ...[graphic!, const SizedBox(height: 16.0)], child: Column(
if (header != null) children: [
Text(header!, if (graphic != null) ...[
textAlign: TextAlign.center, graphic!,
style: Theme.of(context).textTheme.titleLarge), const SizedBox(height: 16.0)
if (message != null) ...[ ],
const SizedBox(height: 12.0), if (header != null)
Text(message!, textAlign: TextAlign.center), Text(header!,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleLarge),
if (message != null) ...[
const SizedBox(height: 12.0),
Text(message!,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.titleSmall
?.apply(color: Colors.grey)),
],
], ],
], ),
), ),
), ),
); );

View File

@ -207,7 +207,7 @@ class _PinEntryFormState extends ConsumerState<_PinEntryForm> {
dense: true, dense: true,
contentPadding: const EdgeInsets.symmetric(horizontal: 0), contentPadding: const EdgeInsets.symmetric(horizontal: 0),
minLeadingWidth: 0, minLeadingWidth: 0,
trailing: ElevatedButton.icon( trailing: FilledButton.icon(
icon: const Icon(Icons.lock_open), icon: const Icon(Icons.lock_open),
label: Text(l10n.s_unlock), label: Text(l10n.s_unlock),
onPressed: onPressed:

View File

@ -128,7 +128,10 @@ class _ResetDialogState extends ConsumerState<ResetDialog> {
children: [ children: [
Text( Text(
l10n.p_warning_deletes_accounts, l10n.p_warning_deletes_accounts,
style: const TextStyle(fontWeight: FontWeight.bold), style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(fontWeight: FontWeight.w700),
), ),
Text( Text(
l10n.p_warning_disable_accounts, l10n.p_warning_disable_accounts,

View File

@ -171,7 +171,6 @@ class _CodeLabel extends StatelessWidget {
_formatCode(code), _formatCode(code),
style: const TextStyle( style: const TextStyle(
fontFeatures: [FontFeature.tabularFigures()], fontFeatures: [FontFeature.tabularFigures()],
//fontWeight: FontWeight.w400,
), ),
textHeightBehavior: TextHeightBehavior( textHeightBehavior: TextHeightBehavior(
// This helps with vertical centering on desktop // This helps with vertical centering on desktop

View File

@ -92,6 +92,8 @@ class _AccountViewState extends ConsumerState<AccountView> {
); );
final openIntent = OpenIntent<OathCredential>(widget.credential); final openIntent = OpenIntent<OathCredential>(widget.credential);
final buttonStyle = FilledButton.styleFrom(
backgroundColor: Theme.of(context).hoverColor, elevation: 0);
return AppListItem<OathCredential>( return AppListItem<OathCredential>(
credential, credential,
selected: widget.selected, selected: widget.selected,
@ -107,9 +109,11 @@ class _AccountViewState extends ConsumerState<AccountView> {
? FilledButton.tonalIcon( ? FilledButton.tonalIcon(
icon: helper.buildCodeIcon(), icon: helper.buildCodeIcon(),
label: helper.buildCodeLabel(), label: helper.buildCodeLabel(),
style: buttonStyle,
onPressed: Actions.handler(context, openIntent), onPressed: Actions.handler(context, openIntent),
) )
: FilledButton.tonal( : FilledButton.tonal(
style: buttonStyle,
onPressed: Actions.handler(context, openIntent), onPressed: Actions.handler(context, openIntent),
child: helper.buildCodeIcon()), child: helper.buildCodeIcon()),
tapIntent: isDesktop && !widget.expanded ? null : openIntent, tapIntent: isDesktop && !widget.expanded ? null : openIntent,

View File

@ -187,7 +187,7 @@ class _OathAddMultiAccountPageState
) )
] ]
.map((e) => Padding( .map((e) => Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 4.0),
child: e, child: e,
)) ))
.toList(), .toList(),

View File

@ -48,10 +48,11 @@ class ResetDialog extends ConsumerWidget {
padding: const EdgeInsets.symmetric(horizontal: 18.0), padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: Column( child: Column(
children: [ children: [
Text( Text(l10n.p_warning_factory_reset,
l10n.p_warning_factory_reset, style: Theme.of(context)
style: const TextStyle(fontWeight: FontWeight.bold), .textTheme
), .bodyMedium
?.copyWith(fontWeight: FontWeight.w700)),
Text(l10n.p_warning_disable_credentials), Text(l10n.p_warning_disable_credentials),
] ]
.map((e) => Padding( .map((e) => Padding(

View File

@ -133,7 +133,7 @@ class _UnlockFormState extends ConsumerState<UnlockForm> {
}); });
}, },
), ),
ElevatedButton.icon( FilledButton.icon(
key: keys.unlockButton, key: keys.unlockButton,
label: Text(l10n.s_unlock), label: Text(l10n.s_unlock),
icon: const Icon(Icons.lock_open), icon: const Icon(Icons.lock_open),

View File

@ -51,10 +51,11 @@ class ResetDialog extends ConsumerWidget {
padding: const EdgeInsets.symmetric(horizontal: 18.0), padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: Column( child: Column(
children: [ children: [
Text( Text(l10n.p_warning_piv_reset,
l10n.p_warning_piv_reset, style: Theme.of(context)
style: const TextStyle(fontWeight: FontWeight.bold), .textTheme
), .bodyMedium
?.copyWith(fontWeight: FontWeight.w700)),
Text(l10n.p_warning_piv_reset_desc), Text(l10n.p_warning_piv_reset_desc),
] ]
.map((e) => Padding( .map((e) => Padding(

View File

@ -34,25 +34,33 @@ const themeGreen = Color(0xFF78B850);
const themeGrey = Color(0xFF8C8B8C); const themeGrey = Color(0xFF8C8B8C);
*/ */
//const primaryColor = Colors.blueAccent; const primaryColor = Colors.blueAccent;
//const primaryColor = Colors.green; //const primaryColor = Colors.green;
const primaryColor = Colors.deepPurple; //const primaryColor = Colors.deepPurple;
const defaultTextTheme = Typography.englishLike2021;
class AppTheme { class AppTheme {
static ThemeData get lightTheme => ThemeData( static ThemeData get lightTheme => ThemeData(
useMaterial3: true, useMaterial3: true,
colorScheme: ColorScheme.fromSeed( colorScheme: ColorScheme.fromSeed(
seedColor: primaryColor,
brightness: Brightness.light, brightness: Brightness.light,
seedColor: primaryColor,
background: const Color(0xfffefdf4), background: const Color(0xfffefdf4),
surface: const Color(0xfffefdf4),
),
listTileTheme: const ListTileThemeData(
// For alignment under menu button
contentPadding: EdgeInsets.symmetric(horizontal: 18.0),
visualDensity: VisualDensity.compact,
), ),
fontFamily: 'Roboto', fontFamily: 'Roboto',
appBarTheme: const AppBarTheme(
color: Colors.transparent,
),
listTileTheme: ListTileThemeData(
// For alignment under menu button
contentPadding: const EdgeInsets.symmetric(horizontal: 18.0),
visualDensity: VisualDensity.compact,
titleTextStyle: defaultTextTheme.bodyLarge!
.copyWith(color: Colors.black87, fontFamily: 'Roboto'),
subtitleTextStyle: defaultTextTheme.bodyMedium!
.copyWith(color: Colors.black54, fontFamily: 'Roboto'),
),
tooltipTheme: const TooltipThemeData( tooltipTheme: const TooltipThemeData(
waitDuration: Duration(milliseconds: 500), waitDuration: Duration(milliseconds: 500),
textStyle: TextStyle(color: Color(0xff3c3c3c)), textStyle: TextStyle(color: Color(0xff3c3c3c)),
@ -66,17 +74,23 @@ class AppTheme {
static ThemeData get darkTheme => ThemeData( static ThemeData get darkTheme => ThemeData(
useMaterial3: true, useMaterial3: true,
colorScheme: ColorScheme.fromSeed( colorScheme: ColorScheme.fromSeed(
seedColor: primaryColor,
brightness: Brightness.dark, brightness: Brightness.dark,
seedColor: primaryColor,
background: const Color(0xff282828), background: const Color(0xff282828),
surface: const Color(0xff282828),
),
listTileTheme: const ListTileThemeData(
// For alignment under menu button
contentPadding: EdgeInsets.symmetric(horizontal: 18.0),
visualDensity: VisualDensity.compact,
), ),
fontFamily: 'Roboto', fontFamily: 'Roboto',
appBarTheme: const AppBarTheme(
color: Colors.transparent,
),
listTileTheme: ListTileThemeData(
// For alignment under menu button
contentPadding: const EdgeInsets.symmetric(horizontal: 18.0),
visualDensity: VisualDensity.compact,
titleTextStyle: defaultTextTheme.bodyLarge!
.copyWith(color: Colors.white, fontFamily: 'Roboto'),
subtitleTextStyle: defaultTextTheme.bodyMedium!
.copyWith(color: Colors.white54, fontFamily: 'Roboto'),
),
tooltipTheme: const TooltipThemeData( tooltipTheme: const TooltipThemeData(
waitDuration: Duration(milliseconds: 500), waitDuration: Duration(milliseconds: 500),
textStyle: TextStyle(color: Color(0xffE2E2E6)), textStyle: TextStyle(color: Color(0xffE2E2E6)),

View File

@ -80,7 +80,6 @@ class _ResponsiveDialogState extends State<ResponsiveDialog> {
title: widget.title, title: widget.title,
titlePadding: const EdgeInsets.only(top: 24, left: 18, right: 18), titlePadding: const EdgeInsets.only(top: 24, left: 18, right: 18),
scrollable: true, scrollable: true,
backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0.9),
contentPadding: const EdgeInsets.symmetric(vertical: 8), contentPadding: const EdgeInsets.symmetric(vertical: 8),
content: SizedBox( content: SizedBox(
width: 600, width: 600,

View File

@ -151,3 +151,5 @@ flutter:
weight: 300 weight: 300
- asset: assets/fonts/Roboto-Thin.ttf - asset: assets/fonts/Roboto-Thin.ttf
weight: 100 weight: 100
- asset: assets/fonts/Roboto-Bold.ttf
weight: 700