device_information

Creator: coderz1093

Last updated:

0 purchases

device_information Image
device_information Images

Languages

Categories

Add to Cart

Description:

device information

Device Information #
A flutter plugin to get device information such as device IMEI number, model name, API level,CPU Type,Product Name etc for both android & iOS.
Installation #
Add following dependency in pubspec.yaml file:
device_information:^0.0.4
copied to clipboard
Install by running:
$ flutter pub get
copied to clipboard
Usage #
import 'package:device_information/device_information.dart';

try {
platformVersion = await DeviceInformation.platformVersion;
imeiNo = await DeviceInformation.deviceIMEINumber;
modelName = await DeviceInformation.deviceModel;
manufacturer = await DeviceInformation.deviceManufacturer;
apiLevel = await DeviceInformation.apiLevel;
deviceName = await DeviceInformation.deviceName;
productName = await DeviceInformation.productName;
cpuType = await DeviceInformation.cpuName;
hardware = await DeviceInformation.hardware;
} on PlatformException {
platformVersion = 'Failed to get platform version.';
}
copied to clipboard
In android add the following permission:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
copied to clipboard
Then for API targetting from Marshmallow, need to request runtime permissions.
Although in iOS there is no need to specify permissions.
Contributing #
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Developer Team: #
Hina Hussain & her team members (Kamran Khan, Abdul Sattar, Faiza Farooqui) 😄 🎉
Follow me #
https://hina-hussain-developer.medium.com/creating-publisher-account-on-the-pub-dev-cf86b91cd2f
https://hinahussaindev.blogspot.com/2021/05/creating-publisher-account-on-pubdev.html
License #
MIT

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.