getSymbol method

String getSymbol({
  1. required String locale,
})

Gets a localized symbol for this unit.

Implementation

String getSymbol({
  required String locale,
}) {
  switch (this) {
    // SI.
    case InformationUnit.bit:
      return 'b';
    case InformationUnit.crumb:
      return 'crumb';
    case InformationUnit.nibble:
      return 'nibble';
    case InformationUnit.kilobit:
      return 'kbit';
    case InformationUnit.megabit:
      return 'Mbit';
    case InformationUnit.gigabit:
      return 'Gbit';
    case InformationUnit.terabit:
      return 'Tbit';
    case InformationUnit.petabit:
      return 'Pbit';
    case InformationUnit.exabit:
      return 'Ebit';
    case InformationUnit.zettabit:
      return 'Zbit';
    case InformationUnit.yottabit:
      return 'Ybit';
    case InformationUnit.byte:
      return 'B';
    case InformationUnit.kilobyte:
      return 'KB';
    case InformationUnit.megabyte:
      return 'MB';
    case InformationUnit.gigabyte:
      return 'GB';
    case InformationUnit.terabyte:
      return 'TB';
    case InformationUnit.petabyte:
      return 'PB';
    case InformationUnit.exabyte:
      return 'EB';
    case InformationUnit.zettabyte:
      return 'ZB';
    case InformationUnit.yottabyte:
      return 'YB';

    // IEC.
    case InformationUnit.kibibit:
      return 'Kibit';
    case InformationUnit.mebibit:
      return 'Mibit';
    case InformationUnit.gibibit:
      return 'Gibit';
    case InformationUnit.tebibit:
      return 'Tibit';
    case InformationUnit.pebibit:
      return 'Pibit';
    case InformationUnit.exbibit:
      return 'Eibit';
    case InformationUnit.zebibit:
      return 'Zibit';
    case InformationUnit.yobibit:
      return 'Yibit';
    case InformationUnit.kibibyte:
      return 'KiB';
    case InformationUnit.mebibyte:
      return 'MiB';
    case InformationUnit.gibibyte:
      return 'GiB';
    case InformationUnit.tebibyte:
      return 'TiB';
    case InformationUnit.pebibyte:
      return 'PiB';
    case InformationUnit.exbibyte:
      return 'EiB';
    case InformationUnit.zebibyte:
      return 'ZiB';
    case InformationUnit.yobibyte:
      return 'YiB';
  }
}