Group constructor Null safety

Group(
  1. String name,
  2. String description,
  3. {Iterable<String> aliases = const [],
  4. Iterable<GroupMixin> children = const [],
  5. Iterable<AbstractCheck> checks = const []}
)

Construct a new Group

Implementation

Group(
  this.name,
  this.description, {
  this.aliases = const [],
  Iterable<GroupMixin> children = const [],
  Iterable<AbstractCheck> checks = const [],
}) {
  if (!commandNameRegexp.hasMatch(name) || name != name.toLowerCase()) {
    throw CommandRegistrationError('Invalid group name "$name"');
  }

  for (final child in children) {
    addCommand(child);
  }

  for (final check in checks) {
    super.check(check);
  }
}