isPhone method
Returns true if Android OS is active. Returns true if device is an iPhone. A phone is also a tablet, but if a tablet is a phone additionally, layout specifics will apply.
Implementation
//bool isAndroidOS() {
// bool is_android = false;
// if (window.navigator.userAgent.toLowerCase().contains("android"))
// is_android = true;
// return is_android;
//}
/// Returns true if device is an iPhone. A phone is also a tablet,
/// but if a tablet is a phone additionally, layout specifics will apply.
static bool isPhone() {
bool phone = false;
if (window.navigator.userAgent.toLowerCase().contains("iphone") &&
window.navigator.vendor.contains("Apple Computer")) phone = true;
// return true; // For testing iphone on PC. TODO remove
return phone;
}