Created
December 28, 2025 20:27
-
-
Save fredgrott/4f4bbe865ba9e27ebfc706a478433035 to your computer and use it in GitHub Desktop.
window height api calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final windowHeight = WindowHeight.of(context); | |
| if (windowHeight == WindowHeight.compact) { | |
| // Adapt UI for limited vertical space | |
| } | |
| Widget build(BuildContext context) { | |
| final windowHeight = WindowHeight.of(context); | |
| // This value can change during the app's lifetime | |
| // Adapt your layout based on available vertical space... | |
| } | |
| final windowHeight = WindowHeight.fromHeight(600); // Returns medium | |
| final windowHeight = WindowHeight.fromHeight(1000); // Returns expanded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment