How to convert string to Uuid in dart

Viewed 2002

Is there any thing in dart that has similar functionally to java or C# to convert a string to a Uuid for example something like:

Uuid test = Uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); 

or

Uuid test = Uuid.FromString('79700043-11eb-1101-80d6-510900000d10');

Thanks.

1 Answers

The uuid package returns a List object:

List<int> bytes = Uuid.parse('79700043-11eb-1101-80d6-510900000d10');

It doesn't use Uuid as an obtainable object but an "Universally Unique IDentifier" (UUID) as a string or as a byte array.

Related