getUsedFormats method

List<Format> getUsedFormats()

Gets all used formats.

Implementation

List<Format> getUsedFormats() {
  final List<Format> result = <Format>[];

  final List<int> keys = _rawFormats.keys.toList();
  final int index = keys.indexOf(49);

  /// 49 is last index of always present formats
  final int iCount = _rawFormats.length;

  if (index >= 0 && index < iCount - 1) {
    for (int i = index + 1; i < iCount; i++) {
      final Format format = _rawFormats[keys[i]]!;

      if (format.index >= _default_first_custom_index) {
        result.add(format);
      }
    }
  }

  return result;
}