flutter_id 0.0.1 copy "flutter_id: ^0.0.1" to clipboard
flutter_id: ^0.0.1 copied to clipboard

A Flutter plugin that retrieves a stable device identifier across iOS, Android, macOS, Windows, and Linux, designed to remain consistent after app reinstall.

flutter_id #

一个用于获取设备唯一标识的 Flutter 插件。核心目标是提供稳定的设备 ID:在正常情况下,即使删除并重新安装 App,ID 也不会改变。

功能 #

  • 获取设备 ID:getDeviceId()(稳定性优先,卸载重装不变)

安装 #

pubspec.yaml 中添加:

dependencies:
  flutter_id:

使用 #

import 'package:flutter_id/flutter_id.dart';

final flutterId = FlutterId();
final deviceId = await flutterId.getDeviceId();

平台实现说明 #

  • iOS:使用 Keychain 保存 UUID,卸载重装仍可读取。
  • Android:使用 Widevine 设备唯一 ID(MediaDrm)生成稳定标识。
  • macOS:读取 IOPlatformUUID。
  • Windows:读取系统 UUID(wmic csproduct get UUID)。
  • Linux:读取系统 UUID(dmidecode -s system-uuid)。

稳定性说明 #

设备 ID 的稳定性取决于平台底层标识是否被重置,例如系统重装、硬件更换、Keychain/DRM 记录被清除等。正常情况下,卸载重装 App 不会改变设备 ID。

许可 #

LICENSE

0
likes
155
points
--
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that retrieves a stable device identifier across iOS, Android, macOS, Windows, and Linux, designed to remain consistent after app reinstall.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_id

Packages that implement flutter_id