Closed mikaelho closed 1 year ago
Fantastic work! Works like a charm on Windows and in browser with the upcoming build (built with dev
channel of Flutter).
I'd love to use it for "Flet Gallery" app I'm about to start.
Some quick thoughts:
http://localhost:8550/menu-width
would open the last page from your example.ResponsiveLayout
?Form
component and I also have an idea for Wizard
) built from Flet controls only? Separate "out-of-band" repo with Python package (flet-contrib
) to iterate faster or main repo to have everything under flet
namespace?Good comments!
ResponsiveMenuLayout
, as it controls the layout of the menu only, not the AppBar or really the content area.ResponsiveMenuLayout
this could be feasible, but for something like the Form
maybe not, due to the central role of data classes and pydantic there.Added the leading control example to the demo, as discussed in Discord (see last image in the description).
What if we put community examples/apps/components to python/community
directory? Would you mind changing your PR? We could figure out later how to package/demo them.
I meant putting your control inside a directory under python/community/responsive_menu_layout/main.py
directory, so you can additionally put README.md
in the root there with a description from this PR and images for readme could be put into python/community/responsive_menu_layout/images
. Sorry about the hassle!
Here is an example: https://github.com/flet-dev/examples/pull/14/files
Done -- except I left the images where they are on Github, because I am lazy.
ResponsiveMenuLayout
has enough features that it could almost be a control, and the demo app would be just using it. But now still in one file, and nothing prevents taking the file as-is and just importing theResponsiveMenuLayout
from it.Basic landscape layout, menu shown by default
Landscape layout, menu thinner
This is a parameter and a toggle in the demo app.
Landscape layout, menu hidden (completely by default)
Landscape layout, menu shown as icons only instead of hidden
This is a parameter of ResponsiveMenu, and a toggle in the demo app.
Basic portrait layout, menu hidden by default
Portrait layout, menu when shown is on top of the main content
Menu can be dismissed also by clicking outside the menu panel.
Portrait layout, menu can also be minimized to icons instead of being hidden
With the
minimize_to_icons
parameter, controlled by a toggle in the demo app. Minimizing behavior can also be controlled separately in each orientation by thelandscape_minimize_to_icons
andportrait_minimize_to_icons
parameters.Route support
Routes are supported by default in the web (selected page slug is part of the url, page can be opened directly with the right url).
Fine-tuning the NavigationRail
NavigationRail can be accessed to make changes directly, although there are some parameters that should be avoided.