loadLlmConfigs method
Loads the saved list of configured LLM profiles and the selected profile ID.
Implementation
@override
Future<({List<LlmConfig> configs, String? selectedId})?>
loadLlmConfigs() async {
final prefs = await _instance;
final raw = prefs.getString(_kLlmProfiles);
final sel = prefs.getString(_kSelectedLlmId);
if (raw == null || raw.isEmpty) return null;
try {
final list = jsonDecode(raw) as List;
final configs = list
.map((item) => LlmConfig.fromJson(item as Map<String, dynamic>))
.toList();
return (configs: configs, selectedId: sel);
} catch (_) {
return null;
}
}