getData<T> method
Retrieve an object of type, T, by its String value. Supply a parser function to process the operation. (See. Flutter's AssetBundle.loadStructuredData
Implementation
Future<T?> getData<T>(
String key, Future<T> Function(String value) parser) async {
assert(Assets._assets != null, 'Assets.init() must be called first.');
T? data;
try {
data =
await Assets._assets!.loadStructuredData('$setPath(key)$key', parser);
} catch (ex) {
data = null;
}
return data;
}