saveList static method
Save full list
Implementation
static Future<void> saveList(List<StaticStockRecord> newList) async {
final prefs = await SharedPreferences.getInstance();
final existingJson = prefs.getStringList(_key) ?? [];
final existingList = existingJson
.map((e) => StaticStockRecord.fromJson(jsonDecode(e)))
.toList();
// merge
existingList.addAll(newList);
final mergedJson = existingList
.map((e) => jsonEncode(e.toJson()))
.toList();
await prefs.setStringList(_key, mergedJson);
}