stream
This commit is contained in:
+31
-6
@@ -1,19 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:injector/injector.dart';
|
||||
import 'package:prosappco/blocs/authentication_bloc/authentication_bloc.dart';
|
||||
import 'package:prosappco/blocs/my_user_bloc/my_user_bloc.dart';
|
||||
import 'package:prosappco/blocs/sign_up_bloc/sign_up_bloc.dart';
|
||||
import 'package:prosappco/blocs/sing_in_bloc/sign_in_bloc.dart';
|
||||
import 'package:prosappco/blocs/update_user_info_bloc/update_user_info_bloc.dart';
|
||||
import 'package:prosappco/screens/home/home_screen.dart';
|
||||
import 'package:user_repository/user_repository.dart';
|
||||
|
||||
import 'app_view.dart';
|
||||
|
||||
class MainApp extends StatelessWidget {
|
||||
final UserRepository userRepository;
|
||||
const MainApp(this.userRepository, {super.key});
|
||||
const MainApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MultiRepositoryProvider(providers: [
|
||||
RepositoryProvider<AuthenticationBloc>(
|
||||
create: (_) => AuthenticationBloc(myUserRepository: userRepository))
|
||||
], child: const MyAppView());
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<AuthenticationBloc>(
|
||||
create: (context) => Injector.appInstance.get<AuthenticationBloc>(),
|
||||
),
|
||||
BlocProvider<MyUserBloc>(
|
||||
create: (context) => Injector.appInstance.get<MyUserBloc>(),
|
||||
),
|
||||
BlocProvider<UpdateUserInfoBloc>(
|
||||
create: (context) => Injector.appInstance.get<UpdateUserInfoBloc>(),
|
||||
),
|
||||
BlocProvider<SignInBloc>(
|
||||
create: (context) => Injector.appInstance.get<SignInBloc>(),
|
||||
),
|
||||
BlocProvider<SignUpBloc>(
|
||||
create: (context) => Injector.appInstance.get<SignUpBloc>(),
|
||||
)
|
||||
// RepositoryProvider<AuthenticationBloc>(
|
||||
// create: (_) => AuthenticationBloc(myUserRepository: userRepository),
|
||||
// ),
|
||||
],
|
||||
child: BlocBuilder<MyUserBloc, MyUserState>(builder: (context, state) {
|
||||
return const MyAppView();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user