30 lines
867 B
Dart
30 lines
867 B
Dart
import 'package:provider/single_child_widget.dart';
|
|
|
|
import '../core/locator.dart';
|
|
import '../core/services/navigator_service.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'services/ApiService.dart';
|
|
import 'services/authentication_service.dart';
|
|
|
|
class ProviderInjector {
|
|
static List<SingleChildWidget> providers = [
|
|
..._independentServices,
|
|
..._dependentServices,
|
|
..._consumableServices,
|
|
];
|
|
|
|
static List<SingleChildWidget> _independentServices = [
|
|
Provider.value(value: locator<NavigatorService>()),
|
|
Provider.value(value: locator<ApiService>()),
|
|
];
|
|
|
|
static List<SingleChildWidget> _dependentServices = [
|
|
ProxyProvider<ApiService, AuthenticationService>(
|
|
update: (context, api, authenticationService) =>
|
|
AuthenticationService(api: api),
|
|
)
|
|
];
|
|
|
|
static List<SingleChildWidget> _consumableServices = [];
|
|
} |