Skip to main content

value_group 0.1.0 copy "value_group: ^0.1.0" to clipboard
value_group: ^0.1.0 copied to clipboard

An ordered, immutable group that distinguishes zero, one, and multiple values by type.

example/value_group_example.dart

import 'package:value_group/value_group.dart';

void main() {
  final selected = Group<String>.from(['A', 'A', 'B']);
  const empty = Group<String>.empty();
  final group = empty.merge(other: selected, distinct: true);

  final label = switch (group) {
    EmptyGroup<String>() => 'None',
    SingleGroup<String>(:final value) => value,
    MultipleGroup<String>(:final values) => values.join(', '),
  };
  print(label); // A, B
}
0
likes
150
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

An ordered, immutable group that distinguishes zero, one, and multiple values by type.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

equatable

More

Packages that depend on value_group