getValue<T> method
Returns an instance of T
or null if the command has the designed option
final int value = getValue<int>('key', defaultValue: 0);
final double value = getValue<double>('key', defaultValue: 0.0);
final String value = getValue<String?>('key', defaultValue: 'Hello World');
Implementation
T getValue<T>(String key, { T? defaultValue }) => params[key] ?? defaultValue as T;