newUuid function

String newUuid({
  1. String prefix = '',
})

Creates a new UUID of version 4.

If prefix is specified, the result string starts with the given prefix.

Implementation

String newUuid({String prefix = ''}) {
    var uuid = Uuid();
    return '${prefix}${uuid.v4()}';
}