device_information
0.0.4, released 5 years ago by hinahussaindev.blogspot.com
Flutter plugin to retrieve device details like IMEI, model, API level, and CPU type.
What it does
Provides methods to retrieve device hardware and OS information for both Android and iOS platforms. It fetches details such as device IMEI number, model name, API level, CPU type, and manufacturer name.
AI-written summary of version 0.0.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to gather device-specific metrics and hardware info.
- You need to read the device's IMEI number on supported platforms.
Skip it when
- You require official or widely-maintained device info packages with broader platform support.
- You cannot request runtime phone state permissions on Android.
Strengths
- Supports multiple device identifiers like IMEI, model, and API level.
- Works for both Android and iOS.
Weaknesses
- Requires manual Android permissions for reading phone state.
- Limited documentation and fewer updates compared to official community alternatives.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
In Android, add the READ_PHONE_STATE permission to AndroidManifest.xml and request runtime permissions for API targeting Marshmallow and above.
import 'package:device_information/device_information.dart';
try {
String imeiNo = await DeviceInformation.deviceIMEINumber;
String modelName = await DeviceInformation.deviceModel;
} on PlatformException {
// Handle error
}Alternatives
Packages that do the same job and could replace device_information.
- device_info_plus
It is the official, well-maintained community package for retrieving detailed device information across all Flutter platforms.
93Compare