ContextualResourceResolver<T, C extends Comparable<C> > constructor
ContextualResourceResolver<T, C extends Comparable<C> > ({
- Map<
String, dynamic> ? resources, - Comparator<
C> ? contextComparator, - C? defaultContext,
- ContextualResource<
T, C> ? defaultResource,
Implementation
ContextualResourceResolver(
{Map<String, dynamic>? resources,
this.contextComparator,
this.defaultContext,
this.defaultResource}) {
if (resources != null) {
for (var entry in resources.entries) {
var k = entry.key;
var v = entry.value;
if (v is ContextualResource) {
add(k, [v as ContextualResource<T, C>]);
} else if (v is Iterable) {
add(k, v as Iterable<ContextualResource<T, C>>);
} else if (v is Function) {
var val = v();
addDynamic(k, val);
}
}
}
}