Fix deprecated use of background color

This commit is contained in:
Dain Nilsson 2024-07-03 14:38:48 +02:00
parent 3d1345577f
commit 55740e62ac
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
4 changed files with 6 additions and 16 deletions

View File

@ -448,7 +448,7 @@ class _AppPageState extends ConsumerState<AppPage> {
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<AppPage> {
),
scrolledUnderElevation: 0.0,
leadingWidth: hasRail ? 84 : null,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).colorScheme.surface,
title: _buildAppBarTitle(
context,
hasRail,

View File

@ -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,

View File

@ -80,7 +80,7 @@ class _AccountViewState extends ConsumerState<AccountView> {
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(),

View File

@ -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));
*/