Skip to content

Instantly share code, notes, and snippets.

@cetorres
Created October 9, 2019 16:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cetorres/6c754a8aefd53df9c1d476374475fc44 to your computer and use it in GitHub Desktop.
Save cetorres/6c754a8aefd53df9c1d476374475fc44 to your computer and use it in GitHub Desktop.
Detect iPhone X or greater in Flutter / Dart
class DetectiPhoneXOrGreater {
static bool isiPhoneXOrGreater(context) {
if (Platform.isAndroid) {
return false;
}
else if (Platform.isIOS) {
double height = MediaQuery.of(context).size.height;
if (height >= 812.0) return true;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment