getStorageList function
var models = await getStorageList(_orderNoKey, listKey: _orderNoForUserKey, onModels: (json) { return BaseKeyValue.fromJson(json); });
Implementation
Future<List> getStorageList(String key,
{required String listKey,
required Function(Map<String, dynamic> json) onModels}) async {
final map = await getStorageMap(key);
var models = [];
if (map != null) {
final list = map[listKey];
try {
if (list.length > 0) {
models = list.map((v) => onModels(v)).toList();
}
} catch (e) {
logDebug(e);
}
}
return models;
}