mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-25 14:04:55 +03:00
Merge #1338.
This commit is contained in:
commit
9793af6405
BIN
assets/fonts/Roboto-Bold.ttf
Normal file
BIN
assets/fonts/Roboto-Bold.ttf
Normal file
Binary file not shown.
@ -32,7 +32,7 @@ Future<T?> showBlurDialog<T>({
|
||||
required BuildContext context,
|
||||
required Widget Function(BuildContext) builder,
|
||||
RouteSettings? routeSettings,
|
||||
Color barrierColor = const Color(0x80000000),
|
||||
Color barrierColor = const Color(0x00cccccc),
|
||||
}) async =>
|
||||
await showGeneralDialog<T>(
|
||||
context: context,
|
||||
|
@ -63,7 +63,7 @@ class AppFailurePage extends ConsumerWidget {
|
||||
header = null;
|
||||
message = l10n.p_webauthn_elevated_permissions_required;
|
||||
actions = [
|
||||
ElevatedButton.icon(
|
||||
FilledButton.icon(
|
||||
label: Text(l10n.s_unlock),
|
||||
icon: const Icon(Icons.lock_open),
|
||||
onPressed: () async {
|
||||
|
@ -46,7 +46,7 @@ class DeviceErrorScreen extends ConsumerWidget {
|
||||
),
|
||||
message: l10n.p_elevated_permissions_required,
|
||||
actions: [
|
||||
ElevatedButton.icon(
|
||||
FilledButton.icon(
|
||||
label: Text(l10n.s_unlock),
|
||||
icon: const Icon(Icons.lock_open),
|
||||
onPressed: () async {
|
||||
@ -96,7 +96,7 @@ class DeviceErrorScreen extends ConsumerWidget {
|
||||
scale: 2,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
message: l10n.l_place_on_nfc_reader,
|
||||
header: l10n.l_place_on_nfc_reader,
|
||||
),
|
||||
},
|
||||
);
|
||||
|
@ -61,19 +61,30 @@ class MessagePage extends StatelessWidget {
|
||||
delayedContent: delayedContent,
|
||||
builder: (context, _) => Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 8.0, top: 0.0, right: 8.0, bottom: 96.0),
|
||||
child: Column(
|
||||
children: [
|
||||
if (graphic != null) ...[graphic!, const SizedBox(height: 16.0)],
|
||||
if (header != null)
|
||||
Text(header!,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleLarge),
|
||||
if (message != null) ...[
|
||||
const SizedBox(height: 12.0),
|
||||
Text(message!, textAlign: TextAlign.center),
|
||||
left: 32.0, top: 0.0, right: 32.0, bottom: 96.0),
|
||||
child: SizedBox(
|
||||
width: 350,
|
||||
child: Column(
|
||||
children: [
|
||||
if (graphic != null) ...[
|
||||
graphic!,
|
||||
const SizedBox(height: 16.0)
|
||||
],
|
||||
if (header != null)
|
||||
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)),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -207,7 +207,7 @@ class _PinEntryFormState extends ConsumerState<_PinEntryForm> {
|
||||
dense: true,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 0),
|
||||
minLeadingWidth: 0,
|
||||
trailing: ElevatedButton.icon(
|
||||
trailing: FilledButton.icon(
|
||||
icon: const Icon(Icons.lock_open),
|
||||
label: Text(l10n.s_unlock),
|
||||
onPressed:
|
||||
|
@ -128,7 +128,10 @@ class _ResetDialogState extends ConsumerState<ResetDialog> {
|
||||
children: [
|
||||
Text(
|
||||
l10n.p_warning_deletes_accounts,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.copyWith(fontWeight: FontWeight.w700),
|
||||
),
|
||||
Text(
|
||||
l10n.p_warning_disable_accounts,
|
||||
|
@ -171,7 +171,6 @@ class _CodeLabel extends StatelessWidget {
|
||||
_formatCode(code),
|
||||
style: const TextStyle(
|
||||
fontFeatures: [FontFeature.tabularFigures()],
|
||||
//fontWeight: FontWeight.w400,
|
||||
),
|
||||
textHeightBehavior: TextHeightBehavior(
|
||||
// This helps with vertical centering on desktop
|
||||
|
@ -92,6 +92,8 @@ class _AccountViewState extends ConsumerState<AccountView> {
|
||||
);
|
||||
|
||||
final openIntent = OpenIntent<OathCredential>(widget.credential);
|
||||
final buttonStyle = FilledButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).hoverColor, elevation: 0);
|
||||
return AppListItem<OathCredential>(
|
||||
credential,
|
||||
selected: widget.selected,
|
||||
@ -107,9 +109,11 @@ class _AccountViewState extends ConsumerState<AccountView> {
|
||||
? FilledButton.tonalIcon(
|
||||
icon: helper.buildCodeIcon(),
|
||||
label: helper.buildCodeLabel(),
|
||||
style: buttonStyle,
|
||||
onPressed: Actions.handler(context, openIntent),
|
||||
)
|
||||
: FilledButton.tonal(
|
||||
style: buttonStyle,
|
||||
onPressed: Actions.handler(context, openIntent),
|
||||
child: helper.buildCodeIcon()),
|
||||
tapIntent: isDesktop && !widget.expanded ? null : openIntent,
|
||||
|
@ -187,7 +187,7 @@ class _OathAddMultiAccountPageState
|
||||
)
|
||||
]
|
||||
.map((e) => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: e,
|
||||
))
|
||||
.toList(),
|
||||
|
@ -48,10 +48,11 @@ class ResetDialog extends ConsumerWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 18.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
l10n.p_warning_factory_reset,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(l10n.p_warning_factory_reset,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.copyWith(fontWeight: FontWeight.w700)),
|
||||
Text(l10n.p_warning_disable_credentials),
|
||||
]
|
||||
.map((e) => Padding(
|
||||
|
@ -133,7 +133,7 @@ class _UnlockFormState extends ConsumerState<UnlockForm> {
|
||||
});
|
||||
},
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
FilledButton.icon(
|
||||
key: keys.unlockButton,
|
||||
label: Text(l10n.s_unlock),
|
||||
icon: const Icon(Icons.lock_open),
|
||||
|
@ -51,10 +51,11 @@ class ResetDialog extends ConsumerWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 18.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
l10n.p_warning_piv_reset,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(l10n.p_warning_piv_reset,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.copyWith(fontWeight: FontWeight.w700)),
|
||||
Text(l10n.p_warning_piv_reset_desc),
|
||||
]
|
||||
.map((e) => Padding(
|
||||
|
@ -34,25 +34,33 @@ const themeGreen = Color(0xFF78B850);
|
||||
const themeGrey = Color(0xFF8C8B8C);
|
||||
*/
|
||||
|
||||
//const primaryColor = Colors.blueAccent;
|
||||
const primaryColor = Colors.blueAccent;
|
||||
//const primaryColor = Colors.green;
|
||||
const primaryColor = Colors.deepPurple;
|
||||
//const primaryColor = Colors.deepPurple;
|
||||
|
||||
const defaultTextTheme = Typography.englishLike2021;
|
||||
|
||||
class AppTheme {
|
||||
static ThemeData get lightTheme => ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: primaryColor,
|
||||
brightness: Brightness.light,
|
||||
seedColor: primaryColor,
|
||||
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',
|
||||
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(
|
||||
waitDuration: Duration(milliseconds: 500),
|
||||
textStyle: TextStyle(color: Color(0xff3c3c3c)),
|
||||
@ -66,17 +74,23 @@ class AppTheme {
|
||||
static ThemeData get darkTheme => ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: primaryColor,
|
||||
brightness: Brightness.dark,
|
||||
seedColor: primaryColor,
|
||||
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',
|
||||
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(
|
||||
waitDuration: Duration(milliseconds: 500),
|
||||
textStyle: TextStyle(color: Color(0xffE2E2E6)),
|
||||
|
@ -80,7 +80,6 @@ class _ResponsiveDialogState extends State<ResponsiveDialog> {
|
||||
title: widget.title,
|
||||
titlePadding: const EdgeInsets.only(top: 24, left: 18, right: 18),
|
||||
scrollable: true,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0.9),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 8),
|
||||
content: SizedBox(
|
||||
width: 600,
|
||||
|
@ -151,3 +151,5 @@ flutter:
|
||||
weight: 300
|
||||
- asset: assets/fonts/Roboto-Thin.ttf
|
||||
weight: 100
|
||||
- asset: assets/fonts/Roboto-Bold.ttf
|
||||
weight: 700
|
||||
|
Loading…
Reference in New Issue
Block a user