getService<T extends MomentumService> static method

  1. @Deprecated('Use `Momentum.service<T>(context)` instead')
T getService<T extends MomentumService>(
  1. BuildContext context, {
  2. 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);
}