Fakultas Ilmu Komputer UI

Commit a3c1b29b authored by Michael Wiryadinata Halim's avatar Michael Wiryadinata Halim
Browse files

Merge branch 'hotfix-sprint_5' into 'master'

Resolve "Flutter easy loading conflict with overlay widget"

See merge request !54
parents 18848df9 b3542185
Pipeline #47083 passed with stages
in 19 minutes and 5 seconds
......@@ -29,58 +29,55 @@ class HomeIndustryApp extends StatelessWidget {
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
return FlutterEasyLoading(
child: MultiBlocProvider(
providers: [
BlocProvider<ProfileBloc>(
create: (context) => ProfileBloc(
return MultiBlocProvider(
providers: [
BlocProvider<ProfileBloc>(
create: (context) => ProfileBloc(
authenticationBloc: BlocProvider.of<AuthenticationBloc>(context),
profileRepo: ProfileRepository(
dio: RepositoryProvider.of<DependenciesRepositories>(context)
.dio)),
),
BlocProvider<CartBloc>(
create: (context) => CartBloc(
authenticationBloc:
BlocProvider.of<AuthenticationBloc>(context),
profileRepo: ProfileRepository(
cardRepository: CartRepository(
dio:
RepositoryProvider.of<DependenciesRepositories>(context)
.dio)),
),
BlocProvider<CartBloc>(
create: (context) => CartBloc(
authenticationBloc:
BlocProvider.of<AuthenticationBloc>(context),
cardRepository: CartRepository(
dio: RepositoryProvider.of<DependenciesRepositories>(
context)
.dio)))
],
child: MaterialApp(
title: 'Home Industry',
builder: (BuildContext context, Widget child) => MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1),
.dio)))
],
child: MaterialApp(
title: 'Home Industry',
builder: (BuildContext context, Widget child) => Material(
child: FlutterEasyLoading(
child: child,
),
color: Colors.white,
onGenerateRoute: Router.generateRoute,
theme: AppTheme.custom(Theme.of(context)),
home: BlocConsumer<AuthenticationBloc, AuthenticationState>(
listener: (context, state) {
if (state is ForcedAuthenticated) {
EasyLoading.showError('Mohon login ulang...',
duration: const Duration(seconds: 3));
Navigator.of(context).popUntil(ModalRoute.withName('/'));
}
},
buildWhen: (previous, current) {
return current is! ForcedAuthenticated;
},
builder: (context, state) {
if (state is AuthenticationInitial) {
return const SplashPage();
} else if (state is AuthenticationAuthenticated) {
return const BottomNavigation();
} else if (state is AuthenticationUnauthenticated) {
return Login(authRepository: authRepository);
}
return null;
},
),
),
color: Colors.white,
onGenerateRoute: Router.generateRoute,
theme: AppTheme.custom(Theme.of(context)),
home: BlocConsumer<AuthenticationBloc, AuthenticationState>(
listener: (context, state) {
if (state is ForcedAuthenticated) {
EasyLoading.showError('Mohon login ulang...',
duration: const Duration(seconds: 3));
Navigator.of(context).popUntil(ModalRoute.withName('/'));
}
},
buildWhen: (previous, current) {
return current is! ForcedAuthenticated;
},
builder: (context, state) {
if (state is AuthenticationInitial) {
return const SplashPage();
} else if (state is AuthenticationAuthenticated) {
return const BottomNavigation();
} else if (state is AuthenticationUnauthenticated) {
return Login(authRepository: authRepository);
}
return null;
},
),
),
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment