flagsEIR property

List<String>? get flagsEIR

Implementation

List<String>? get flagsEIR {
  if (attributes.containsKey(EIRType.Flags)) {
    var names = <String>[];
    var value = attributes[EIRType.Flags]![0];
    for (var i = 0; i < flagsList.length; i++) {
      if (value >> i & 1 == 1) {
        names.add(flagsList[i]);
      }
    }
    return names;
  } else {
    return null;
  }
}
set flagsEIR (List<String>? flags)

Implementation

set flagsEIR(List<String>? flags) {
  int value = 0;
  for (int i = 0; i < flags!.length; i++) {
    if (!flagsList.contains(flags[i])) {
      throw ArgumentError("Flag ${flags[i]} is not correct");
    }
    value += 1 << flagsList.indexOf(flags[i]);
  }
  attributes[EIRType.Flags] = Uint8List.fromList([value]);
}