dvSignalContainerOf function
The Riverpod container backing signals reached through context.
Riverpod being an implementation detail means the application never has to
know it is there, and that includes not having to mount its scope. This
used to call ProviderScope.containerOf directly, which asserts one is
above it -- and nothing in Dartvel puts one there. A generated app is
runApp(createDartvelApp()) over a MaterialApp.router, so the spec's
headline state primitive, final counter = context.signal(0), threw with
"No ProviderScope found" in the exact application shape Dartvel generates.
An application that does mount its own scope still gets that one: the fallback must not shadow a real scope, or provider overrides installed for a test would be silently ignored.
Implementation
ProviderContainer dvSignalContainerOf(BuildContext context) {
final InheritedElement? scope = context
.getElementForInheritedWidgetOfExactType<UncontrolledProviderScope>();
if (scope != null) return ProviderScope.containerOf(context);
return _dvAmbientContainer ??= ProviderContainer();
}