-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: flutter_adaptive_scaffoldThe flutter_adaptive_scaffold packageThe flutter_adaptive_scaffold packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
This can be common to display on Desktop and table an AppBar to show widget (eg. Search field) like in Gmail.
Today this is impossible because the logic prevent that in the AdaptiveScaffold
appBar: widget.drawerBreakpoint.isActive(context) && widget.useDrawer
? widget.appBar ?? AppBar()
: null,
Proposal
This can be fixed by adding a new property to the Widget => Breakpoint? appBarBreakpoint
This way we are not breaking the API and can display an AppBar is needed on defined breakpoints. It also not relying on the useDrawer flag!
appBar: widget.drawerBreakpoint.isActive(context) && widget.useDrawer ||
(widget.appBarBreakpoint?.isActive(context) ?? false)
? widget.appBar ?? AppBar()
: null,
This way we can use the AdaptiveScaffold
final double leadingWidth =
Breakpoints.large.isActive(context) ? 192 : 72;
return Theme(
data: Theme.of(context).copyWith(
appBarTheme: AppBarTheme.of(context).copyWith(
backgroundColor: Colors.grey.shade200,
iconTheme:
IconTheme.of(context).copyWith(color: Colors.grey))),
child: AdaptiveScaffold(
appBar: MyCustomAppBar(leadingWidth: leadingWidth),
appBarBreakpoint: Breakpoints.smallAndUp,
...
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: flutter_adaptive_scaffoldThe flutter_adaptive_scaffold packageThe flutter_adaptive_scaffold packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team


