flagValue function

bool? flagValue(
  1. ArgResults? argResults,
  2. String name
)

Implementation

bool? flagValue(ArgResults? argResults, String name) {
  if (argResults == null || argResults[name] == null) {
    return null;
  }
  if (argResults[name] is! bool) {
    throw ArgumentError('Option "$name" is not a flag.');
  }
  return argResults[name];
}