selfprivacy.org.app/lib/config/bloc_config.dart

40 lines
1.3 KiB
Dart
Raw Normal View History

2020-12-01 19:08:19 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
2020-12-08 19:26:51 +00:00
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
2021-01-06 17:35:57 +00:00
import 'package:selfprivacy/logic/cubit/app_config/app_config_cubit.dart';
2020-12-10 20:33:19 +00:00
import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart';
2020-12-01 19:08:19 +00:00
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
2020-12-03 16:52:53 +00:00
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
2020-12-01 19:08:19 +00:00
class BlocAndProviderConfig extends StatelessWidget {
const BlocAndProviderConfig({Key key, this.child}) : super(key: key);
final Widget child;
@override
Widget build(BuildContext context) {
2021-01-06 17:35:57 +00:00
// var platformBrightness =
// SchedulerBinding.instance.window.platformBrightness;
// var isDark = platformBrightness == Brightness.dark;
var isDark = false;
2020-12-01 19:08:19 +00:00
return MultiProvider(
providers: [
2021-01-06 17:35:57 +00:00
BlocProvider(
create: (_) => AppSettingsCubit(
isDarkModeOn: isDark,
isOnbordingShowing: true,
)..load(),
),
BlocProvider(
create: (_) => AppConfigCubit()..load(),
),
2020-12-10 20:33:19 +00:00
BlocProvider(create: (_) => ServicesCubit()),
BlocProvider(create: (_) => ProvidersCubit()),
BlocProvider(create: (_) => UsersCubit()),
2020-12-01 19:08:19 +00:00
],
child: child,
);
}
}