Flutter - Get the Unique Device ID Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Flutter is a UI toolkit developed and maintained by Google. It was released in May 2017 to the public. It is now one of the most popular cross-platform development frameworks among beginners and experienced application developers. It has a straightforward learning curve and uses the Dart programming language for developing the applications. In this article, we will see how we can get the ID of a device in FlutterID. The Device ID can be used to identify the device uniquely. ApproachWe will use the device_info package to get the Information of the device. After that, we can extract the Device ID from that information. The Device ID is of String data type. SyntaxDeviceInfoPlugin deviceInfo = DeviceInfoPlugin();String deviceID = await deviceInfo.androidInfo.androidId;Note: Before running this code, ensure that you have installed the device_info package in your Flutter project. You can do so by running the below command from your project root: flutter pub add device_infoExample Project Dart import 'package:flutter/material.dart'; import 'package:device_info/device_info.dart'; void main() { runApp(const DeviceIDApp()); } class DeviceIDApp extends StatelessWidget { const DeviceIDApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData(primarySwatch: Colors.green), home: const DeviceIDScreen(), ); } } class DeviceIDScreen extends StatefulWidget { const DeviceIDScreen({Key? key}) : super(key: key); @override _DeviceIDScreenState createState() => _DeviceIDScreenState(); } class _DeviceIDScreenState extends State<DeviceIDScreen> { String _deviceID = 'Loading...'; @override void initState() { super.initState(); _getDeviceID(); } Future<void> _getDeviceID() async { DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; setState(() { _deviceID = androidInfo.androidId; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Device ID App'), ), body: Center( child: Text( _deviceID, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 24), ), ), ); } } Output: Comment More infoAdvertise with us Next Article Flutter - Get the Unique Device ID V vpsop Follow Improve Article Tags : Flutter Geeks Premier League 2023 Similar Reads Flutter - Managing Device Orientation All the applications developers create in flutter run on multiple devices with a variety of screen pixels and sizes. Managing screen orientation in flutter plays an important role in establishing a successful app that runs on multiple devices. In flutter, you can pick the best way to deal with such 4 min read How to Get MAC Address of Device in Flutter? Flutter SDK is an open-source software development kit by Google to develop applications for multiple platforms from a single codebase. Sometimes, your app needs to know the MAC address of the device. MAC (Media Access Control) address is the unique identifier of a device on a LAN network. Approach: 2 min read Flutter - Make an HTTP GET Request In app development, the ability to fetch data from external sources, such as REST APIs, is a fundamental requirement. In Flutter, Whether you need to fetch data from a RESTful API, access a database, or retrieve content from a web server, Flutter provides you with the tools and packages(HTTP) to do 5 min read Flutter - Using the Inspector Flutter is based on Widgets and Widget Trees. If you are new to Flutter, imagine Widgets as structures of Data or Classes of Data. And to create a flutter application we nest these Widgets within one another. Flutter Inspector Tool Introduction to Flutter Inspector: Just like in Native android we ca 3 min read Flutter - How to Get Instagram Username Data Flutter is a cross-platform application development toolkit developed and maintained by Google. Flutter redefines cross-platform app development by combining great design with superb capabilities. Flutter was released to the public in 2017, and since then many large corporations have shifted towards 3 min read Like