loadFromAssets<T extends VasatModel<T> > method
Future<List<T> >
loadFromAssets<T extends VasatModel<T> >(
- VasatFromJsonFactory<
T> factory, - BuildContext context
Implementation
Future<List<T>> loadFromAssets<T extends VasatModel<T>>(VasatFromJsonFactory<T> factory, BuildContext context) async {
return DefaultAssetBundle.of(context).loadString("assets/${T.toString()}.json")
.then((data) => processObjects<T>(jsonDecode(data), factory));
}