fix try again button
parent
ebb04ad358
commit
8dc0529646
|
@ -6,11 +6,11 @@ abstract class UserEvent extends Equatable {
|
||||||
}
|
}
|
||||||
|
|
||||||
class GetApkVersion extends UserEvent {
|
class GetApkVersion extends UserEvent {
|
||||||
final String username;
|
final String? username;
|
||||||
final String password;
|
final String? password;
|
||||||
GetApkVersion({required this.password, required this.username});
|
GetApkVersion({required this.password, required this.username});
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [username, password];
|
List<Object> get props => [];
|
||||||
}
|
}
|
||||||
|
|
||||||
class UserLogin extends UserEvent {
|
class UserLogin extends UserEvent {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||||
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
|
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
|
||||||
import 'package:fluttericon/font_awesome5_icons.dart';
|
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||||
import 'package:unit2/bloc/offline/offline_bloc/offline_bloc.dart';
|
import 'package:unit2/bloc/offline/offline_bloc/offline_bloc.dart';
|
||||||
|
@ -28,9 +30,12 @@ class OfflineModuleScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: BlocConsumer<OfflineBloc, OfflineState>(
|
body: ProgressHUD(
|
||||||
|
backgroundColor: Colors.black87,
|
||||||
|
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||||
|
child: BlocConsumer<OfflineBloc, OfflineState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
// TODO: implement listener
|
if (state is OfflineLoadingState) {}
|
||||||
},
|
},
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state is OfflineModeState) {
|
if (state is OfflineModeState) {
|
||||||
|
@ -42,8 +47,8 @@ class OfflineModuleScreen extends StatelessWidget {
|
||||||
crossAxisSpacing: 8,
|
crossAxisSpacing: 8,
|
||||||
mainAxisSpacing: 10,
|
mainAxisSpacing: 10,
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(
|
||||||
const EdgeInsets.symmetric(vertical: 5, horizontal: 5),
|
vertical: 5, horizontal: 5),
|
||||||
children: state.offlineModules
|
children: state.offlineModules
|
||||||
.map((e) => CardLabel(
|
.map((e) => CardLabel(
|
||||||
icon: FontAwesome5.eye,
|
icon: FontAwesome5.eye,
|
||||||
|
@ -59,6 +64,7 @@ class OfflineModuleScreen extends StatelessWidget {
|
||||||
}
|
}
|
||||||
return Container();
|
return Container();
|
||||||
},
|
},
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
||||||
backgroundColor: Colors.black87,
|
backgroundColor: Colors.black87,
|
||||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||||
child: BlocConsumer<UserBloc, UserState>(listener: (context, state) {
|
child: BlocConsumer<UserBloc, UserState>(listener: (context, state) {
|
||||||
|
print(state);
|
||||||
if (state is UserLoggedIn ||
|
if (state is UserLoggedIn ||
|
||||||
state is UuidLoaded ||
|
state is UuidLoaded ||
|
||||||
state is LoginErrorState) {
|
state is LoginErrorState) {
|
||||||
|
@ -372,7 +373,8 @@ class _UniT2LoginState extends State<UniT2Login> {
|
||||||
onpressed: () {
|
onpressed: () {
|
||||||
BlocProvider.of<UserBloc>(
|
BlocProvider.of<UserBloc>(
|
||||||
NavigationService.navigatorKey.currentContext!)
|
NavigationService.navigatorKey.currentContext!)
|
||||||
.add(LoadVersion(username: username, password: password));
|
.add(GetApkVersion(
|
||||||
|
username: username, password: password));
|
||||||
return MaterialPageRoute(builder: (_) {
|
return MaterialPageRoute(builder: (_) {
|
||||||
return const UniT2Login();
|
return const UniT2Login();
|
||||||
});
|
});
|
||||||
|
@ -388,7 +390,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
||||||
onpressed: () {
|
onpressed: () {
|
||||||
BlocProvider.of<UserBloc>(
|
BlocProvider.of<UserBloc>(
|
||||||
NavigationService.navigatorKey.currentContext!)
|
NavigationService.navigatorKey.currentContext!)
|
||||||
.add(LoadVersion(
|
.add(GetApkVersion(
|
||||||
username: username, password: password));
|
username: username, password: password));
|
||||||
return MaterialPageRoute(builder: (_) {
|
return MaterialPageRoute(builder: (_) {
|
||||||
return const UniT2Login();
|
return const UniT2Login();
|
||||||
|
@ -434,7 +436,8 @@ class _UniT2LoginState extends State<UniT2Login> {
|
||||||
onpressed: () {
|
onpressed: () {
|
||||||
BlocProvider.of<UserBloc>(
|
BlocProvider.of<UserBloc>(
|
||||||
NavigationService.navigatorKey.currentContext!)
|
NavigationService.navigatorKey.currentContext!)
|
||||||
.add(LoadVersion(username: username, password: password));
|
.add(GetApkVersion(
|
||||||
|
username: username, password: password));
|
||||||
return MaterialPageRoute(builder: (_) {
|
return MaterialPageRoute(builder: (_) {
|
||||||
return const UniT2Login();
|
return const UniT2Login();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue