set method

void set(
  1. String unit,
  2. int val
)

Sets val by unit. Supports shorthand. It will not do anything if the unit is not found.

You must call finished method to apply all changes. Usually used in chain setting (Cascade).

Example:

set('date', 1);
set('d', 1);

Implementation

void set(String unit, int val) {
  final processedUnit = Unit.fromShorthand(unit);

  if (_values.containsKey(processedUnit)) {
    _values[processedUnit] = val;
  }
}