From 7f3e7ec13646cfb726174075e71e65911a30a285 Mon Sep 17 00:00:00 2001 From: Renzo Olivares Date: Thu, 25 Jun 2026 00:54:11 +0000 Subject: [PATCH 1/6] Migrate bottom_tab_bar_test.dart to SemanticsHandle --- .../bottom_tab_bar_test.dart | 44 +- packages/cupertino_ui/test/image_data.dart | 1181 +++++++++++++++++ 2 files changed, 1206 insertions(+), 19 deletions(-) rename packages/cupertino_ui/{temporarily_disabled_tests => test}/bottom_tab_bar_test.dart (96%) create mode 100644 packages/cupertino_ui/test/image_data.dart diff --git a/packages/cupertino_ui/temporarily_disabled_tests/bottom_tab_bar_test.dart b/packages/cupertino_ui/test/bottom_tab_bar_test.dart similarity index 96% rename from packages/cupertino_ui/temporarily_disabled_tests/bottom_tab_bar_test.dart rename to packages/cupertino_ui/test/bottom_tab_bar_test.dart index 0f30245b402d..2626a58b83fa 100644 --- a/packages/cupertino_ui/temporarily_disabled_tests/bottom_tab_bar_test.dart +++ b/packages/cupertino_ui/test/bottom_tab_bar_test.dart @@ -2,17 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@Skip( - 'This file is skipped due to a cross-import that needs to be fixed. Tracked in https://github.com/flutter/flutter/issues/177028.', -) import 'package:cupertino_ui/cupertino_ui.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import '../image_data.dart'; -import '../widgets/semantics_tester.dart'; +import 'image_data.dart'; Future pumpWidgetWithBoilerplate(WidgetTester tester, Widget widget) async { await tester.pumpWidget( @@ -530,7 +526,7 @@ Future main() async { }); testWidgets('tabs announce semantics', (WidgetTester tester) async { - final semantics = SemanticsTester(tester); + final SemanticsHandle handle = tester.ensureSemantics(); await pumpWidgetWithBoilerplate( tester, @@ -552,21 +548,26 @@ Future main() async { ); expect( - semantics, - includesNodeWith( + tester.getSemantics(find.text('Tab 1')), + isSemantics( label: 'Tab 1', hint: 'Tab 1 of 2', - flags: [SemanticsFlag.hasSelectedState, SemanticsFlag.isSelected], + isSelected: true, textDirection: TextDirection.ltr, ), ); expect( - semantics, - includesNodeWith(label: 'Tab 2', hint: 'Tab 2 of 2', textDirection: TextDirection.ltr), + tester.getSemantics(find.text('Tab 2')), + isSemantics( + label: 'Tab 2', + hint: 'Tab 2 of 2', + isSelected: false, + textDirection: TextDirection.ltr, + ), ); - semantics.dispose(); + handle.dispose(); }); testWidgets('Label of items should be nullable', (WidgetTester tester) async { @@ -709,7 +710,7 @@ Future main() async { testWidgets('CupertinoTabBar item semanticsLabel overrides label for accessibility', ( WidgetTester tester, ) async { - final semantics = SemanticsTester(tester); + final SemanticsHandle handle = tester.ensureSemantics(); await pumpWidgetWithBoilerplate( tester, @@ -733,21 +734,26 @@ Future main() async { // Tab A should use the custom semanticsLabel expect( - semantics, - includesNodeWith( + tester.getSemantics(find.text('A')), + isSemantics( label: 'Custom A label', hint: 'Tab 1 of 2', - flags: [SemanticsFlag.hasSelectedState, SemanticsFlag.isSelected], + isSelected: true, textDirection: TextDirection.ltr, ), ); // Tab B should use the default label since no semanticsLabel is provided expect( - semantics, - includesNodeWith(label: 'B', hint: 'Tab 2 of 2', textDirection: TextDirection.ltr), + tester.getSemantics(find.text('B')), + isSemantics( + label: 'B', + hint: 'Tab 2 of 2', + isSelected: false, + textDirection: TextDirection.ltr, + ), ); - semantics.dispose(); + handle.dispose(); }); } diff --git a/packages/cupertino_ui/test/image_data.dart b/packages/cupertino_ui/test/image_data.dart new file mode 100644 index 000000000000..10f054457fa3 --- /dev/null +++ b/packages/cupertino_ui/test/image_data.dart @@ -0,0 +1,1181 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/// A 50x50 blue square png. +const List kBlueSquarePng = [ + 0x89, + 0x50, + 0x4e, + 0x47, + 0x0d, + 0x0a, + 0x1a, + 0x0a, + 0x00, + 0x00, + 0x00, + 0x0d, + 0x49, + 0x48, + 0x44, + 0x52, + 0x00, + 0x00, + 0x00, + 0x32, + 0x00, + 0x00, + 0x00, + 0x32, + 0x08, + 0x06, + 0x00, + 0x00, + 0x00, + 0x1e, + 0x3f, + 0x88, + 0xb1, + 0x00, + 0x00, + 0x00, + 0x48, + 0x49, + 0x44, + 0x41, + 0x54, + 0x78, + 0xda, + 0xed, + 0xcf, + 0x31, + 0x0d, + 0x00, + 0x30, + 0x08, + 0x00, + 0xb0, + 0x61, + 0x63, + 0x2f, + 0xfe, + 0x2d, + 0x61, + 0x05, + 0x34, + 0xf0, + 0x92, + 0xd6, + 0x41, + 0x23, + 0x7f, + 0xf5, + 0x3b, + 0x20, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x44, + 0x36, + 0x06, + 0x03, + 0x6e, + 0x69, + 0x47, + 0x12, + 0x8e, + 0xea, + 0xaa, + 0x00, + 0x00, + 0x00, + 0x00, + 0x49, + 0x45, + 0x4e, + 0x44, + 0xae, + 0x42, + 0x60, + 0x82, +]; + +const List kTransparentImage = [ + 0x89, + 0x50, + 0x4E, + 0x47, + 0x0D, + 0x0A, + 0x1A, + 0x0A, + 0x00, + 0x00, + 0x00, + 0x0D, + 0x49, + 0x48, + 0x44, + 0x52, + 0x00, + 0x00, + 0x00, + 0x01, + 0x00, + 0x00, + 0x00, + 0x01, + 0x08, + 0x06, + 0x00, + 0x00, + 0x00, + 0x1F, + 0x15, + 0xC4, + 0x89, + 0x00, + 0x00, + 0x00, + 0x06, + 0x62, + 0x4B, + 0x47, + 0x44, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0xA0, + 0xBD, + 0xA7, + 0x93, + 0x00, + 0x00, + 0x00, + 0x09, + 0x70, + 0x48, + 0x59, + 0x73, + 0x00, + 0x00, + 0x0B, + 0x13, + 0x00, + 0x00, + 0x0B, + 0x13, + 0x01, + 0x00, + 0x9A, + 0x9C, + 0x18, + 0x00, + 0x00, + 0x00, + 0x07, + 0x74, + 0x49, + 0x4D, + 0x45, + 0x07, + 0xE6, + 0x03, + 0x10, + 0x17, + 0x07, + 0x1D, + 0x2E, + 0x5E, + 0x30, + 0x9B, + 0x00, + 0x00, + 0x00, + 0x0B, + 0x49, + 0x44, + 0x41, + 0x54, + 0x08, + 0xD7, + 0x63, + 0x60, + 0x00, + 0x02, + 0x00, + 0x00, + 0x05, + 0x00, + 0x01, + 0xE2, + 0x26, + 0x05, + 0x9B, + 0x00, + 0x00, + 0x00, + 0x00, + 0x49, + 0x45, + 0x4E, + 0x44, + 0xAE, + 0x42, + 0x60, + 0x82, +]; + +/// An animated GIF image with 3 1x1 pixel frames (a red, green, and blue +/// frames). The GIF animates forever, and each frame has a 100ms delay. +const List kAnimatedGif = [ + 0x47, + 0x49, + 0x46, + 0x38, + 0x39, + 0x61, + 0x01, + 0x00, + 0x01, + 0x00, + 0xa1, + 0x03, + 0x00, + 0x00, + 0x00, + 0xff, + 0xff, + 0x00, + 0x00, + 0x00, + 0xff, + 0x00, + 0xff, + 0xff, + 0xff, + 0x21, + 0xff, + 0x0b, + 0x4e, + 0x45, + 0x54, + 0x53, + 0x43, + 0x41, + 0x50, + 0x45, + 0x32, + 0x2e, + 0x30, + 0x03, + 0x01, + 0x00, + 0x00, + 0x00, + 0x21, + 0xf9, + 0x04, + 0x00, + 0x0a, + 0x00, + 0xff, + 0x00, + 0x2c, + 0x00, + 0x00, + 0x00, + 0x00, + 0x01, + 0x00, + 0x01, + 0x00, + 0x00, + 0x02, + 0x02, + 0x4c, + 0x01, + 0x00, + 0x21, + 0xf9, + 0x04, + 0x00, + 0x0a, + 0x00, + 0xff, + 0x00, + 0x2c, + 0x00, + 0x00, + 0x00, + 0x00, + 0x01, + 0x00, + 0x01, + 0x00, + 0x00, + 0x02, + 0x02, + 0x54, + 0x01, + 0x00, + 0x21, + 0xf9, + 0x04, + 0x00, + 0x0a, + 0x00, + 0xff, + 0x00, + 0x2c, + 0x00, + 0x00, + 0x00, + 0x00, + 0x01, + 0x00, + 0x01, + 0x00, + 0x00, + 0x02, + 0x02, + 0x44, + 0x01, + 0x00, + 0x3b, +]; + +/// A PNG with 100x100 blue pixels. +// +// Constructed by the following code: +// ```dart +// Future someTest(WidgetTester tester) async { +// Uint8List? bytes; +// await tester.runAsync(() async { +// const int imageWidth = 100; +// const int imageHeight = 100; +// final Uint8List pixels = Uint8List.fromList(List.generate( +// imageWidth * imageHeight * 4, +// (int i) => i % 4 < 2 ? 0x00 : 0xFF, // opaque blue +// )); +// final Completer completer = Completer(); +// ui.decodeImageFromPixels( +// pixels, imageWidth, imageHeight, ui.PixelFormat.rgba8888, +// (ui.Image image) async { +// final ByteData? byteData = await image.toByteData( +// format: ui.ImageByteFormat.png); +// bytes = byteData!.buffer.asUint8List(); +// completer.complete(); +// }, +// ); +// await completer.future; +// }); +// print(bytes); +// } +// ``` +const List kBlueRectPng = [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 100, + 8, + 6, + 0, + 0, + 0, + 112, + 226, + 149, + 84, + 0, + 0, + 0, + 4, + 115, + 66, + 73, + 84, + 8, + 8, + 8, + 8, + 124, + 8, + 100, + 136, + 0, + 0, + 1, + 0, + 73, + 68, + 65, + 84, + 120, + 156, + 237, + 209, + 65, + 13, + 0, + 32, + 16, + 192, + 176, + 3, + 255, + 158, + 225, + 141, + 2, + 246, + 104, + 21, + 44, + 217, + 154, + 57, + 103, + 200, + 216, + 191, + 3, + 120, + 25, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 204, + 5, + 234, + 78, + 2, + 198, + 180, + 170, + 48, + 200, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130, +]; + +/// A portrait-mode (50x100) PNG with blue pixels. +const List kBluePortraitPng = [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 50, + 0, + 0, + 0, + 100, + 8, + 6, + 0, + 0, + 0, + 196, + 232, + 99, + 91, + 0, + 0, + 0, + 4, + 115, + 66, + 73, + 84, + 8, + 8, + 8, + 8, + 124, + 8, + 100, + 136, + 0, + 0, + 0, + 140, + 73, + 68, + 65, + 84, + 120, + 156, + 237, + 207, + 1, + 13, + 192, + 48, + 12, + 192, + 176, + 126, + 252, + 57, + 247, + 36, + 46, + 45, + 186, + 108, + 4, + 201, + 51, + 179, + 59, + 63, + 112, + 110, + 7, + 124, + 197, + 72, + 141, + 145, + 26, + 35, + 53, + 70, + 106, + 140, + 212, + 24, + 169, + 49, + 82, + 99, + 164, + 198, + 72, + 141, + 145, + 26, + 35, + 53, + 70, + 106, + 140, + 212, + 24, + 169, + 49, + 82, + 99, + 164, + 198, + 72, + 141, + 145, + 26, + 35, + 53, + 70, + 106, + 140, + 212, + 24, + 169, + 49, + 82, + 99, + 164, + 198, + 72, + 141, + 145, + 26, + 35, + 53, + 70, + 106, + 140, + 212, + 24, + 169, + 49, + 82, + 99, + 164, + 198, + 72, + 141, + 145, + 26, + 35, + 53, + 70, + 106, + 140, + 212, + 24, + 169, + 49, + 82, + 99, + 164, + 198, + 72, + 141, + 145, + 26, + 35, + 53, + 70, + 106, + 140, + 212, + 24, + 169, + 49, + 82, + 99, + 164, + 198, + 72, + 205, + 11, + 105, + 8, + 2, + 198, + 99, + 140, + 153, + 87, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130, +]; + +/// A landscape-mode (100x50) PNG with blue pixels. +const List kBlueLandscapePng = [ + 137, + 80, + 78, + 71, + 13, + 10, + 26, + 10, + 0, + 0, + 0, + 13, + 73, + 72, + 68, + 82, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 50, + 8, + 6, + 0, + 0, + 0, + 170, + 53, + 126, + 190, + 0, + 0, + 0, + 4, + 115, + 66, + 73, + 84, + 8, + 8, + 8, + 8, + 124, + 8, + 100, + 136, + 0, + 0, + 0, + 143, + 73, + 68, + 65, + 84, + 120, + 156, + 237, + 209, + 65, + 13, + 0, + 32, + 16, + 192, + 176, + 3, + 255, + 158, + 225, + 141, + 2, + 246, + 104, + 21, + 44, + 217, + 154, + 57, + 103, + 200, + 216, + 191, + 3, + 120, + 25, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 24, + 18, + 99, + 72, + 140, + 33, + 49, + 134, + 196, + 92, + 164, + 190, + 2, + 98, + 53, + 3, + 99, + 174, + 0, + 0, + 0, + 0, + 73, + 69, + 78, + 68, + 174, + 66, + 96, + 130, +]; From e3ab74610082ed67854b9ab470f9adc4a81c0fdc Mon Sep 17 00:00:00 2001 From: Renzo Olivares Date: Thu, 25 Jun 2026 21:45:26 +0000 Subject: [PATCH 2/6] add hasSelectedState --- packages/cupertino_ui/test/bottom_tab_bar_test.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/cupertino_ui/test/bottom_tab_bar_test.dart b/packages/cupertino_ui/test/bottom_tab_bar_test.dart index 2626a58b83fa..2d43c362a43f 100644 --- a/packages/cupertino_ui/test/bottom_tab_bar_test.dart +++ b/packages/cupertino_ui/test/bottom_tab_bar_test.dart @@ -553,6 +553,7 @@ Future main() async { label: 'Tab 1', hint: 'Tab 1 of 2', isSelected: true, + hasSelectedState: true, textDirection: TextDirection.ltr, ), ); @@ -563,6 +564,7 @@ Future main() async { label: 'Tab 2', hint: 'Tab 2 of 2', isSelected: false, + hasSelectedState: true, textDirection: TextDirection.ltr, ), ); @@ -739,6 +741,7 @@ Future main() async { label: 'Custom A label', hint: 'Tab 1 of 2', isSelected: true, + hasSelectedState: true, textDirection: TextDirection.ltr, ), ); @@ -750,6 +753,7 @@ Future main() async { label: 'B', hint: 'Tab 2 of 2', isSelected: false, + hasSelectedState: true, textDirection: TextDirection.ltr, ), ); From 0b5379766f6b2bb930c2c008a4996daa717e56a1 Mon Sep 17 00:00:00 2001 From: Renzo Olivares Date: Thu, 25 Jun 2026 22:25:31 +0000 Subject: [PATCH 3/6] use correct license --- packages/cupertino_ui/test/image_data.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cupertino_ui/test/image_data.dart b/packages/cupertino_ui/test/image_data.dart index 10f054457fa3..9c63d7730acc 100644 --- a/packages/cupertino_ui/test/image_data.dart +++ b/packages/cupertino_ui/test/image_data.dart @@ -1,4 +1,4 @@ -// Copyright 2014 The Flutter Authors. All rights reserved. +// Copyright 2013 The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. From d5014a7a99593fc3b5d14e543b1002c523eca71c Mon Sep 17 00:00:00 2001 From: Renzo Olivares Date: Tue, 30 Jun 2026 23:11:00 +0000 Subject: [PATCH 4/6] remove ensureSemantics --- packages/cupertino_ui/test/bottom_tab_bar_test.dart | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/cupertino_ui/test/bottom_tab_bar_test.dart b/packages/cupertino_ui/test/bottom_tab_bar_test.dart index 2d43c362a43f..1fce679c6b91 100644 --- a/packages/cupertino_ui/test/bottom_tab_bar_test.dart +++ b/packages/cupertino_ui/test/bottom_tab_bar_test.dart @@ -526,8 +526,6 @@ Future main() async { }); testWidgets('tabs announce semantics', (WidgetTester tester) async { - final SemanticsHandle handle = tester.ensureSemantics(); - await pumpWidgetWithBoilerplate( tester, MediaQuery( @@ -568,8 +566,6 @@ Future main() async { textDirection: TextDirection.ltr, ), ); - - handle.dispose(); }); testWidgets('Label of items should be nullable', (WidgetTester tester) async { @@ -712,8 +708,6 @@ Future main() async { testWidgets('CupertinoTabBar item semanticsLabel overrides label for accessibility', ( WidgetTester tester, ) async { - final SemanticsHandle handle = tester.ensureSemantics(); - await pumpWidgetWithBoilerplate( tester, MediaQuery( @@ -757,7 +751,5 @@ Future main() async { textDirection: TextDirection.ltr, ), ); - - handle.dispose(); }); } From e210c3a7d34a85456f0b0911b2442668d2a0fcef Mon Sep 17 00:00:00 2001 From: Renzo Olivares Date: Tue, 30 Jun 2026 21:30:40 -0700 Subject: [PATCH 5/6] remove image_data.dart and replace with CupertinoIcons --- .../test/bottom_tab_bar_test.dart | 242 +--- packages/cupertino_ui/test/image_data.dart | 1181 ----------------- 2 files changed, 64 insertions(+), 1359 deletions(-) delete mode 100644 packages/cupertino_ui/test/image_data.dart diff --git a/packages/cupertino_ui/test/bottom_tab_bar_test.dart b/packages/cupertino_ui/test/bottom_tab_bar_test.dart index 1fce679c6b91..3dcc7e0bc388 100644 --- a/packages/cupertino_ui/test/bottom_tab_bar_test.dart +++ b/packages/cupertino_ui/test/bottom_tab_bar_test.dart @@ -8,8 +8,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'image_data.dart'; - Future pumpWidgetWithBoilerplate(WidgetTester tester, Widget widget) async { await tester.pumpWidget( Localizations( @@ -29,11 +27,8 @@ Future main() async { () => pumpWidgetWithBoilerplate( tester, CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), ], ), ), @@ -53,15 +48,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], currentIndex: 1, activeColor: const Color(0xFF123456), @@ -87,15 +76,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], currentIndex: 1, ), @@ -122,15 +105,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], currentIndex: 1, activeColor: dynamicActiveColor, @@ -163,15 +140,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(platformBrightness: Brightness.dark), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], currentIndex: 1, activeColor: dynamicActiveColor, @@ -199,15 +170,9 @@ Future main() async { await tester.pumpWidget( CupertinoApp( home: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], currentIndex: 1, ), @@ -228,15 +193,9 @@ Future main() async { CupertinoApp( theme: const CupertinoThemeData(brightness: Brightness.dark), home: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], currentIndex: 1, ), @@ -256,22 +215,16 @@ Future main() async { }); testWidgets('Use active icon', (WidgetTester tester) async { - final activeIcon = MemoryImage(Uint8List.fromList(kBlueSquarePng)); - final inactiveIcon = MemoryImage(Uint8List.fromList(kTransparentImage)); - await pumpWidgetWithBoilerplate( tester, MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), BottomNavigationBarItem( - icon: ImageIcon(inactiveIcon), - activeIcon: ImageIcon(activeIcon), + icon: Icon(CupertinoIcons.heart), + activeIcon: Icon(CupertinoIcons.heart_fill), label: 'Tab 2', ), ], @@ -282,28 +235,20 @@ Future main() async { ), ); - final Image image = tester.widget( - find.descendant( - of: find.widgetWithText(GestureDetector, 'Tab 2'), - matching: find.byType(Image), - ), - ); + expect(find.byIcon(CupertinoIcons.heart_fill), findsOneWidget); + expect(find.byIcon(CupertinoIcons.heart), findsNothing); - expect(image.color, const Color(0xFF123456)); - expect(image.image, activeIcon); + final IconThemeData iconTheme = IconTheme.of( + tester.element(find.byIcon(CupertinoIcons.heart_fill)), + ); + expect(iconTheme.color, const Color(0xFF123456)); }); testWidgets('Adjusts height to account for bottom padding', (WidgetTester tester) async { final tabBar = CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Aka', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Shiro', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Aka'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Shiro'), ], ); @@ -343,15 +288,9 @@ Future main() async { const tabBarHeight = 56.0; final tabBar = CupertinoTabBar( height: tabBarHeight, - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Aka', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Shiro', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Aka'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Shiro'), ], ); @@ -393,15 +332,9 @@ Future main() async { const tabBarHeight = 56.0; final tabBar = CupertinoTabBar( height: tabBarHeight, - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Aka', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Shiro', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Aka'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Shiro'), ], ); @@ -453,15 +386,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], ), ), @@ -474,15 +401,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], backgroundColor: const Color(0xFFFFFFFF), // Opaque white. ), @@ -500,15 +421,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], currentIndex: 1, onTap: (int tab) { @@ -531,15 +446,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], ), ), @@ -569,7 +478,6 @@ Future main() async { }); testWidgets('Label of items should be nullable', (WidgetTester tester) async { - final iconProvider = MemoryImage(Uint8List.fromList(kTransparentImage)); final itemsTapped = []; await pumpWidgetWithBoilerplate( @@ -577,12 +485,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem(icon: ImageIcon(iconProvider)), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.circle)), ], onTap: (int index) => itemsTapped.add(index), ), @@ -591,11 +496,7 @@ Future main() async { expect(find.text('Tab 1'), findsOneWidget); - final Finder finder = find.byWidgetPredicate( - (Widget widget) => widget is Image && widget.image == iconProvider, - ); - - await tester.tap(finder); + await tester.tap(find.byIcon(CupertinoIcons.circle)); expect(itemsTapped, [1]); }); @@ -605,15 +506,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], ), ), @@ -628,15 +523,9 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 1', - ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'Tab 2', - ), + items: const [ + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), ], backgroundColor: const Color(0xFFFFFFFF), // Opaque white. border: null, @@ -713,16 +602,13 @@ Future main() async { MediaQuery( data: const MediaQueryData(), child: CupertinoTabBar( - items: [ + items: const [ BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), + icon: Icon(CupertinoIcons.search), label: 'A', semanticsLabel: 'Custom A label', ), - BottomNavigationBarItem( - icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))), - label: 'B', - ), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'B'), ], ), ), diff --git a/packages/cupertino_ui/test/image_data.dart b/packages/cupertino_ui/test/image_data.dart deleted file mode 100644 index 9c63d7730acc..000000000000 --- a/packages/cupertino_ui/test/image_data.dart +++ /dev/null @@ -1,1181 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/// A 50x50 blue square png. -const List kBlueSquarePng = [ - 0x89, - 0x50, - 0x4e, - 0x47, - 0x0d, - 0x0a, - 0x1a, - 0x0a, - 0x00, - 0x00, - 0x00, - 0x0d, - 0x49, - 0x48, - 0x44, - 0x52, - 0x00, - 0x00, - 0x00, - 0x32, - 0x00, - 0x00, - 0x00, - 0x32, - 0x08, - 0x06, - 0x00, - 0x00, - 0x00, - 0x1e, - 0x3f, - 0x88, - 0xb1, - 0x00, - 0x00, - 0x00, - 0x48, - 0x49, - 0x44, - 0x41, - 0x54, - 0x78, - 0xda, - 0xed, - 0xcf, - 0x31, - 0x0d, - 0x00, - 0x30, - 0x08, - 0x00, - 0xb0, - 0x61, - 0x63, - 0x2f, - 0xfe, - 0x2d, - 0x61, - 0x05, - 0x34, - 0xf0, - 0x92, - 0xd6, - 0x41, - 0x23, - 0x7f, - 0xf5, - 0x3b, - 0x20, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x44, - 0x36, - 0x06, - 0x03, - 0x6e, - 0x69, - 0x47, - 0x12, - 0x8e, - 0xea, - 0xaa, - 0x00, - 0x00, - 0x00, - 0x00, - 0x49, - 0x45, - 0x4e, - 0x44, - 0xae, - 0x42, - 0x60, - 0x82, -]; - -const List kTransparentImage = [ - 0x89, - 0x50, - 0x4E, - 0x47, - 0x0D, - 0x0A, - 0x1A, - 0x0A, - 0x00, - 0x00, - 0x00, - 0x0D, - 0x49, - 0x48, - 0x44, - 0x52, - 0x00, - 0x00, - 0x00, - 0x01, - 0x00, - 0x00, - 0x00, - 0x01, - 0x08, - 0x06, - 0x00, - 0x00, - 0x00, - 0x1F, - 0x15, - 0xC4, - 0x89, - 0x00, - 0x00, - 0x00, - 0x06, - 0x62, - 0x4B, - 0x47, - 0x44, - 0x00, - 0xFF, - 0x00, - 0xFF, - 0x00, - 0xFF, - 0xA0, - 0xBD, - 0xA7, - 0x93, - 0x00, - 0x00, - 0x00, - 0x09, - 0x70, - 0x48, - 0x59, - 0x73, - 0x00, - 0x00, - 0x0B, - 0x13, - 0x00, - 0x00, - 0x0B, - 0x13, - 0x01, - 0x00, - 0x9A, - 0x9C, - 0x18, - 0x00, - 0x00, - 0x00, - 0x07, - 0x74, - 0x49, - 0x4D, - 0x45, - 0x07, - 0xE6, - 0x03, - 0x10, - 0x17, - 0x07, - 0x1D, - 0x2E, - 0x5E, - 0x30, - 0x9B, - 0x00, - 0x00, - 0x00, - 0x0B, - 0x49, - 0x44, - 0x41, - 0x54, - 0x08, - 0xD7, - 0x63, - 0x60, - 0x00, - 0x02, - 0x00, - 0x00, - 0x05, - 0x00, - 0x01, - 0xE2, - 0x26, - 0x05, - 0x9B, - 0x00, - 0x00, - 0x00, - 0x00, - 0x49, - 0x45, - 0x4E, - 0x44, - 0xAE, - 0x42, - 0x60, - 0x82, -]; - -/// An animated GIF image with 3 1x1 pixel frames (a red, green, and blue -/// frames). The GIF animates forever, and each frame has a 100ms delay. -const List kAnimatedGif = [ - 0x47, - 0x49, - 0x46, - 0x38, - 0x39, - 0x61, - 0x01, - 0x00, - 0x01, - 0x00, - 0xa1, - 0x03, - 0x00, - 0x00, - 0x00, - 0xff, - 0xff, - 0x00, - 0x00, - 0x00, - 0xff, - 0x00, - 0xff, - 0xff, - 0xff, - 0x21, - 0xff, - 0x0b, - 0x4e, - 0x45, - 0x54, - 0x53, - 0x43, - 0x41, - 0x50, - 0x45, - 0x32, - 0x2e, - 0x30, - 0x03, - 0x01, - 0x00, - 0x00, - 0x00, - 0x21, - 0xf9, - 0x04, - 0x00, - 0x0a, - 0x00, - 0xff, - 0x00, - 0x2c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x00, - 0x02, - 0x02, - 0x4c, - 0x01, - 0x00, - 0x21, - 0xf9, - 0x04, - 0x00, - 0x0a, - 0x00, - 0xff, - 0x00, - 0x2c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x00, - 0x02, - 0x02, - 0x54, - 0x01, - 0x00, - 0x21, - 0xf9, - 0x04, - 0x00, - 0x0a, - 0x00, - 0xff, - 0x00, - 0x2c, - 0x00, - 0x00, - 0x00, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x00, - 0x02, - 0x02, - 0x44, - 0x01, - 0x00, - 0x3b, -]; - -/// A PNG with 100x100 blue pixels. -// -// Constructed by the following code: -// ```dart -// Future someTest(WidgetTester tester) async { -// Uint8List? bytes; -// await tester.runAsync(() async { -// const int imageWidth = 100; -// const int imageHeight = 100; -// final Uint8List pixels = Uint8List.fromList(List.generate( -// imageWidth * imageHeight * 4, -// (int i) => i % 4 < 2 ? 0x00 : 0xFF, // opaque blue -// )); -// final Completer completer = Completer(); -// ui.decodeImageFromPixels( -// pixels, imageWidth, imageHeight, ui.PixelFormat.rgba8888, -// (ui.Image image) async { -// final ByteData? byteData = await image.toByteData( -// format: ui.ImageByteFormat.png); -// bytes = byteData!.buffer.asUint8List(); -// completer.complete(); -// }, -// ); -// await completer.future; -// }); -// print(bytes); -// } -// ``` -const List kBlueRectPng = [ - 137, - 80, - 78, - 71, - 13, - 10, - 26, - 10, - 0, - 0, - 0, - 13, - 73, - 72, - 68, - 82, - 0, - 0, - 0, - 100, - 0, - 0, - 0, - 100, - 8, - 6, - 0, - 0, - 0, - 112, - 226, - 149, - 84, - 0, - 0, - 0, - 4, - 115, - 66, - 73, - 84, - 8, - 8, - 8, - 8, - 124, - 8, - 100, - 136, - 0, - 0, - 1, - 0, - 73, - 68, - 65, - 84, - 120, - 156, - 237, - 209, - 65, - 13, - 0, - 32, - 16, - 192, - 176, - 3, - 255, - 158, - 225, - 141, - 2, - 246, - 104, - 21, - 44, - 217, - 154, - 57, - 103, - 200, - 216, - 191, - 3, - 120, - 25, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 204, - 5, - 234, - 78, - 2, - 198, - 180, - 170, - 48, - 200, - 0, - 0, - 0, - 0, - 73, - 69, - 78, - 68, - 174, - 66, - 96, - 130, -]; - -/// A portrait-mode (50x100) PNG with blue pixels. -const List kBluePortraitPng = [ - 137, - 80, - 78, - 71, - 13, - 10, - 26, - 10, - 0, - 0, - 0, - 13, - 73, - 72, - 68, - 82, - 0, - 0, - 0, - 50, - 0, - 0, - 0, - 100, - 8, - 6, - 0, - 0, - 0, - 196, - 232, - 99, - 91, - 0, - 0, - 0, - 4, - 115, - 66, - 73, - 84, - 8, - 8, - 8, - 8, - 124, - 8, - 100, - 136, - 0, - 0, - 0, - 140, - 73, - 68, - 65, - 84, - 120, - 156, - 237, - 207, - 1, - 13, - 192, - 48, - 12, - 192, - 176, - 126, - 252, - 57, - 247, - 36, - 46, - 45, - 186, - 108, - 4, - 201, - 51, - 179, - 59, - 63, - 112, - 110, - 7, - 124, - 197, - 72, - 141, - 145, - 26, - 35, - 53, - 70, - 106, - 140, - 212, - 24, - 169, - 49, - 82, - 99, - 164, - 198, - 72, - 141, - 145, - 26, - 35, - 53, - 70, - 106, - 140, - 212, - 24, - 169, - 49, - 82, - 99, - 164, - 198, - 72, - 141, - 145, - 26, - 35, - 53, - 70, - 106, - 140, - 212, - 24, - 169, - 49, - 82, - 99, - 164, - 198, - 72, - 141, - 145, - 26, - 35, - 53, - 70, - 106, - 140, - 212, - 24, - 169, - 49, - 82, - 99, - 164, - 198, - 72, - 141, - 145, - 26, - 35, - 53, - 70, - 106, - 140, - 212, - 24, - 169, - 49, - 82, - 99, - 164, - 198, - 72, - 141, - 145, - 26, - 35, - 53, - 70, - 106, - 140, - 212, - 24, - 169, - 49, - 82, - 99, - 164, - 198, - 72, - 205, - 11, - 105, - 8, - 2, - 198, - 99, - 140, - 153, - 87, - 0, - 0, - 0, - 0, - 73, - 69, - 78, - 68, - 174, - 66, - 96, - 130, -]; - -/// A landscape-mode (100x50) PNG with blue pixels. -const List kBlueLandscapePng = [ - 137, - 80, - 78, - 71, - 13, - 10, - 26, - 10, - 0, - 0, - 0, - 13, - 73, - 72, - 68, - 82, - 0, - 0, - 0, - 100, - 0, - 0, - 0, - 50, - 8, - 6, - 0, - 0, - 0, - 170, - 53, - 126, - 190, - 0, - 0, - 0, - 4, - 115, - 66, - 73, - 84, - 8, - 8, - 8, - 8, - 124, - 8, - 100, - 136, - 0, - 0, - 0, - 143, - 73, - 68, - 65, - 84, - 120, - 156, - 237, - 209, - 65, - 13, - 0, - 32, - 16, - 192, - 176, - 3, - 255, - 158, - 225, - 141, - 2, - 246, - 104, - 21, - 44, - 217, - 154, - 57, - 103, - 200, - 216, - 191, - 3, - 120, - 25, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 24, - 18, - 99, - 72, - 140, - 33, - 49, - 134, - 196, - 92, - 164, - 190, - 2, - 98, - 53, - 3, - 99, - 174, - 0, - 0, - 0, - 0, - 73, - 69, - 78, - 68, - 174, - 66, - 96, - 130, -]; From ba98ba54cf8028c9b3068ef7c61da9106aae9856 Mon Sep 17 00:00:00 2001 From: Renzo Olivares Date: Tue, 30 Jun 2026 21:33:18 -0700 Subject: [PATCH 6/6] update --- .../test/bottom_tab_bar_test.dart | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/cupertino_ui/test/bottom_tab_bar_test.dart b/packages/cupertino_ui/test/bottom_tab_bar_test.dart index 3dcc7e0bc388..7e4d54cdf794 100644 --- a/packages/cupertino_ui/test/bottom_tab_bar_test.dart +++ b/packages/cupertino_ui/test/bottom_tab_bar_test.dart @@ -50,7 +50,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], currentIndex: 1, activeColor: const Color(0xFF123456), @@ -78,7 +78,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], currentIndex: 1, ), @@ -107,7 +107,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], currentIndex: 1, activeColor: dynamicActiveColor, @@ -142,7 +142,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], currentIndex: 1, activeColor: dynamicActiveColor, @@ -172,7 +172,7 @@ Future main() async { home: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], currentIndex: 1, ), @@ -195,7 +195,7 @@ Future main() async { home: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], currentIndex: 1, ), @@ -248,7 +248,7 @@ Future main() async { final tabBar = CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Aka'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Shiro'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Shiro'), ], ); @@ -290,7 +290,7 @@ Future main() async { height: tabBarHeight, items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Aka'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Shiro'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Shiro'), ], ); @@ -334,7 +334,7 @@ Future main() async { height: tabBarHeight, items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Aka'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Shiro'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Shiro'), ], ); @@ -388,7 +388,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], ), ), @@ -403,7 +403,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], backgroundColor: const Color(0xFFFFFFFF), // Opaque white. ), @@ -423,7 +423,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], currentIndex: 1, onTap: (int tab) { @@ -448,7 +448,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], ), ), @@ -508,7 +508,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], ), ), @@ -525,7 +525,7 @@ Future main() async { child: CupertinoTabBar( items: const [ BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 2'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'), ], backgroundColor: const Color(0xFFFFFFFF), // Opaque white. border: null, @@ -608,7 +608,7 @@ Future main() async { label: 'A', semanticsLabel: 'Custom A label', ), - BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'B'), + BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'B'), ], ), ),