setCurrentContext method

  1. @override
void setCurrentContext(
  1. BuildContext context
)
override

This method is called by from the top level of the widget tree to initialize the service's localizations so it can be applied throughout the service regardless of whether if the context is available. This method should return either itself initialized with the context or a new instance of the Service initialized with the context. This is a convenience method that allows the service to be initialized with the context without having to create a new instance and is called by the Feature class when creating BLoC providers for the service.

Implementation

@override
void setCurrentContext(BuildContext context) {
  // Update the localizations for the identity
  // service from the given [context]
  _localizations = IdentityLocalizations.of(context);
}