Resources class abstract
Base class for resource loading configurations.
Subclass this to provide a custom resource loading strategy. The built-in implementations are LocalResources (asset bundle) and CloudResources (XWidget Cloud).
The active instance is set via activate (called by XWidget.initialize) and accessed through Resources.instance.
Subclasses implement load to populate FragmentResourceBundle and ValueResourceBundle instances, then register them via replaceResourceBundles.
- Mixed-in types
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
activate(
) → Future< void> - Sets this instance as the active singleton and calls load.
-
addResourceBundles(
List< ResourceBundle> bundles) → void - Registers custom ResourceBundle instances.
-
clearFragmentCache(
) → void -
Clears the parsed XML cache. Safe to call when caching is
disabled.
inherited
-
dispose(
) → Future< void> - Releases resources held by this instance. Called automatically when a new instance is activated. Override to clean up subclass-specific resources (watchers, connections, etc.).
-
getBool(
String name) → bool -
inherited
-
getColor(
String name) → Color -
inherited
-
getColorString(
String name) → String -
inherited
-
getDouble(
String name) → double -
inherited
-
getFragment(
String fqn) → XmlDocument -
Returns the parsed
XmlDocumentfor the given fully-qualified fragment name. Uses the internal cache when enabled.inherited -
getFragmentFqn(
String name, [String? relativeTo]) → String -
Resolves a fragment name to its fully-qualified path.
inherited
-
getInt(
String name) → int -
inherited
-
getString(
String name) → String -
inherited
-
load(
) → Future< void> - Subclasses implement this to populate resource bundles.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replaceResourceBundles(
List< ResourceBundle> bundles) → void - Registers ResourceBundle instances, replacing any existing bundles that conflict by type.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of<
T extends ResourceBundle> () → T -
Returns the registered ResourceBundle of type
T.