getDeviceType method

DeviceType getDeviceType()

Implementation

DeviceType getDeviceType() {
  DeviceType deviceType;
  if (kIsWeb) {
    deviceType = DeviceType.web;
  } else {
    switch (defaultTargetPlatform) {
      case TargetPlatform.android:
        deviceType = DeviceType.android;
        break;
      case TargetPlatform.iOS:
        deviceType = DeviceType.ios;
        break;
      case TargetPlatform.windows:
        deviceType = DeviceType.windows;
        break;
      case TargetPlatform.macOS:
        deviceType = DeviceType.mac;
        break;
      case TargetPlatform.linux:
        deviceType = DeviceType.linux;
        break;
      case TargetPlatform.fuchsia:
        deviceType = DeviceType.fuschia;
        break;
    }
  }
  return deviceType;
}