flutter-folio icon indicating copy to clipboard operation
flutter-folio copied to clipboard

Respectfully, I am disappointed that this is Flutter official reference for Adaptive Apps

Open mariopepe opened this issue 2 years ago • 0 comments

No need to add a description too detailed, it's enough to check one file in the repo such as lib/views/auth_page/auth_page.dart

 AppTheme theme = context.watch();
    // This view will switch from row/col based on available width
    bool useVerticalLayout = context.widthPx < 700;
    // Calculate how wide or tall we want the form to be. Use golden ratio for nice aesthetics.
    double formWidth = max(500, context.widthPx * .382);
    double formHeight = max(500, context.heightPx * .382);
    // When we don't have enough vertical height, and are in portrait mode, we need to hide the devices.
    bool hideDevices = useVerticalLayout && context.heightPx < formHeight + 150;
    Color formBgColor = useVerticalLayout ? theme.surface2 : theme.surface1;

The one above is a widget, I kid you not, and yes the values 500, .382, + 150, etc. are hardcoded and hand written repeatedly.

Thats's it, nothing else to add.

mariopepe avatar Nov 17 '23 13:11 mariopepe