useValue property

Object useValue
final

Constant value to use when token is injected.

It is recommended to use useValue with an OpaqueToken as token:

const animationDelay = OpaqueToken<Duration>('animationDelay');

const Provider(animationDelay, useValue: Duration(seconds: 1));

NOTE: The AngularDart compiler has limited heuristics for supporting complex nested objects beyond simple literals. If you encounter problems it is recommended to use useFactory instead.

TODO(b/156495978): Change to Object?.

Implementation

final Object useValue;