height property
double
get
height
Safely gets the screen height, handling cases where context might not be available
Implementation
static double get height {
try {
BuildContext? context = getSafeModalContext();
if (context != null) {
try {
return MediaQuery.of(context).size.height;
} catch (e) {
// MediaQuery failed, try Get.height
try {
return Get.height;
} catch (e) {
// Fallback to default
return 800.0;
}
}
} else {
// No context, try Get.height
try {
return Get.height;
} catch (e) {
// Fallback to default
return 800.0;
}
}
} catch (e) {
// Complete fallback
return 800.0;
}
}