stream image
This commit is contained in:
+11
-31
@@ -1,11 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:prosappco/blocs/my_user_bloc/my_user_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/authentication/welcome_screen.dart';
|
||||
import 'package:prosappco/screens/home/home_screen.dart';
|
||||
import 'package:prosappco/screens/profile/profile_screen.dart';
|
||||
|
||||
import 'blocs/authentication_bloc/authentication_bloc.dart';
|
||||
|
||||
@@ -31,33 +27,17 @@ class MyAppView extends StatelessWidget {
|
||||
),
|
||||
home: BlocBuilder<AuthenticationBloc, AuthenticationState>(
|
||||
builder: (context, state) {
|
||||
if (state.status == AuthenticationStatus.authenticated) {
|
||||
// MultiBlocProvider(
|
||||
// providers: [
|
||||
// BlocProvider(
|
||||
// create: (context) => SignInBloc(
|
||||
// userRepository:
|
||||
// context.read<AuthenticationBloc>().userRepository),
|
||||
// ),
|
||||
// BlocProvider(
|
||||
// create: (context) => UpdateUserInfoBloc(
|
||||
// userRepository:
|
||||
// context.read<AuthenticationBloc>().userRepository),
|
||||
// ),
|
||||
// BlocProvider(
|
||||
// create: (context) => MyUserBloc(
|
||||
// myUserRepository:
|
||||
// context.read<AuthenticationBloc>().userRepository)
|
||||
// ..add(GetMyUser(
|
||||
// myUserId:
|
||||
// context.read<AuthenticationBloc>().state.user!.uid)),
|
||||
// ),
|
||||
// ],
|
||||
// child: const HomeScreen(),
|
||||
// );
|
||||
return const HomeScreen();
|
||||
} else {
|
||||
return const WelcomeScreen();
|
||||
switch (state.status) {
|
||||
case AuthenticationStatus.authenticated:
|
||||
return const HomeScreen();
|
||||
|
||||
case AuthenticationStatus.unauthenticated:
|
||||
return const WelcomeScreen();
|
||||
|
||||
case AuthenticationStatus.unknown:
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(), // splash screen
|
||||
);
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user