getService<T extends MomentumService> static method
- @Deprecated('Use `Momentum.service<T>(context)` instead')
- BuildContext context, {
- bool runtimeType = true,
The static method for getting services inside a widget. The service must be marked with MomentumService and injected into Momentum root widget.
NOTE: This will be removed in the future.
Implementation
@Deprecated('Use `Momentum.service<T>(context)` instead')
static T getService<T extends MomentumService>(BuildContext context,{bool runtimeType = true}) {
return _getMomentumInstance(context)!._getService<T>(runtimeType: runtimeType);
}