From 55740e62ac37efeadabf51f8f09cebf6a6acc0c0 Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Wed, 3 Jul 2024 14:38:48 +0200 Subject: [PATCH] Fix deprecated use of background color --- lib/app/views/app_page.dart | 4 ++-- lib/app/views/fs_dialog.dart | 3 +-- lib/oath/views/account_view.dart | 2 +- lib/theme.dart | 13 ++----------- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/lib/app/views/app_page.dart b/lib/app/views/app_page.dart index fed94f73..ffc44778 100755 --- a/lib/app/views/app_page.dart +++ b/lib/app/views/app_page.dart @@ -448,7 +448,7 @@ class _AppPageState extends ConsumerState { pinned: true, delegate: _SliverTitleDelegate( child: ColoredBox( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, child: Padding( key: _sliverTitleWrapperGlobalKey, padding: const EdgeInsets.only( @@ -622,7 +622,7 @@ class _AppPageState extends ConsumerState { ), scrolledUnderElevation: 0.0, leadingWidth: hasRail ? 84 : null, - backgroundColor: Theme.of(context).colorScheme.background, + backgroundColor: Theme.of(context).colorScheme.surface, title: _buildAppBarTitle( context, hasRail, diff --git a/lib/app/views/fs_dialog.dart b/lib/app/views/fs_dialog.dart index 7d3f6d89..e601a5b8 100644 --- a/lib/app/views/fs_dialog.dart +++ b/lib/app/views/fs_dialog.dart @@ -28,8 +28,7 @@ class FsDialog extends StatelessWidget { Widget build(BuildContext context) { final l10n = AppLocalizations.of(context)!; return Dialog.fullscreen( - backgroundColor: - Theme.of(context).colorScheme.background.withOpacity(0.7), + backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0.7), child: SafeArea( child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/oath/views/account_view.dart b/lib/oath/views/account_view.dart index ce505de6..5a320656 100755 --- a/lib/oath/views/account_view.dart +++ b/lib/oath/views/account_view.dart @@ -80,7 +80,7 @@ class _AccountViewState extends ConsumerState { final helper = AccountHelper(context, ref, credential); final subtitle = helper.subtitle; final circleAvatar = CircleAvatar( - foregroundColor: Theme.of(context).colorScheme.background, + foregroundColor: Theme.of(context).colorScheme.surface, backgroundColor: _iconColor(400), child: Text( (credential.issuer ?? credential.name).characters.first.toUpperCase(), diff --git a/lib/theme.dart b/lib/theme.dart index 80316b1a..d929fa31 100755 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -30,7 +30,7 @@ class AppTheme { Brightness.dark => ColorScheme.fromSeed( seedColor: primaryColor, brightness: brightness, - background: const Color(0xff282828), + surface: const Color(0xff282828), onSurface: const Color(0xeeffffff), onSurfaceVariant: const Color(0xaaffffff), ), @@ -78,6 +78,7 @@ class AppTheme { useMaterial3: true, colorScheme: colorScheme, fontFamily: 'Roboto', + scaffoldBackgroundColor: colorScheme.surface, appBarTheme: const AppBarTheme( color: Colors.transparent, ), @@ -102,13 +103,3 @@ class AppTheme { ); } } - -/* TODO: Remove this. It is left here as a reference as we adjust styles to work with Flutter 3.7. -/// This fixes the issue with FilterChip resizing vertically on toggle. -BorderSide? _chipBorder(Color color) => - MaterialStateBorderSide.resolveWith((states) => BorderSide( - width: 1, - color: states.contains(MaterialState.selected) - ? Colors.transparent - : color)); -*/