loadFromAssets<T extends VasatModel<T>> method

Future<List<T>> loadFromAssets<T extends VasatModel<T>>(
  1. VasatFromJsonFactory<T> factory,
  2. 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));
}