get method

int? get(
  1. String unit
)

Gets int value by unit. Supports shorthand. Returns null if the unit is not found.

Example:

get('date');
get('d');

Implementation

int? get(String unit) {
  final processedUnit = Unit.fromShorthand(unit);

  return _values.containsKey(processedUnit) ? _values[processedUnit] : null;
}