resolve method
Resolves a resource.
Implementation
T? resolve(String key, [C? context]) {
var options = _resources[key];
if (isEmptyObject(options)) return defaultResource?.resource;
context ??= defaultContext;
if (context == null) {
return (defaultResource ?? options!.first).resource;
}
var sortedOptions = _resourcesSorted.putIfAbsent(key, () {
var list = options!.toList();
list.sort();
return list;
});
return _getResource(sortedOptions, context).resource;
}