better_uuid 0.1.2 better_uuid: ^0.1.2 copied to clipboard
A better uuid package for dart. Create unique IDs without the risk of collisions that other ID generation methods have.
import 'package:better_uuid/uuid.dart';
class User {
Uuid id;
String username;
User(this.id, this.username);
User.create(this.username) {
id = Uuid.v4();
}
}
void main() {
var john = User.create("johndoe");
var james = User.create("james");
assert(john.id != james.id);
}