FeatureRegistry class final
Constructors
- FeatureRegistry.instance()
-
Factory that returns the singleton instance of
the FeatureRegistry.
factory
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
-
dispose(
) → void - Disposes of all the registered features.
-
getAnchors<
T> (String hookName, {BuildContext? context}) → List< T> -
Returns a list of feature anchors of type
T
that are associated with the givenhookName
. -
getFeature<
T extends Feature> (String name) → T? -
Returns the Feature with the given
name
. -
getLocalizationsDelegates(
) → List< LocalizationsDelegate> - Returns a list of all the localizations delegates that are associated with the registered features.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerFeature(
Feature feature) → Future< void> -
Registers the provided
feature
with the registry. -
scope(
BuildContext context, {required Widget child}) → Widget - Provides all the registerd feature services to the widget tree.
-
setCurrentContext(
BuildContext context) → void -
Sets the current
context
for all the registered feature services. This needs to be explicitly called when the context is available by the application. It is required to ensure that the services can access the localizations and other context specific information. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
intialize(
FeatureConfigLoader loader) → dynamic -
Initializes the FeatureRegistry with the
provided
loader
function which is used to load the feature configuration.