-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repositoryframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
We should always be agnostic about the child widget type, otherwise it violates our composition model.
There's basically two principles we can apply here:
-
Wrapping a widget X in a widget Y that does nothing but return the widget X should always work exactly the same as using X directly. For example, wrapping a Text in a Tooltip should always work.
-
Replacing a widget X with an entirely independent widget Y that happens to be implemented exactly the same way should always work exactly the same as using X directly.
Ideally, anywhere you accept a Widget you should accept a Placeholder or a widget equivalent to Placeholder, and act the same as if you'd gotten anything else.
Places I've noticed where we violate this:
- CupertinoNavigationBar.middle + CupertinoNavigationBar.largeTitle, we assert that
middle is Text. - CupertinoScaffold.tabbed requires a CupertinoTabBar.
- CupertinoScaffold.navigationBar is handled differently if it is a CupertinoNavigationBar
adriancmurray, JaspervanRiet, KagurazakaHanabi and justinmc
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repositoryframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team