Skip to content

Instantly share code, notes, and snippets.

@mondoktamas
Created December 1, 2021 13:05
Show Gist options
  • Save mondoktamas/1e9a3b87e376ee47821662701bfac07a to your computer and use it in GitHub Desktop.
Save mondoktamas/1e9a3b87e376ee47821662701bfac07a to your computer and use it in GitHub Desktop.
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:skogluft/application/di/injection.dart';
import 'package:skogluft/application/features/authorized/features/home/presentation/cubit/badge_cubit.dart';
import 'package:skogluft/application/features/authorized/features/home/presentation/cubit/main_page_cubit.dart';
import 'package:skogluft/application/features/authorized/features/my_account/presentation/bloc/my_account_bloc.dart';
import 'package:skogluft/application/features/authorized/features/plant_support/presentation/cubit/plant_support_cubit.dart';
import 'package:skogluft/application/features/unauthorized/features/instructions/presentation/bloc/instructions_bloc.dart';
class AuthorizedWrapperPage extends StatelessWidget {
const AuthorizedWrapperPage({final Key? key}) : super(key: key);
@override
Widget build(final BuildContext context) => MultiBlocProvider(
providers: [
BlocProvider<InstructionsBloc>(
create: (_) => getIt<InstructionsBloc>(),
),
BlocProvider<PlantSupportCubit>(
create: (_) => getIt<PlantSupportCubit>(),
),
BlocProvider<BadgeCubit>(
create: (_) => getIt<BadgeCubit>(),
),
BlocProvider<MainPageBloc>(
create: (_) => getIt<MainPageBloc>(),
),
BlocProvider<MyAccountBloc>(
create: (_) => getIt<MyAccountBloc>(),
),
],
child: const AutoRouter(),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment