mirror of
https://github.com/flutter/flutter
synced 2024-10-14 04:02:56 +00:00
Changed BottomNavigationBar to handle dark theme. (#6006)
Changed the fixed type to better support the dark theme.
This commit is contained in:
parent
6a5e658131
commit
2dc26ba986
|
@ -17,6 +17,7 @@ import 'icon_theme_data.dart';
|
|||
import 'ink_well.dart';
|
||||
import 'material.dart';
|
||||
import 'theme.dart';
|
||||
import 'typography.dart';
|
||||
|
||||
const double _kActiveMaxWidth = 168.0;
|
||||
const double _kInactiveMaxWidth = 96.0;
|
||||
|
@ -302,9 +303,13 @@ class BottomNavigationBarState extends State<BottomNavigationBar> {
|
|||
case BottomNavigationBarType.fixed:
|
||||
final List<Widget> children = <Widget>[];
|
||||
final ThemeData themeData = Theme.of(context);
|
||||
final TextTheme textTheme = themeData.textTheme;
|
||||
final ColorTween colorTween = new ColorTween(
|
||||
begin: Colors.black54,
|
||||
end: config.fixedColor ?? themeData.primaryColor
|
||||
begin: textTheme.caption.color,
|
||||
end: config.fixedColor ?? (
|
||||
themeData.brightness == Brightness.light ?
|
||||
themeData.primaryColor : themeData.accentColor
|
||||
)
|
||||
);
|
||||
|
||||
for (int i = 0; i < config.labels.length; i += 1) {
|
||||
|
|
Loading…
Reference in a new issue