getAllScripts static method

List<String> getAllScripts()

Return an array of all ISO 15924 4-letter script identifiers that this copy of ilib knows about, in the order they appear in the data.

Implementation

static List<String> getAllScripts() {
  final Map<String, dynamic>? rootData = ILibLoader.instance.getRootData();
  final Map<String, dynamic>? scripts =
      rootData?['ilib.data.scripts'] as Map<String, dynamic>?;
  final List<String> result = <String>[];
  if (scripts != null) {
    for (final MapEntry<String, dynamic> entry in scripts.entries) {
      if (entry.key.isNotEmpty && entry.value != null) {
        result.add(entry.key);
      }
    }
  }
  return result;
}