Username.fromString constructor

Username.fromString(
  1. dynamic obj
)

Converts obj to a Username by calling .toString on that object. If it is already a Username, obj is returned

Implementation

factory Username.fromString(dynamic obj) {
  if (obj is Username) {
    return obj;
  }
  return Username(obj.toString());
}