tree: 3515b2be5b71675f83c65f59d17bb33b3711b796 [path history] [tgz]
  1. android/
  2. example/
  3. ios/
  4. lib/
  5. CHANGELOG.md
  6. device_info_android.iml
  7. LICENSE
  8. pubspec.yaml
  9. README.md
packages/device_info/README.md

device_info

Get current device information from within the Flutter application.

Usage

Import package:device_info/device_info.dart, instantiate DeviceInfoPlugin and use the Android and iOS getters to get platform-specific device information.

Example:

import 'package:device_info/device_info.dart';

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
print('Running on ${androidInfo.model}');  // e.g. "Moto G (4)"

IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
print('Running on ${iosInfo.utsname.machine}');  // e.g. "iPod7,1"

You will find links to the API docs on the pub page.

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.