ServiceInvalidInferenceException class

This exception is thrown when you try to use a service provider method without specifying the TService generic argument, so the Service Provider cannot know what type to return

To fix, ensure you always call the ServiceProvider methods with its generic arguments (ex.: `serviceProvider.optional

To avoid it during development, use the following lint options:

analyzer:
  exclude:
    - '**/*.g.dart'
  language:
    strict-casts: true
    strict-raw-types: true
    strict-inference: true # This will show you when type inference cannot be determinated because you forgot to specify a generic type argument
Implemented types

Constructors

ServiceInvalidInferenceException({required String? key})
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
message String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited