enum_bit_vector 1.0.0 copy "enum_bit_vector: ^1.0.0" to clipboard
enum_bit_vector: ^1.0.0 copied to clipboard

outdated

Datatype storing a set of enum values as a 64-bit integer

example/main.dart

import 'package:enum_bit_vector/enum_bit_vector.dart';

enum SuperPowers { invisibility, speed, flying, immortality, resistance, psychic }

void main(List<String> arguments) {
  EnumBitVector.registerEnum(SuperPowers.values);
  final enumSet = {
    SuperPowers.flying,
    SuperPowers.resistance,
    SuperPowers.psychic,
  };
  print('enumSet: $enumSet');
  final enumBitVector = EnumBitVector.fromSet(enumSet);
  print('enumBitVector: $enumBitVector');
  print('enumBitVector to int: ${enumBitVector.toInt()}');
  print('enumBitVector to set: ${enumBitVector.toSet()}');
  print('enumBitVector to list: ${enumBitVector.toList()}');
}
2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Datatype storing a set of enum values as a 64-bit integer

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on enum_bit_vector