LoadListFromJSonFile<T> static method
Implementation
static Future<List<T?>?> LoadListFromJSonFile<T>(String fileName, T factory(Map<String, dynamic> data)) async {
try {
String jsonData = await XLibStorage.ReadTextAsync(fileName);
if (jsonData != "") {
Iterable list = jsonDecode(jsonData);
var value = list.map((item) => Deserialize<T>(item, factory)).toList();
return value;
} else {
return null;
}
} catch (ex) {
return null;
}
}