loadStructuredData<T> method Null safety

  1. @override
Future<T> loadStructuredData<T>(
  1. String key,
  2. Future<T> parser(
    1. String value
    )
)
override

Retrieve a string from the asset bundle, parse it with the given function, and return the function's result.

The result is not cached. The parser is run each time the resource is fetched.

Implementation

@override
Future<T> loadStructuredData<T>(String key, Future<T> Function(String value) parser) async {
  assert(key != null);
  assert(parser != null);
  return parser(await loadString(key));
}