flutter_android_info 1.0.1 copy "flutter_android_info: ^1.0.1" to clipboard
flutter_android_info: ^1.0.1 copied to clipboard

PlatformAndroid

A flutter plugin to get android information such as Build Info & DevideId & ApkMd5

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter_android_info/flutter_android_info.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String versionRelease = '';
  String brand = '';
  String model = '';
  String device = '';
  String buildId = '';
  String androidId = '';
  String deviceId = '';
  String apkMd5 = '';

  @override
  void initState() {
    super.initState();
  }

  Future<void> getAndroidInfo() async {
    versionRelease = await FlutterAndroidInfo.versionRelease() ?? '';
    brand = await FlutterAndroidInfo.brand() ?? '';
    model = await FlutterAndroidInfo.model() ?? '';
    device = await FlutterAndroidInfo.device() ?? '';
    buildId = await FlutterAndroidInfo.buildId() ?? '';
    androidId = await FlutterAndroidInfo.androidId() ?? '';
    deviceId = await FlutterAndroidInfo.deviceId() ?? '';
    apkMd5 = await FlutterAndroidInfo.apkMd5() ?? '';
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('flutter_android_info example app'),
        ),
        body: Center(
            child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Text('Version Release: $versionRelease'),
            Text('Brand: $brand'),
            Text('Model: $model'),
            Text('Device: $device'),
            Text('Build ID: $buildId'),
            Text('Android ID: $androidId'),
            Text('Device ID: $deviceId'),
            Text('Apk Md5: $apkMd5'),
            TextButton(
                onPressed: getAndroidInfo,
                child: const Text('Get Android Info'))
          ],
        )),
      ),
    );
  }
}
1
likes
160
pub points
53%
popularity

Publisher

verified publisherrwscode.com

A flutter plugin to get android information such as Build Info & DevideId & ApkMd5

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_android_info