getDeviceInfo static method

Future<String> getDeviceInfo()

Determine the name of the device.

Implementation

static Future<String> getDeviceInfo() async {
  try {
    if (kIsWeb) {
      return "Web";
    } else {
      if (which_platform.Platform.isAndroid) {
        return "Android";
      } else if (which_platform.Platform.isIOS) {
        return "iOS";
      } else if (which_platform.Platform.isLinux) {
        return "Linux";
      } else if (which_platform.Platform.isMacOS) {
        return "MacOS";
      } else if (which_platform.Platform.isWindows) {
        return "Windows";
      }
    }
  } catch (e) {
    print("could not get device info with err: " + e.toString());
  }
  return "";
}