getService<T extends MomentumService> method
- @Deprecated('Use "service<T>()" instead')
- bool runtimeType = true,
- dynamic alias,
A method for getting a service marked with MomentumService that are injected into Momentum root widget.
Implementation
@Deprecated('Use "service<T>()" instead')
T getService<T extends MomentumService>({bool runtimeType = true, dynamic alias}) {
if (_context == null && _tester != null) {
return _tester!.service<T>(alias: alias);
}
var momentum = Momentum._getMomentumInstance(_context!)!;
return momentum._getService<T>(runtimeType: runtimeType, alias: alias);
}