m8ty_device_info
Flutter package that provides device information including device IDs, user agents, screen resolution, and package info across all platforms (Android, iOS, Web, macOS, Windows, Linux).
Initialization
Always call initialize() before using any other method:
API Surface
Method | Description |
|---|---|
| Persistent device ID (generated once, stored in SharedPreferences) |
| Platform-specific user agent string |
| App name, version, build number |
| Combined system details map |
| Screen resolution as |
| Android SDK version (null on non-Android) |
Usage
Key Rules
Use
M8tyDeviceInfo.instance— never construct it directly.Results for
getDeviceId()andgetUserAgent()are cached in memory after the first call.getDeviceId()generates a UUID-based 16-character ID on first use and persists it viaSharedPreferences.Use
M8tyDeviceInfo.clearCache()only in tests or when device info may have changed.