my_device_info 0.0.1
my_device_info: ^0.0.1 copied to clipboard
A Flutter plugin to retrieve comprehensive device information, including IMEI number, model name, API level, CPU type, product name, and more, with seamless support for both Android and iOS platforms.
My Device Info #
A Flutter plugin to retrieve comprehensive device information, including IMEI number, model name, API level, CPU type, product name, and more, with seamless support for both Android and iOS platforms.
Installation #
Add following dependency in pubspec.yaml file:
my_device_info: ^last_version
Then, run
$ flutter pub get
Set up #
- In android add following permission:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
Usage #
import 'package:my_device_info/my_device_info.dart';
if(Permission.phone.request().isGranted){
try {
platformVersion = await MyDeviceInfo.platformVersion;
imeiNo = await MyDeviceInfo.deviceIMEINumber;
modelName = await MyDeviceInfo.deviceModel;
manufacturer = await MyDeviceInfo.deviceManufacturer;
apiLevel = await MyDeviceInfo.apiLevel;
deviceName = await MyDeviceInfo.deviceName;
productName = await MyDeviceInfo.productName;
cpuType = await MyDeviceInfo.cpuName;
hardware = await MyDeviceInfo.hardware;
} on PlatformException {
platformVersion = 'Failed to get platform version.';
}
}