Frontend  0.5.1
Loading...
Searching...
No Matches
fake_services_provider_container.dart File Reference

Fake services provider container. More...

Variables

import package
final fakeServicesProviderContainer = ProviderContainer()
 Fake services provider container.

Detailed Description

Author
Vincent Hamp
Date
01/11/2024

Variable Documentation

◆ fakeServicesProviderContainer

final fakeServicesProviderContainer = ProviderContainer()

This is a global container for providers. Please not that this is bad practice, but we need a common provider container for all fake services. This is the only way we can inject this container to fake services as well as the entire widget tree.

When faking services this container gets injected into runApp.

// Expose global `ProviderContainer` to widget tree for fake services
if (const String.fromEnvironment('OPENREMISE_FRONTEND_FAKE_SERVICES') ==
'true') {
runApp(
UncontrolledProviderScope(
child: const MyApp(),
),
);
}
Definition main.dart:92
final fakeServicesProviderContainer
Fake services provider container.
Definition fake_services_provider_container.dart:47

See also #295 and #1387.

◆ package

import package