flutter_device_inspector 0.0.2
flutter_device_inspector: ^0.0.2 copied to clipboard
A Flutter plugin to inspect device details like model, RAM, CPU info, OS version, and more.
Flutter Device Inspector ๐ #
A high-performance, cross-platform Flutter plugin for retrieving deep hardware and software specifications. It provides a unified API to access unique device identifiers, hardware metrics (RAM, CPU, Storage), and system identity across Android, iOS, and Web.
๐ Key Features #
- ๐ก๏ธ Constant Unique ID:
- Mobile: Persistent hardware-based identifiers.
- Web: Advanced Fingerprinting (SHA-256) that remains constant even after browser reinstallation.
- ๐พ Memory Insights: Get total physical RAM formatted in GB.
- ๐ Storage Metrics: Retrieve total internal storage capacity in MB.
- โ๏ธ Processor Details: Real-time CPU/Hardware name retrieval.
- ๐ Device Identity: Manufacturer, Brand, and Model detection.
- ๐ Full Web Support: Seamless integration for browser-based Flutter apps.
๐ฆ Installation #
Add this to your pubspec.yaml:
dependencies:
flutter_device_inspector: ^0.0.1
Then run:
flutter pub get
๐ Usage #
1. Unified Device Info (Recommended) #
Fetch all device details in a single asynchronous call using the DeviceInfo model.
import 'package:flutter_device_inspector/flutter_device_inspector.dart';
void getDetails() async {
DeviceInfo info = await FlutterDeviceInspector.getFullInfo();
print('Unique ID: ${info.deviceId}');
print('Model: ${info.model}');
print('RAM: ${info.ram}'); // e.g., "7.45 GB"
print('Storage: ${info.totalStorage}'); // e.g., "121845 MB"
print('CPU: ${info.cpu}'); // e.g., "Snapdragon 865"
print('OS: ${info.osVersion}');
}
2. Individual Property Access #
If you only need a specific piece of information:
String? deviceId = await FlutterDeviceInspector.getDeviceId();
String? ram = await FlutterDeviceInspector.getTotalRam();
String? storage = await FlutterDeviceInspector.getTotalStorage();
๐ฑ Platform Implementation Details #
| Feature | Android | iOS | Web (Browser) |
|---|---|---|---|
| Unique ID | Settings.Secure.ANDROID_ID |
identifierForVendor |
SHA-256 Fingerprint |
| Model | Build.MODEL |
UIDevice.model |
Browser Name (e.g. Chrome) |
| RAM | MemoryInfo.totalMem (GB) |
physicalMemory (GB) |
deviceMemory (GB) |
| Storage | StatFs (MB) |
systemSize (MB) |
Not Accessible |
| CPU | /proc/cpuinfo parsing |
sysctl brand string |
hardwareConcurrency |
| OS Version | Build.VERSION.RELEASE |
systemVersion |
navigator.platform |
๐ About the Web Unique ID #
The Web ID is generated using Browser Fingerprinting. It combines hardware properties (CPU cores, RAM, Screen resolution) and browser metadata to create a unique SHA-256 hash.
- Persistence: Unlike cookies or localStorage, this ID remains the same even if the user uninstalls and reinstalls the browser, as it is derived from the device's hardware signature.
๐งช Example App #
The project includes a premium example app (Material 3) located in the example/ folder. It demonstrates how to build a professional device dashboard using this plugin.
๐ License #
This project is licensed under the MIT License - see the LICENSE file for details.