address property
Implementation
String get address {
String address = "";
for (int i = 0; i < 5; i++) {
address += ByteUtils.byteToHexString(addr[i]) + ":";
}
address += ByteUtils.byteToHexString(addr[5]);
return address;
}
Implementation
set address(String address) {
RegExp exp = new RegExp(r"^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$");
if (exp.hasMatch(address)) {
var nums = address.split(new RegExp("[-:]"));
var bts = <int>[];
assert(nums.length == 6);
for (var n in nums) {
bts.add(int.parse(n, radix: 16));
}
addr = new Uint8List.fromList(bts);
} else {
throw ArgumentError("Pattern of adress string is wrong, got $address");
}
}