Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mariopepe opened this issue Nov 17, 2023 · 0 comments

Comments

@mariopepe
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant