stryder-dev / flutter_platform_widgets

Target the specific design of Material for Android and Cupertino for iOS widgets through a common set of Platform aware widgets
MIT License
1.58k stars 171 forks source link

Nav Rail strategies Adaptvie nav #331

Open fredgrott opened 2 years ago

fredgrott commented 2 years ago

So came up with a nice adaptive nav scaffold solution to do nav rails, sidesheet, and tabbed bottom and drawer correctly dynamically per screensize.

Then I realized that I did it using Material AppBar and Scaffolds.

I can work out how to account for Platform Flutter Widgets appbar stuff.

On scaffolds would the right strategy be to keep it as a Material scaffold then through platform detection still serve up the correct platform screen transitions?

From what I remember about FPW internals it would seem that would be my best strategy to take care of delivering the right screen transitions per platform.

Thanks.

PS Did work out a nice FPW Theme strategy that addresses the ColorScheme widget theme transition migration and will update and share the article and codelinks when I have published it.

aqwert commented 2 years ago

Thanks.

There is nothing stopping anyone from using the MaterialApp but use the platform specific routing. Same goes for Scaffolds. Problem is when it gets down to the page or component level ideally the PlatformScaffold is used if you want to have an iOS looking page.

When there is a divergence that far off the PlatformScaffold I tend to use the PlatformWidgetBuilder to pick the correct widget.

This package is better if the design choices between material and cupertino are not that far off eachother. Things like the Drawer menu for iOS would be nice but I guess it was not added since it is not part of the standard iOS style guide

fredgrott commented 2 years ago

@aqwert

I just notice that the new MD3 navigation bar is in the sdk beta so I am porting the adaptive navigation pattern that the Material IO team did up in a package called adaptive navigation.

From what I can see I amjust using the material scaffolds I do not even haveto theuse the PlatformWidgetbuilder .

The only point where I diverge from the way Material IO team did adaptive nav is to maybe adjust the top appbar size per platform to play nice with Apple HUI guidelines.

Side Note: its better to leave ThemeMode to material only as it matches your decision to not have high contrast themes in material side as they are just repeats of the other two themes. One can adjust the text themes for color on contrast modes as we have a non-context way to detect high contrast.

I do like the platformThemeData method, its really handy!