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
|
/// * [BottomNavigationBarType.fixed], the default when there are less than
|
||||||
/// four [items]. The selected item is rendered with the
|
/// four [items]. The selected item is rendered with the
|
||||||
/// [selectedItemColor] if it's non-null, otherwise the theme's
|
/// [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
|
/// navigation bar's background color defaults to the [Material] background
|
||||||
/// color, [ThemeData.canvasColor] (essentially opaque white).
|
/// color, [ThemeData.canvasColor] (essentially opaque white).
|
||||||
/// * [BottomNavigationBarType.shifting], the default when there are four
|
/// * [BottomNavigationBarType.shifting], the default when there are four
|
||||||
@ -939,10 +941,10 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
|
|||||||
final Color themeColor;
|
final Color themeColor;
|
||||||
switch (themeData.brightness) {
|
switch (themeData.brightness) {
|
||||||
case Brightness.light:
|
case Brightness.light:
|
||||||
themeColor = themeData.primaryColor;
|
themeColor = themeData.colorScheme.primary;
|
||||||
break;
|
break;
|
||||||
case Brightness.dark:
|
case Brightness.dark:
|
||||||
themeColor = themeData.accentColor;
|
themeColor = themeData.colorScheme.secondary;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,8 +76,8 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData.light().copyWith(
|
||||||
primaryColor: primaryColor,
|
colorScheme: const ColorScheme.light().copyWith(primary: primaryColor),
|
||||||
unselectedWidgetColor: unselectedWidgetColor,
|
unselectedWidgetColor: unselectedWidgetColor,
|
||||||
),
|
),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user