The Flutter UUID is a unique identification for Android and iOS devices. It can be used to generate a unique identifier for the device, which can be valuable in a variety of scenarios.
The UUID Flutter is composed of three parts:
- A first part is a 16-bit number created at random that identifies the device's manufacturer.
- A second part is an 8-bit number that specifies the type of device.
- A third part is another 16-bit number that identifies the individual phone or tablet.
UUIDs can be used to differentiate data. Today we will learn how to generate random UUIDs in Flutter using Dart.
The DART UUID package produces universally unique identifiers. It offers a straightforward API for generating UUIDs that are guaranteed to be unique over space and time. Because UUIDs are generated based on time and a random number, they are neither predictable nor reproducible.
Step 1: First we will add a library as shown below.
Step 2: After that, we will import the library.
Step 3: Then we will create an object of the Uuid() Class, with the help of this object we will be able to generate random UUIDs.
Step 4: In body property will first use Column Widget (no restrictions you can use any widget) and in Column widget, we will use children property because it allows us that we can use the list of widgets, and then we will use Card widget and in Card widget, we will use child argument/property and in child property, we will use ListTile widget. Then in ListTile widget, we will use two properties, the first title then subtitle and in these both properties we will use Text widget as shown below
Step 5: After writing the code we will run the application and will get the following response.