Skip to content

Add 1240dp breakpoint to flutter_adaptive_scaffold #118932

@FelixZY

Description

@FelixZY

Use case

I want to switch from a NavigationRail to a NavigationDrawer at 1240 dp width in accordance with documentation:

Standard navigation drawers are best for screens at large breakpoints of 1240dp or greater.
https://m3.material.io/components/navigation-drawer/guidelines

Proposal

Add a new extraLarge breakpoint at 1240 dp to Breakpoints:

  // ...

-  static const Breakpoint large = WidthPlatformBreakpoint(begin: 840);
+  /// A desktop window whose width is between 840 dp and 1240 dp.
+  static const Breakpoint large = WidthPlatformBreakpoint(begin: 840, end: 1240);

  /// A window whose width is greater than 840 dp.
+  static const Breakpoint largeAndUp = WidthPlatformBreakpoint(begin: 840);

-  /// A desktop window whose width is greater than 840 dp.
+  /// A desktop window whose width is between 840 dp and 1240 dp.
  static const Breakpoint largeDesktop =
-      WidthPlatformBreakpoint(begin: 840, platform: _desktop);
+      WidthPlatformBreakpoint(begin: 840, end: 1240, platform: _desktop);

+  /// A window whose width is greater than 1240 dp.
+  static const Breakpoint extraLarge = WidthPlatformBreakpoint(begin: 1240);

+  /// A desktop window whose width is greater than 1240 dp.
+  static const Breakpoint extraLargeDesktop =
+      WidthPlatformBreakpoint(begin: 1240, platform: _desktop);

  // ...

Notes

I currently work around this using a CustomBreakpoints class. However, since 1240 dp is defined in the design documentation, I think it should be supported out of the box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: flutter_adaptive_scaffoldThe flutter_adaptive_scaffold packagepackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions