ContextualResourceResolver<T, C extends Comparable<C>> class

Resolves a resource based into a context, like screen dimension or OS.

Available Extensions

Constructors

ContextualResourceResolver({Map<String, dynamic>? resources, Comparator<C>? contextComparator, C? defaultContext, ContextualResource<T, C>? defaultResource})

Properties

contextComparator Comparator<C>?
The context comparator, to overwrite default comparator of C.
final
defaultContext ↔ C?
The default context to be used when resolve is called without one.
getter/setter pair
defaultResource ContextualResource<T, C>?
The default resource to return when is not possible to resolve one.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
keys List<String>
The resources keys.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(String key, Iterable<ContextualResource<T, C>> options) → void
Adds a resource.
addDynamic(String key, Object? value, [ContextualResource<T, C> mapper(Object? value)?]) → void
Adds a resources with a dynamic value.
clear() → void
Clears all resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(String key, [C? context]) → T?
Resolves a resource.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String key) → T?
Returns a resolved resource using defaultContext.