diff --git a/lib/theme.dart b/lib/theme.dart index a846896d..aa8ce3be 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -27,23 +27,13 @@ class AppTheme extends StatelessWidget { final theme = Theme.of(context); if (theme.brightness == Brightness.light) { return theme.appBarTheme.copyWith( - brightness: Brightness.dark, - color: Colors.grey[800], - actionsIconTheme: theme.primaryIconTheme - .copyWith(color: Colors.white.withOpacity(.87)), - iconTheme: theme.primaryIconTheme - .copyWith(color: Colors.white.withOpacity(.87)), - textTheme: theme.primaryTextTheme - .apply(bodyColor: Colors.white.withOpacity(.87)), + backgroundColor: Colors.grey[800], + foregroundColor: Colors.white.withOpacity(.87), ); } else { return theme.appBarTheme.copyWith( - brightness: Brightness.dark, - color: Colors.grey[200], - actionsIconTheme: - theme.primaryIconTheme.copyWith(color: Colors.black87), - iconTheme: theme.primaryIconTheme.copyWith(color: Colors.black87), - textTheme: theme.primaryTextTheme.apply(bodyColor: Colors.black87), + backgroundColor: Colors.grey[200], + foregroundColor: Colors.black87, ); } } @@ -98,11 +88,8 @@ class AppTheme extends StatelessWidget { static ThemeData _buildLightThemeData(BuildContext context, ThemeData theme) { final appBarTheme = theme.appBarTheme.copyWith( - brightness: Brightness.dark, - color: theme.scaffoldBackgroundColor, - actionsIconTheme: theme.primaryIconTheme.copyWith(color: Colors.black87), - iconTheme: theme.primaryIconTheme.copyWith(color: Colors.black87), - textTheme: theme.primaryTextTheme.apply(bodyColor: Colors.black87), + backgroundColor: theme.scaffoldBackgroundColor, + foregroundColor: theme.colorScheme.onSurface, ); return theme.copyWith(appBarTheme: appBarTheme); } @@ -121,14 +108,8 @@ class AppTheme extends StatelessWidget { } final appBarTheme = theme.appBarTheme.copyWith( - brightness: Brightness.dark, - color: background, - actionsIconTheme: - theme.primaryIconTheme.copyWith(color: Colors.white.withOpacity(.87)), - iconTheme: - theme.primaryIconTheme.copyWith(color: Colors.white.withOpacity(.87)), - textTheme: theme.primaryTextTheme - .apply(bodyColor: Colors.white.withOpacity(.87)), + backgroundColor: background, + foregroundColor: theme.colorScheme.onSurface, ); final bottomNavigationBarTheme = theme.bottomNavigationBarTheme.copyWith( backgroundColor: background, diff --git a/lib/widget/slideshow_viewer.dart b/lib/widget/slideshow_viewer.dart index fa714751..389169b5 100644 --- a/lib/widget/slideshow_viewer.dart +++ b/lib/widget/slideshow_viewer.dart @@ -152,13 +152,7 @@ class _SlideshowViewerState extends State AppBar( backgroundColor: Colors.transparent, shadowColor: Colors.transparent, - brightness: Brightness.dark, - iconTheme: Theme.of(context).iconTheme.copyWith( - color: Colors.white.withOpacity(.87), - ), - actionsIconTheme: Theme.of(context).iconTheme.copyWith( - color: Colors.white.withOpacity(.87), - ), + foregroundColor: Colors.white.withOpacity(.87), leading: IconButton( icon: const Icon(Icons.close), tooltip: MaterialLocalizations.of(context).closeButtonTooltip, diff --git a/lib/widget/trashbin_viewer.dart b/lib/widget/trashbin_viewer.dart index 5ee55cfd..37c79d37 100644 --- a/lib/widget/trashbin_viewer.dart +++ b/lib/widget/trashbin_viewer.dart @@ -120,13 +120,7 @@ class _TrashbinViewerState extends State { AppBar( backgroundColor: Colors.transparent, shadowColor: Colors.transparent, - brightness: Brightness.dark, - iconTheme: Theme.of(context).iconTheme.copyWith( - color: Colors.white.withOpacity(.87), - ), - actionsIconTheme: Theme.of(context).iconTheme.copyWith( - color: Colors.white.withOpacity(.87), - ), + foregroundColor: Colors.white.withOpacity(.87), actions: [ IconButton( icon: const Icon(Icons.restore_outlined), diff --git a/lib/widget/viewer.dart b/lib/widget/viewer.dart index 791e76a3..74c1731d 100644 --- a/lib/widget/viewer.dart +++ b/lib/widget/viewer.dart @@ -156,13 +156,7 @@ class _ViewerState extends State AppBar( backgroundColor: Colors.transparent, shadowColor: Colors.transparent, - brightness: Brightness.dark, - iconTheme: Theme.of(context).iconTheme.copyWith( - color: Colors.white.withOpacity(.87), - ), - actionsIconTheme: Theme.of(context).iconTheme.copyWith( - color: Colors.white.withOpacity(.87), - ), + foregroundColor: Colors.white.withOpacity(.87), actions: [ if (!_isDetailPaneActive && _canOpenDetailPane()) IconButton(