Skip to content

Instantly share code, notes, and snippets.

@sbis04
Created June 24, 2019 12:28
Show Gist options
  • Save sbis04/90012a6ccdace4600a6477b4c511d329 to your computer and use it in GitHub Desktop.
Save sbis04/90012a6ccdace4600a6477b4c511d329 to your computer and use it in GitHub Desktop.
flutter_os_start_1
WatchShape(
builder: (context, shape) {
var screenSize = MediaQuery.of(context).size;
final shape = InheritedShape.of(context).shape;
if (shape == Shape.round) {
// boxInsetLength requires radius, so divide by 2
screenSize = Size(boxInsetLength(screenSize.width / 2),
boxInsetLength(screenSize.height / 2));
}
var screenHeight = screenSize.height;
var screenWidth = screenSize.width;
......
},
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment