@@ -263,8 +263,8 @@ void main() {
263263 expect (_getMaterial (tester).surfaceTintColor, null );
264264 expect (_getMaterial (tester).elevation, 0 );
265265 expect (tester.getSize (find.byType (NavigationBar )).height, 80 );
266- expect (_indicator (tester)? .color, const Color (0x3d2196f3 ));
267- expect (_indicator (tester)? .shape, RoundedRectangleBorder (borderRadius: BorderRadius .circular (16 )));
266+ expect (_getIndicatorDecoration (tester)? .color, const Color (0x3d2196f3 ));
267+ expect (_getIndicatorDecoration (tester)? .shape, RoundedRectangleBorder (borderRadius: BorderRadius .circular (16 )));
268268
269269 // M3 settings from the token database.
270270 await tester.pumpWidget (
@@ -292,8 +292,8 @@ void main() {
292292 expect (_getMaterial (tester).surfaceTintColor, ThemeData ().colorScheme.surfaceTint);
293293 expect (_getMaterial (tester).elevation, 3 );
294294 expect (tester.getSize (find.byType (NavigationBar )).height, 80 );
295- expect (_indicator (tester)? .color, const Color (0xff2196f3 ));
296- expect (_indicator (tester)? .shape, const StadiumBorder ());
295+ expect (_getIndicatorDecoration (tester)? .color, const Color (0xff2196f3 ));
296+ expect (_getIndicatorDecoration (tester)? .shape, const StadiumBorder ());
297297 });
298298
299299 testWidgets ('NavigationBar shows tooltips with text scaling ' , (WidgetTester tester) async {
@@ -807,21 +807,21 @@ void main() {
807807 testWidgets ('Navigation destination updates indicator color and shape' , (WidgetTester tester) async {
808808 final ThemeData theme = ThemeData (useMaterial3: true );
809809 const Color color = Color (0xff0000ff );
810- const ShapeBorder shape = CircleBorder ();
810+ const ShapeBorder shape = RoundedRectangleBorder ();
811811
812- Widget buildNaviagationBar ({Color ? indicatorColor, ShapeBorder ? indicatorShape}) {
812+ Widget buildNavigationBar ({Color ? indicatorColor, ShapeBorder ? indicatorShape}) {
813813 return MaterialApp (
814814 theme: theme,
815815 home: Scaffold (
816816 bottomNavigationBar: NavigationBar (
817- destinations: < Widget > [
817+ indicatorColor: indicatorColor,
818+ indicatorShape: indicatorShape,
819+ destinations: const < Widget > [
818820 NavigationDestination (
819- icon: const Icon (Icons .ac_unit),
821+ icon: Icon (Icons .ac_unit),
820822 label: 'AC' ,
821- indicatorColor: indicatorColor,
822- indicatorShape: indicatorShape,
823823 ),
824- const NavigationDestination (
824+ NavigationDestination (
825825 icon: Icon (Icons .access_alarm),
826826 label: 'Alarm' ,
827827 ),
@@ -832,17 +832,17 @@ void main() {
832832 );
833833 }
834834
835- await tester.pumpWidget (buildNaviagationBar ());
835+ await tester.pumpWidget (buildNavigationBar ());
836836
837837 // Test default indicator color and shape.
838- expect (_indicator (tester)? .color, theme.colorScheme.secondaryContainer);
839- expect (_indicator (tester)? .shape, const StadiumBorder ());
838+ expect (_getIndicatorDecoration (tester)? .color, theme.colorScheme.secondaryContainer);
839+ expect (_getIndicatorDecoration (tester)? .shape, const StadiumBorder ());
840840
841- await tester.pumpWidget (buildNaviagationBar (indicatorColor: color, indicatorShape: shape));
841+ await tester.pumpWidget (buildNavigationBar (indicatorColor: color, indicatorShape: shape));
842842
843843 // Test custom indicator color and shape.
844- expect (_indicator (tester)? .color, color);
845- expect (_indicator (tester)? .shape, shape);
844+ expect (_getIndicatorDecoration (tester)? .color, color);
845+ expect (_getIndicatorDecoration (tester)? .shape, shape);
846846 });
847847
848848 group ('Material 2' , () {
@@ -852,21 +852,21 @@ void main() {
852852 testWidgets ('Navigation destination updates indicator color and shape' , (WidgetTester tester) async {
853853 final ThemeData theme = ThemeData (useMaterial3: false );
854854 const Color color = Color (0xff0000ff );
855- const ShapeBorder shape = CircleBorder ();
855+ const ShapeBorder shape = RoundedRectangleBorder ();
856856
857- Widget buildNaviagationBar ({Color ? indicatorColor, ShapeBorder ? indicatorShape}) {
857+ Widget buildNavigationBar ({Color ? indicatorColor, ShapeBorder ? indicatorShape}) {
858858 return MaterialApp (
859859 theme: theme,
860860 home: Scaffold (
861861 bottomNavigationBar: NavigationBar (
862- destinations: < Widget > [
862+ indicatorColor: indicatorColor,
863+ indicatorShape: indicatorShape,
864+ destinations: const < Widget > [
863865 NavigationDestination (
864- icon: const Icon (Icons .ac_unit),
866+ icon: Icon (Icons .ac_unit),
865867 label: 'AC' ,
866- indicatorColor: indicatorColor,
867- indicatorShape: indicatorShape,
868868 ),
869- const NavigationDestination (
869+ NavigationDestination (
870870 icon: Icon (Icons .access_alarm),
871871 label: 'Alarm' ,
872872 ),
@@ -877,20 +877,20 @@ void main() {
877877 );
878878 }
879879
880- await tester.pumpWidget (buildNaviagationBar ());
880+ await tester.pumpWidget (buildNavigationBar ());
881881
882882 // Test default indicator color and shape.
883- expect (_indicator (tester)? .color, theme.colorScheme.secondary.withOpacity (0.24 ));
883+ expect (_getIndicatorDecoration (tester)? .color, theme.colorScheme.secondary.withOpacity (0.24 ));
884884 expect (
885- _indicator (tester)? .shape,
885+ _getIndicatorDecoration (tester)? .shape,
886886 const RoundedRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (16 ))),
887887 );
888888
889- await tester.pumpWidget (buildNaviagationBar (indicatorColor: color, indicatorShape: shape));
889+ await tester.pumpWidget (buildNavigationBar (indicatorColor: color, indicatorShape: shape));
890890
891891 // Test custom indicator color and shape.
892- expect (_indicator (tester)? .color, color);
893- expect (_indicator (tester)? .shape, shape);
892+ expect (_getIndicatorDecoration (tester)? .color, color);
893+ expect (_getIndicatorDecoration (tester)? .shape, shape);
894894 });
895895 });
896896}
@@ -912,7 +912,7 @@ Material _getMaterial(WidgetTester tester) {
912912 );
913913}
914914
915- ShapeDecoration ? _indicator (WidgetTester tester) {
915+ ShapeDecoration ? _getIndicatorDecoration (WidgetTester tester) {
916916 return tester.firstWidget <Container >(
917917 find.descendant (
918918 of: find.byType (FadeTransition ),
0 commit comments