saveApiKeys static method

Future<void> saveApiKeys(
  1. List<ApiKeyModel> apiKeys
)

Save API keys for the API session

Implementation

static Future<void> saveApiKeys(List<ApiKeyModel> apiKeys) async {
  List<Map<String, dynamic>> apiKeysMapList =
      apiKeys.map((apiKey) => apiKey.toMap()).toList();
  String apiKeysJson = jsonEncode(apiKeysMapList);
  await _prefs!.setString(_apiKeys, apiKeysJson);
}