Created
October 9, 2019 16:51
-
-
Save cetorres/6c754a8aefd53df9c1d476374475fc44 to your computer and use it in GitHub Desktop.
Detect iPhone X or greater in Flutter / Dart
This file contains 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
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