IdUid.fromString constructor

IdUid.fromString(
  1. String str
)

Implementation

IdUid.fromString(String str) {
  if (str == null || str == '' || str == '0:0') {
    _id = 0;
    _uid = 0;
    return;
  }

  var spl = str.split(':');
  if (spl.length != 2) {
    throw Exception(
        'IdUid has invalid format, wrong number of columns: $str');
  }
  id = int.parse(spl[0]);
  uid = int.parse(spl[1]);
}