getResource method

  1. @override
HTSource getResource(
  1. String key, {
  2. String? from,
})
override

Import a resource with a certain key, ignore those already imported

If from is provided, the handler will try to get a relative path

Otherwise, a absolute path is calculated from root

Implementation

@override
HTSource getResource(String key, {String? from}) {
  var normalized = getAbsolutePath(key: key);
  if (_cached.containsKey(normalized)) {
    return _cached[normalized]!;
  }
  throw HTError.resourceDoesNotExist(normalized);
}