get_device_signature 0.0.3 copy "get_device_signature: ^0.0.3" to clipboard
get_device_signature: ^0.0.3 copied to clipboard

A Flutter plugin to retrieve the device's app signature.

example/lib/main.dart

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

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

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

  // Fetch device signature
  Future<void> initDeviceSignature() async {
    String deviceSignature;
    try {
      deviceSignature =
          await GetDeviceSignature.getSignature() ?? 'Unknown signature';
    } on PlatformException {
      deviceSignature = 'Failed to get device signature.';
    }

    if (!mounted) return;

    setState(() {
      _deviceSignature = deviceSignature;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Device Signature Example'),
        ),
        body: Center(
          child: Text('Device Signature: $_deviceSignature\n'),
        ),
      ),
    );
  }
}
2
likes
150
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to retrieve the device's app signature.

Repository (GitHub)

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on get_device_signature

Packages that implement get_device_signature