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}) {
  if (_cached.containsKey(key)) {
    return _cached[key]!;
  }
  throw HTError.resourceDoesNotExist(key);
}