flutter_device_information 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 56

flutter_device_information #

Introduction #

A plugin for using Android devices information in Flutter. You can use it to get Android release version,Android API version,board name,brand name,model name, cpu ABI etc.

Features #

Supports in Android now.

  • get release version.
  • get API version(SDKINT).
  • get board name.
  • get brand name.
  • get model name.
  • get CPUABI.

Getting Started #

For help getting started with Flutter, view the online Flutter Documentation.

1.In your flutter project add the dependency: #

  flutter_devices_information: any

2.import flutter_device_information.dart

import 'package:flutter_device_information/flutter_device_information.dart';
Your code here.

3.Use methods in library. #

Future<void> getInfos() async {
  String platformVersion = await FlutterDeviceInformation.platformVersion;
  String sdkInt = await FlutterDeviceInformation.sdkInt;
  String board = await FlutterDeviceInformation.board;
  String brand = await FlutterDeviceInformation.brand;
  String model = await FlutterDeviceInformation.model;
  String cpuABI = await FlutterDeviceInformation.cpuAbi;

Examples #

Here is Examples. You can find the sample codes and the screenshot in it.

More documentations #

For help getting started with the library, view the online documentation.

Request issues #

Please request bugs at the issue tracker.

License #

More infomation here: License.

0.1.3 #

use new Flutter Plugin and refix some docs.

0.1.2 #

  • Refix some erors.

0.1.1 #

  • Refix the documentations.

0.1.0 #

  • Refix the documentations and modify some bugs.Add more samples.

0.0.1 #

  • First commit.The library provided how to get android devices informations.


flutter_device_information_example #

Introduce #

Demonstrates how to use the flutter_device_information plugin.

Getting Started #

For help getting started with Flutter, view the online Flutter Documentation.

Sample Codes #

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_device_information/flutter_device_information.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() {
    return _MyAppState();

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  String _sdkInt = 'Unknown';
  String _board = 'Unknown';
  String _brand = 'Unknown';
  String _model = 'Unknown';
  String _cpuAbi = 'Unknown';

  void initState() {

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    String sdkInt;
    String board;
    String brand;
    String model;
    String cpuAbi;

    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      platformVersion = await FlutterDeviceInformation.platformVersion;
      sdkInt = await FlutterDeviceInformation.sdkInt;
      board = await FlutterDeviceInformation.board;
      brand = await FlutterDeviceInformation.brand;
      model = await FlutterDeviceInformation.model;
      cpuAbi = await FlutterDeviceInformation.cpuAbi;
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
      sdkInt = 'Failed to get sdkInt version.';
      board = 'Failed to get preViewSdkInt version.';
      brand = 'Failed to get platform version.';
      model = 'Failed to get codeName.';
      cpuAbi = 'Failed to get CPUABI.';

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
      _sdkInt = sdkInt;
      _board = board;
      _brand = brand;
      _model = model;
      _cpuAbi = cpuAbi;

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        body: Center(
          //          child: Text('Running on: $_platformVersion\n'),
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[

Screenshot #


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_device_information: ^0.1.3

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_device_information/flutter_device_information.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies