-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolef: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repository
Description
Expected: the below test should pass
final List<int> tabsPainted = <int>[];
final CupertinoTabController controller = CupertinoTabController(initialIndex: 0);
await tester.pumpWidget(
CupertinoApp(
home: CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: List<BottomNavigationBarItem>.generate(10, tabGenerator),
),
controller: controller,
tabBuilder: (BuildContext context, int index) {
return CustomPaint(
child: Text('Page ${index + 1}'),
painter: TestCallbackPainter(
onPaint: () { tabsPainted.add(index); }
),
);
}
),
)
);
expect(tabsPainted, <int> [0]);
await tester.pumpWidget(
CupertinoApp(
home: CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: List<BottomNavigationBarItem>.generate(20, tabGenerator),
),
controller: controller,
tabBuilder:
(BuildContext context, int index) {
return CustomPaint(
child: Text('Page ${index + 1}'),
painter: TestCallbackPainter(
onPaint: () { tabsPainted.add(index); }
),
);
}
),
)
);
expect(tabsPainted, <int> [0, 0]);
await tester.tap(find.text('Tab 19'));
await tester.pump();
// Tapping the tabs should still work.
expect(tabsPainted, <int>[0, 0, 18]);Actual: throws a RangeError
Metadata
Metadata
Assignees
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolef: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repository