Brightness is no longer used by flutter 2.5

This commit is contained in:
Ming Ming 2021-09-15 18:39:43 +08:00
parent 06023228b8
commit bc9b2a4c78
4 changed files with 11 additions and 48 deletions

View file

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

View file

@ -152,13 +152,7 @@ class _SlideshowViewerState extends State<SlideshowViewer>
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,

View file

@ -120,13 +120,7 @@ class _TrashbinViewerState extends State<TrashbinViewer> {
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),

View file

@ -156,13 +156,7 @@ class _ViewerState extends State<Viewer>
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(