getApiKeys static method

Future<List<ApiKeyModel>> getApiKeys()

Retrieve API keys for the API session

Implementation

static Future<List<ApiKeyModel>> getApiKeys() async {
  String? apiKeysJson = _prefs!.getString(_apiKeys);

  if (apiKeysJson != null) {
    List<dynamic> apiKeysMapList = jsonDecode(apiKeysJson);
    return apiKeysMapList
        .map((map) => ApiKeyModel.fromMap(map as Map<String, dynamic>))
        .toList();
  } else {
    return [];
  }
}