intArg static method

int intArg(
  1. ArgResults args,
  2. String name
)

Implementation

static int intArg(ArgResults args, String name) {
  final raw = (args[name] as String?)?.trim();
  try {
    return int.parse(raw!);
  } on FormatException {
    throw ArgError("$name is not a integer '$raw'");
  }
}