getTtlDisplayUnit static method

DisplayUnit getTtlDisplayUnit(
  1. dynamic map
)

Implementation

static DisplayUnit getTtlDisplayUnit(map) {
  String? ttlDisplayUnit = map['ttlDisplayUnit'] ?? map['ttl_display_unit'];
  switch (ttlDisplayUnit) {
    case 's':
      return DisplayUnit.s;
    case 'm':
      return DisplayUnit.m;
    case 'h':
      return DisplayUnit.h;
    case 'd':
      return DisplayUnit.d;
    default:
      return DisplayUnit.s;
  }
}