Language:
Portfolio

Search

Generating UUIDs in Flutter | Dart

  • Share this:
post-title

UUIDs can be used to differentiate data. Today we will learn how to generate random UUIDs in Flutter using Dart.

Step 1: First we will add a library as shown below

w-1


 

Step 2: After that, we will import the library 

ww

 

Step 3: Then we will create an object of Uuid() Class, with the help of this object we will be able to generate random UUIDs.

w2

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

w3
 

Step 5: After writing the code we will run the application and will get the following response.

w4
 

Video Tutorial:

 

Source Code:

https://github.com/ammarjavedofficial/uuids-flutter-dart

Ammar Javed

Ammar Javed

Still Learning | Still Searching | Still Exploring | The secret of your success is determined by your daily agenda.