Repository navigation
Closed
flutter/packages
#12546Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Use case
When using CupertinoTabBar, it has an assertion that property "items" must consist 2 items at least.
See
| "Tabs need at least 2 items to conform to Apple's HIG", |
Therefore when single item exists (we have a legitimise use case for that), the widget's assertion will fail resulting whole screen being bloody red in debug.
Proposal
I do not think Cupertino widgets should error when something does not conform to Apple's HIG. Warning message yes, but error? No thanks.
Therefore, I propose to remove the assertion and warn or log down for developer instead.
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Activity
DanielEdrisian commentedon Oct 30, 2020
@xster this seems legit. Should we drop the assert?
xster commentedon Oct 31, 2020
Ya plausibly. Is it possible to have 1 tab item in Xcode?
DanielEdrisian commentedon Oct 31, 2020
Yes it is
xster commentedon Nov 2, 2020
Sure, removing that assert sounds reasonable to me.
thennothinghappened commentedon Aug 6, 2023
Any update on this?
flutter-triage-bot commentedon Feb 12, 2024
This issue is missing a priority label. Please set a priority label when adding the
triaged-designlabel.[cupertino_ui] Remove two items assert to allow CupertinoTabBar to ha…
[cupertino_ui] Remove two items assert to allow CupertinoTabBar to ha…
[cupertino_ui] Remove two items assert to allow CupertinoTabBar to ha…
github-actions commentedon Sep 8, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.