Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
// 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 'dart:typed_data';

import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:flutter_test/flutter_test.dart';

import '../image_data.dart';

/// Integration tests testing both [CupertinoPageScaffold] and [CupertinoTabScaffold].
void main() {
testWidgets('Contents are behind translucent bar', (WidgetTester tester) async {
Expand Down Expand Up @@ -215,15 +208,9 @@ void main() {
home: CupertinoTabScaffold(
tabBar: CupertinoTabBar(
backgroundColor: CupertinoColors.white,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
label: 'Tab 1',
),
BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
label: 'Tab 2',
),
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Any idea why we didn't use CupertinoIcons in the first place?

@QuncCccccc QuncCccccc Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the original scaffold test existed before CupertinoIcons was created: the test was introduced in flutter/flutter#10543, while CupertinoIcons was added later in https://github.com/flutter/flutter/pull/12559😄. The transparent image usage came even later in flutter/flutter#64599, replacing the older fake image provider. So this seems historical rather than a test requirement; the tests only need valid tab icons, and built-in Cupertino icons work for that now:)!

BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'),
],
),
tabBuilder: (BuildContext context, int index) {
Expand Down Expand Up @@ -255,15 +242,9 @@ void main() {
data: const MediaQueryData(padding: EdgeInsets.symmetric(vertical: 20.0)),
child: CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
label: 'Tab 1',
),
BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
label: 'Tab 2',
),
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'),
BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'),
],
),
tabBuilder: (BuildContext context, int index) {
Expand Down Expand Up @@ -303,15 +284,9 @@ void main() {
CupertinoApp(
home: CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
label: 'Tab 1',
),
BottomNavigationBarItem(
icon: ImageIcon(MemoryImage(Uint8List.fromList(kTransparentImage))),
label: 'Tab 2',
),
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(icon: Icon(CupertinoIcons.search), label: 'Tab 1'),
BottomNavigationBarItem(icon: Icon(CupertinoIcons.settings), label: 'Tab 2'),
],
),
tabBuilder: (BuildContext context, int index) {
Expand Down
Loading