Unverified Commit 178b4b83 authored by Yash Johri's avatar Yash Johri Committed by GitHub

Updated tests in material/bottom_navigation_bar_test.dart (#66670)

parent 61460d25
...@@ -35,7 +35,7 @@ Future<void> main() async { ...@@ -35,7 +35,7 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
], ],
)); ));
...@@ -53,11 +53,11 @@ Future<void> main() async { ...@@ -53,11 +53,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: 1, currentIndex: 1,
...@@ -119,11 +119,11 @@ Future<void> main() async { ...@@ -119,11 +119,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: 1, currentIndex: 1,
...@@ -160,11 +160,11 @@ Future<void> main() async { ...@@ -160,11 +160,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: 1, currentIndex: 1,
...@@ -197,11 +197,11 @@ Future<void> main() async { ...@@ -197,11 +197,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: 1, currentIndex: 1,
...@@ -228,11 +228,11 @@ Future<void> main() async { ...@@ -228,11 +228,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: 1, currentIndex: 1,
...@@ -264,12 +264,12 @@ Future<void> main() async { ...@@ -264,12 +264,12 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(inactiveIcon), icon: ImageIcon(inactiveIcon),
activeIcon: ImageIcon(activeIcon), activeIcon: ImageIcon(activeIcon),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: 1, currentIndex: 1,
...@@ -292,11 +292,11 @@ Future<void> main() async { ...@@ -292,11 +292,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Aka'), label: 'Aka',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Shiro'), label: 'Shiro',
), ),
], ],
); );
...@@ -333,11 +333,11 @@ Future<void> main() async { ...@@ -333,11 +333,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
), ),
...@@ -351,11 +351,11 @@ Future<void> main() async { ...@@ -351,11 +351,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
backgroundColor: const Color(0xFFFFFFFF), // Opaque white. backgroundColor: const Color(0xFFFFFFFF), // Opaque white.
...@@ -374,11 +374,11 @@ Future<void> main() async { ...@@ -374,11 +374,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: 1, currentIndex: 1,
...@@ -399,11 +399,11 @@ Future<void> main() async { ...@@ -399,11 +399,11 @@ Future<void> main() async {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
), ),
...@@ -439,7 +439,7 @@ Future<void> main() async { ...@@ -439,7 +439,7 @@ Future<void> main() async {
icon: ImageIcon( icon: ImageIcon(
MemoryImage(Uint8List.fromList(kTransparentImage)), MemoryImage(Uint8List.fromList(kTransparentImage)),
), ),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon( icon: ImageIcon(
...@@ -471,13 +471,13 @@ Future<void> main() async { ...@@ -471,13 +471,13 @@ Future<void> main() async {
icon: ImageIcon( icon: ImageIcon(
MemoryImage(Uint8List.fromList(kTransparentImage)), MemoryImage(Uint8List.fromList(kTransparentImage)),
), ),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon( icon: ImageIcon(
MemoryImage(Uint8List.fromList(kTransparentImage)), MemoryImage(Uint8List.fromList(kTransparentImage)),
), ),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
), ),
...@@ -497,13 +497,13 @@ Future<void> main() async { ...@@ -497,13 +497,13 @@ Future<void> main() async {
icon: ImageIcon( icon: ImageIcon(
MemoryImage(Uint8List.fromList(kTransparentImage)), MemoryImage(Uint8List.fromList(kTransparentImage)),
), ),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon( icon: ImageIcon(
MemoryImage(Uint8List.fromList(kTransparentImage)), MemoryImage(Uint8List.fromList(kTransparentImage)),
), ),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
backgroundColor: const Color(0xFFFFFFFF), // Opaque white. backgroundColor: const Color(0xFFFFFFFF), // Opaque white.
......
...@@ -287,7 +287,7 @@ void main() { ...@@ -287,7 +287,7 @@ void main() {
tabBar: CupertinoTabBar( tabBar: CupertinoTabBar(
items: List<BottomNavigationBarItem>.generate( items: List<BottomNavigationBarItem>.generate(
10, 10,
(int i) => BottomNavigationBarItem(icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), title: Text('$i')), (int i) => BottomNavigationBarItem(icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), label: '$i'),
), ),
), ),
tabBuilder: (BuildContext context, int index) => const Text('content'), tabBuilder: (BuildContext context, int index) => const Text('content'),
...@@ -325,11 +325,11 @@ CupertinoTabBar _buildTabBar({ int selectedTab = 0 }) { ...@@ -325,11 +325,11 @@ CupertinoTabBar _buildTabBar({ int selectedTab = 0 }) {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: selectedTab, currentIndex: selectedTab,
......
...@@ -425,11 +425,11 @@ void main() { ...@@ -425,11 +425,11 @@ void main() {
items: const <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Icon(CupertinoIcons.search), icon: Icon(CupertinoIcons.search),
title: Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Icon(CupertinoIcons.settings), icon: Icon(CupertinoIcons.settings),
title: Text('Tab 2'), label: 'Tab 2',
), ),
], ],
), ),
......
...@@ -211,11 +211,11 @@ void main() { ...@@ -211,11 +211,11 @@ void main() {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
), ),
...@@ -251,11 +251,11 @@ void main() { ...@@ -251,11 +251,11 @@ void main() {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
), ),
...@@ -301,11 +301,11 @@ void main() { ...@@ -301,11 +301,11 @@ void main() {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
), ),
......
...@@ -45,7 +45,7 @@ void main() { ...@@ -45,7 +45,7 @@ void main() {
BottomNavigationBarItem tabGenerator(int index) { BottomNavigationBarItem tabGenerator(int index) {
return BottomNavigationBarItem( return BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: Text('Tab ${index + 1}'), label: 'Tab ${index + 1}',
); );
} }
...@@ -1079,7 +1079,7 @@ void main() { ...@@ -1079,7 +1079,7 @@ void main() {
tabBar: CupertinoTabBar( tabBar: CupertinoTabBar(
items: List<BottomNavigationBarItem>.generate( items: List<BottomNavigationBarItem>.generate(
10, 10,
(int i) => BottomNavigationBarItem(icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), title: Text('$i')), (int i) => BottomNavigationBarItem(icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), label: '$i'),
), ),
), ),
tabBuilder: (BuildContext context, int index) => const Text('content'), tabBuilder: (BuildContext context, int index) => const Text('content'),
...@@ -1221,11 +1221,11 @@ CupertinoTabBar _buildTabBar({ int selectedTab = 0 }) { ...@@ -1221,11 +1221,11 @@ CupertinoTabBar _buildTabBar({ int selectedTab = 0 }) {
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 1'), label: 'Tab 1',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
title: const Text('Tab 2'), label: 'Tab 2',
), ),
], ],
currentIndex: selectedTab, currentIndex: selectedTab,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment