flutter_udid 2.1.0 copy "flutter_udid: ^2.1.0" to clipboard
flutter_udid: ^2.1.0 copied to clipboard

Plugin to retrieve a persistent UDID across reinstalls on iOS and Android

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:flutter_udid/flutter_udid.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 _udid = 'Unknown';

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

  Future<void> initPlatformState() async {
    String udid;
    try {
      udid = await FlutterUdid.udid;
    } on PlatformException {
      udid = 'Failed to get UDID.';
    }

    if (!mounted) return;

    setState(() {
      _udid = udid;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_udid\n'),
        ),
      ),
    );
  }
}
202
likes
0
pub points
98%
popularity

Publisher

verified publisherkukuk.me

Plugin to retrieve a persistent UDID across reinstalls on iOS and Android

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, flutter

More

Packages that depend on flutter_udid