device_id 0.1.0 copy "device_id: ^0.1.0" to clipboard
device_id: ^0.1.0 copied to clipboard

discontinued
outdatedDart 1 only

Plugin for retrieving uids.

example/lib/main.dart

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

import 'package:device_id/device_id.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _deviceid = 'Unknown';

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

  Future<void> initDeviceId() async {
    String deviceid;

    deviceid = await DeviceId.getID;

    if (!mounted) return;

    setState(() {
      _deviceid = deviceid;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Device Id example app'),
        ),
        body: new Center(
          child: new Text('Your device id: $_deviceid'),
        ),
      ),
    );
  }
}
24
likes
0
pub points
86%
popularity

Publisher

unverified uploader

Plugin for retrieving uids.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on device_id