@@ -138,7 +138,7 @@ class BottomNavigationBar extends StatefulWidget {
138
138
///
139
139
/// If [selectedLabelStyle] .color and [unselectedLabelStyle] .color values
140
140
/// are non-null, they will be used instead of [selectedItemColor] and
141
- /// [unselectedItemColor] to style the label color .
141
+ /// [unselectedItemColor] .
142
142
///
143
143
/// If custom [IconThemeData] s are used, you must provide both
144
144
/// [selectedIconTheme] and [unselectedIconTheme] , and both
@@ -384,7 +384,7 @@ class _BottomNavigationTile extends StatelessWidget {
384
384
this .animation,
385
385
this .iconSize, {
386
386
this .onTap,
387
- this .itemColorTween ,
387
+ this .colorTween ,
388
388
this .flex,
389
389
this .selected = false ,
390
390
required this .selectedLabelStyle,
@@ -410,7 +410,7 @@ class _BottomNavigationTile extends StatelessWidget {
410
410
final Animation <double > animation;
411
411
final double iconSize;
412
412
final VoidCallback ? onTap;
413
- final ColorTween ? itemColorTween ;
413
+ final ColorTween ? colorTween ;
414
414
final double ? flex;
415
415
final bool selected;
416
416
final IconThemeData ? selectedIconTheme;
@@ -513,7 +513,7 @@ class _BottomNavigationTile extends StatelessWidget {
513
513
child: _Tile (
514
514
layout: layout,
515
515
icon: _TileIcon (
516
- itemColorTween : itemColorTween ! ,
516
+ colorTween : colorTween ! ,
517
517
animation: animation,
518
518
iconSize: iconSize,
519
519
selected: selected,
@@ -522,7 +522,7 @@ class _BottomNavigationTile extends StatelessWidget {
522
522
unselectedIconTheme: unselectedIconTheme,
523
523
),
524
524
label: _Label (
525
- itemColorTween : itemColorTween ! ,
525
+ colorTween : colorTween ! ,
526
526
animation: animation,
527
527
item: item,
528
528
selectedLabelStyle: selectedLabelStyle,
@@ -602,7 +602,7 @@ class _Tile extends StatelessWidget {
602
602
603
603
class _TileIcon extends StatelessWidget {
604
604
const _TileIcon ({
605
- required this .itemColorTween ,
605
+ required this .colorTween ,
606
606
required this .animation,
607
607
required this .iconSize,
608
608
required this .selected,
@@ -612,7 +612,7 @@ class _TileIcon extends StatelessWidget {
612
612
}) : assert (selected != null ),
613
613
assert (item != null );
614
614
615
- final ColorTween itemColorTween ;
615
+ final ColorTween colorTween ;
616
616
final Animation <double > animation;
617
617
final double iconSize;
618
618
final bool selected;
@@ -622,7 +622,7 @@ class _TileIcon extends StatelessWidget {
622
622
623
623
@override
624
624
Widget build (BuildContext context) {
625
- final Color ? iconColor = itemColorTween .evaluate (animation);
625
+ final Color ? iconColor = colorTween .evaluate (animation);
626
626
final IconThemeData defaultIconTheme = IconThemeData (
627
627
color: iconColor,
628
628
size: iconSize,
@@ -646,22 +646,22 @@ class _TileIcon extends StatelessWidget {
646
646
647
647
class _Label extends StatelessWidget {
648
648
const _Label ({
649
- required this .itemColorTween ,
649
+ required this .colorTween ,
650
650
required this .animation,
651
651
required this .item,
652
652
required this .selectedLabelStyle,
653
653
required this .unselectedLabelStyle,
654
654
required this .showSelectedLabels,
655
655
required this .showUnselectedLabels,
656
- }) : assert (itemColorTween != null ),
656
+ }) : assert (colorTween != null ),
657
657
assert (animation != null ),
658
658
assert (item != null ),
659
659
assert (selectedLabelStyle != null ),
660
660
assert (unselectedLabelStyle != null ),
661
661
assert (showSelectedLabels != null ),
662
662
assert (showUnselectedLabels != null );
663
663
664
- final ColorTween itemColorTween ;
664
+ final ColorTween colorTween ;
665
665
final Animation <double > animation;
666
666
final BottomNavigationBarItem item;
667
667
final TextStyle selectedLabelStyle;
@@ -679,16 +679,10 @@ class _Label extends StatelessWidget {
679
679
selectedLabelStyle,
680
680
animation.value,
681
681
)! ;
682
- final ColorTween labelColor = ColorTween (
683
- begin: unselectedLabelStyle.color
684
- ?? itemColorTween.begin,
685
- end: selectedLabelStyle.color
686
- ?? itemColorTween.end,
687
- );
688
682
Widget text = DefaultTextStyle .merge (
689
683
style: customStyle.copyWith (
690
684
fontSize: selectedFontSize,
691
- color: labelColor .evaluate (animation),
685
+ color: colorTween .evaluate (animation),
692
686
),
693
687
// The font size should grow here when active, but because of the way
694
688
// font rendering works, it doesn't grow smoothly if we just animate
@@ -929,10 +923,10 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
929
923
break ;
930
924
}
931
925
932
- final ColorTween itemColorTween ;
926
+ final ColorTween colorTween ;
933
927
switch (_effectiveType) {
934
928
case BottomNavigationBarType .fixed:
935
- itemColorTween = ColorTween (
929
+ colorTween = ColorTween (
936
930
begin: widget.unselectedItemColor
937
931
?? bottomTheme.unselectedItemColor
938
932
?? themeData.unselectedWidgetColor,
@@ -943,7 +937,7 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
943
937
);
944
938
break ;
945
939
case BottomNavigationBarType .shifting:
946
- itemColorTween = ColorTween (
940
+ colorTween = ColorTween (
947
941
begin: widget.unselectedItemColor
948
942
?? bottomTheme.unselectedItemColor
949
943
?? themeData.colorScheme.surface,
@@ -977,7 +971,7 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
977
971
onTap: () {
978
972
widget.onTap? .call (i);
979
973
},
980
- itemColorTween : itemColorTween ,
974
+ colorTween : colorTween ,
981
975
flex: _evaluateFlex (_animations[i]),
982
976
selected: i == widget.currentIndex,
983
977
showSelectedLabels: widget.showSelectedLabels ?? bottomTheme.showSelectedLabels ?? true ,
0 commit comments