mirror of
https://github.com/flutter/flutter
synced 2024-10-13 03:32:55 +00:00
Removed BottomNavigationBar accentColor dependency (#76810)
This commit is contained in:
parent
b300efcd8f
commit
f835839f6b
|
@ -57,7 +57,9 @@ enum BottomNavigationBarType {
|
|||
/// * [BottomNavigationBarType.fixed], the default when there are less than
|
||||
/// four [items]. The selected item is rendered with the
|
||||
/// [selectedItemColor] if it's non-null, otherwise the theme's
|
||||
/// [ThemeData.primaryColor] is used. If [backgroundColor] is null, The
|
||||
/// [ColorScheme.primary] color is used for [Brightness.light] themes
|
||||
/// and [ColorScheme.secondary] for [Brightness.dark] themes.
|
||||
/// If [backgroundColor] is null, The
|
||||
/// navigation bar's background color defaults to the [Material] background
|
||||
/// color, [ThemeData.canvasColor] (essentially opaque white).
|
||||
/// * [BottomNavigationBarType.shifting], the default when there are four
|
||||
|
@ -939,10 +941,10 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
|
|||
final Color themeColor;
|
||||
switch (themeData.brightness) {
|
||||
case Brightness.light:
|
||||
themeColor = themeData.primaryColor;
|
||||
themeColor = themeData.colorScheme.primary;
|
||||
break;
|
||||
case Brightness.dark:
|
||||
themeColor = themeData.accentColor;
|
||||
themeColor = themeData.colorScheme.secondary;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,8 +76,8 @@ void main() {
|
|||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeData(
|
||||
primaryColor: primaryColor,
|
||||
theme: ThemeData.light().copyWith(
|
||||
colorScheme: const ColorScheme.light().copyWith(primary: primaryColor),
|
||||
unselectedWidgetColor: unselectedWidgetColor,
|
||||
),
|
||||
home: Scaffold(
|
||||
|
|
Loading…
Reference in a new issue