avoid-instantiating-in-bloc-value-provider
Warns when a BlocProvider.value
returns a new instance instead of reusing an existing one.
Example
❌ Bad:
BlocProvider.value(
value: RegularService(), // LINT: Avoid creating a new instance. Try providing an existing one instead.
);
✅ Good:
BlocProvider.value(
value: existingInstance,
);