DeviceInfo class
Snapshot of device and app info collected from the native platform.
Populated via DeviceInfo.fromJson from the map returned by the native
method channel implementation. Fields that don't apply to the current
platform are left at their default value (empty string, 0, or false).
Constructors
-
DeviceInfo({String versionNumber = '', String buildNumber = '', String displayName = '', String bundleName = '', String uuid = '', String locales = '', String timeZone = '', String alphaCode = '', LocaleApp localeApp = const LocaleApp(), bool isLowRamDevice = false, int physicalRamSize = 0, int availableRamSize = 0, int totalRam = 0, String board = '', String bootloader = '', String device = '', String display = '', String fingerprint = '', String hardware = '', String host = '', String buildId = '', String product = '', List<
String> supported32BitAbis = const [], List<String> supported64BitAbis = const [], List<String> supportedAbis = const [], String tags = '', String type = '', List<String> systemFeatures = const [], String deviceName = '', String modelName = '', String localizedModel = '', bool isiOSAppOnMac = false, String brand = '', String manufacturer = '', String model = '', String systemName = '', String systemVersion = '', bool isPhysicalDevice = true, int freeDiskSize = 0, int totalDiskSize = 0, Utsname utsname = const Utsname()}) - Creates a DeviceInfo with the given fields, defaulting to empty/zero values for anything not provided.
- DeviceInfo.fromJson(Map json)
- Builds a DeviceInfo from the map returned by the native platform.
Properties
- alphaCode → String
-
ISO 3166-1 alpha-2 country code derived from the device locale (e.g. "VN").
final
- areaCode → String
-
International dial code derived from alphaCode (e.g. "VN" -> "84").
Computed on read so it can never diverge from alphaCode.
no setter
- availableRamSize → int
-
Currently available RAM size, in megabytes.
final
- board → String
-
Android-only. The underlying board name.
final
- bootloader → String
-
Android-only. The bootloader version.
final
- brand → String
-
The device brand.
final
- buildId → String
-
Android-only. The changelist/build id.
final
- buildNumber → String
-
The app's build number (e.g. "42").
final
- bundleName → String
-
The app's bundle/package identifier.
final
- device → String
-
Android-only. The industrial design name of the device.
final
- deviceName → String
-
iOS-only. The user-assigned device name.
final
- display → String
-
Android-only. A human-readable build display id.
final
- displayName → String
-
The app's display name shown to the user.
final
- fingerprint → String
-
Android-only. A string that uniquely identifies this build.
final
- freeDiskSize → int
-
Free disk space, in bytes.
final
- hardware → String
-
Android-only. The hardware name.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
Android-only. The host that built this build.
final
- isiOSAppOnMac → bool
-
iOS-only. Whether the app is running on a Mac via Mac Catalyst/iOS-on-Mac.
final
- isLowRamDevice → bool
-
Whether the OS considers this device a low-RAM device.
final
- isPhysicalDevice → bool
-
Whether this is a physical device, as opposed to a simulator/emulator.
final
- localeApp → LocaleApp
-
The device's language and country locale, split into components.
final
- locales → String
-
The device's current locale identifier (e.g. "en_US").
final
- localizedModel → String
-
iOS-only. The localized model name (e.g. "iPhone").
final
- manufacturer → String
-
The device manufacturer.
final
- model → String
-
Device model. Not equivalent across platforms: on Android this is
the specific hardware model (
Build.MODEL, e.g. "SM-G991B"); on iOS this is only the generic device type (UIDevice.current.model, e.g. "iPhone" or "iPad"). For the specific iOS hardware identifier (e.g. "iPhone14,2"), use modelName instead.final - modelName → String
-
iOS-only. The specific hardware identifier (e.g. "iPhone14,2").
final
- physicalRamSize → int
-
Total physical RAM size, in megabytes.
final
- product → String
-
Android-only. The end-user visible name for the overall product.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
supported32BitAbis
→ List<
String> -
Android-only. Supported 32-bit ABIs.
final
-
supported64BitAbis
→ List<
String> -
Android-only. Supported 64-bit ABIs.
final
-
supportedAbis
→ List<
String> -
Android-only. All ABIs supported by the device, ordered by preference.
final
-
systemFeatures
→ List<
String> -
Android-only. System features reported by the device's package manager.
final
- systemName → String
-
The operating system name (e.g. "Android", "iOS").
final
- systemVersion → String
-
The operating system version (e.g. "14").
final
-
Android-only. Comma-separated tags describing the build.
final
- timeZone → String
-
The device's current time zone identifier (e.g. "Asia/Ho_Chi_Minh").
final
- totalDiskSize → int
-
Total disk space, in bytes.
final
- totalRam → int
-
Total RAM bucketed to the nearest marketed size (in GB): 2, 4, or 6.
final
- type → String
-
Android-only. The build type (e.g. "user", "eng").
final
- utsname → Utsname
-
POSIX
uname()info for the device.final - uuid → String
-
A unique identifier for the device.
final
- versionNumber → String
-
The app's version number (e.g. "1.0.0"), as declared in the app manifest.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes this DeviceInfo to a JSON-compatible map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited