getOption<T> method

Option<T> getOption<T>(
  1. String name
)

Implementation

Option<T> getOption<T>(String name) {
  final results = options.where((element) => element.name == name);
  if (results.isEmpty) throw 'Cannot find option with name `$name`';
  return results.first as Option<T>;
}