Skip to content

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

@mariopepe

Description

@mariopepe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions