mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-08 18:03:12 +00:00
bf79fb1adf
- Delete SSH generation leftovers - Migrate users box to an encrypted box
48 lines
2 KiB
Dart
48 lines
2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
|
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
|
import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart';
|
|
import 'package:selfprivacy/logic/cubit/dns_records/dns_records_cubit.dart';
|
|
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
|
|
import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart';
|
|
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
|
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
|
|
|
|
class BlocAndProviderConfig extends StatelessWidget {
|
|
const BlocAndProviderConfig({Key? key, this.child}) : super(key: key);
|
|
|
|
final Widget? child;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var isDark = false;
|
|
var serverInstallationCubit = ServerInstallationCubit()..load();
|
|
var usersCubit = UsersCubit(serverInstallationCubit);
|
|
var servicesCubit = ServicesCubit(serverInstallationCubit);
|
|
var backupsCubit = BackupsCubit(serverInstallationCubit);
|
|
var dnsRecordsCubit = DnsRecordsCubit(serverInstallationCubit);
|
|
return MultiProvider(
|
|
providers: [
|
|
BlocProvider(
|
|
create: (_) => AppSettingsCubit(
|
|
isDarkModeOn: isDark,
|
|
isOnboardingShowing: true,
|
|
)..load(),
|
|
),
|
|
BlocProvider(create: (_) => serverInstallationCubit, lazy: false),
|
|
BlocProvider(create: (_) => ProvidersCubit()),
|
|
BlocProvider(create: (_) => usersCubit..load(), lazy: false),
|
|
BlocProvider(create: (_) => servicesCubit..load(), lazy: false),
|
|
BlocProvider(create: (_) => backupsCubit..load(), lazy: false),
|
|
BlocProvider(create: (_) => dnsRecordsCubit..load()),
|
|
BlocProvider(
|
|
create: (_) =>
|
|
JobsCubit(usersCubit: usersCubit, servicesCubit: servicesCubit),
|
|
),
|
|
],
|
|
child: child,
|
|
);
|
|
}
|
|
}
|