Merge pull request 'patch/release/v1/v1.0.1' (#36) from patch/release/v1/v1.0.1 into develop
Reviewed-on: http://git.agusandelnorte.gov.ph:3000/SoftwareDevelopmentSection/unit2-null-safety-repository/pulls/36feature/passo/PASSO-#1-Sync-data-from-device-to-postgre-and-vice-versa
commit
e5b2f1f3cd
|
@ -219,8 +219,7 @@ class EducationBloc extends Bloc<EducationEvent, EducationState> {
|
|||
}
|
||||
});
|
||||
on<EducationViewAttachment>((event, emit) {
|
||||
String fileUrl =
|
||||
'${Url.instance.prefixHost()}://${Url.instance.host()}${event.source}';
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}/media/${event.source}';
|
||||
emit(EducationAttachmentViewState(
|
||||
fileUrl: fileUrl, fileName: event.fileName));
|
||||
});
|
||||
|
|
|
@ -290,7 +290,7 @@ class EligibilityBloc extends Bloc<EligibilityEvent, EligibilityState> {
|
|||
}
|
||||
});
|
||||
on<EligibiltyViewAttachmentEvent>((event,emit){
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}${event.source}';
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}/media/${event.source}';
|
||||
emit(EligibilityAttachmentViewState(fileUrl: fileUrl,fileName: event.filename));
|
||||
});
|
||||
on<ShareAttachment>((event, emit) async {
|
||||
|
|
|
@ -334,7 +334,7 @@ class LearningDevelopmentBloc
|
|||
}
|
||||
});
|
||||
on<LearningDevelopmentViewAttachmentEvent>((event,emit){
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}${event.source}';
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}/media/${event.source}';
|
||||
emit(LearningAndDevelopmentAttachmentViewState(fileUrl: fileUrl, filename: event.filename));
|
||||
});
|
||||
on<ShareAttachment>((event, emit) async {
|
||||
|
|
|
@ -29,7 +29,7 @@ class ReferencesBloc extends Bloc<ReferencesEvent, ReferencesState> {
|
|||
references = refs;
|
||||
emit(ReferencesLoadedState(references: references));
|
||||
}
|
||||
|
||||
emit(ReferencesLoadedState(references: references));
|
||||
} catch (e) {
|
||||
emit( ReferencesErrorState(message: e.toString()));
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:equatable/equatable.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:unit2/model/roles/pass_check/passer_info.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard/dashboard.dart';
|
||||
import 'package:unit2/sevices/roles/pass_check_services.dart';
|
||||
import '../../../utils/scanner.dart';
|
||||
part 'pass_check_event.dart';
|
||||
|
@ -12,7 +13,7 @@ part 'pass_check_state.dart';
|
|||
|
||||
class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
||||
PassCheckBloc() : super(PassCheckInitial()) {
|
||||
int? roleId;
|
||||
RoleIdRoleName? roleIdRoleName;
|
||||
String? uuid;
|
||||
bool? otherInputs;
|
||||
String? io;
|
||||
|
@ -25,9 +26,8 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
try {
|
||||
emit(PassCheckLoadingState());
|
||||
List<dynamic> response = await PassCheckServices.instance
|
||||
.getPassCheckArea(roleId: event.roleId, userId: event.userId);
|
||||
roleId = event.roleId;
|
||||
emit(AssignAreaLoaded(assignedArea: response, roleId: roleId!));
|
||||
.getPassCheckArea(roleIdRoleName:RoleIdRoleName(roleId: event.roleIdRoleName.roleId, roleName: event.roleIdRoleName.roleName), userId: event.userId);
|
||||
emit(AssignAreaLoaded(assignedArea: response, roleIdRoleName: RoleIdRoleName(roleId: event.roleIdRoleName.roleId, roleName: event.roleIdRoleName.roleName)));
|
||||
} catch (e) {
|
||||
emit(PassCheckErrorState(message: e.toString()));
|
||||
}
|
||||
|
@ -37,14 +37,14 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
checkerId = event.checkerId;
|
||||
io = event.entranceExit;
|
||||
token = event.token;
|
||||
roleId = event.roleId;
|
||||
roleIdRoleName = event.roleIdRoleName;
|
||||
assignedArea = event.assignedArea;
|
||||
emit(SettingSaved(
|
||||
assignedArea: assignedArea,
|
||||
checker: checkerId!,
|
||||
io: io!,
|
||||
otherInputs: otherInputs!,
|
||||
roleId: roleId!,
|
||||
roleIdRoleName: roleIdRoleName!,
|
||||
token: token!));
|
||||
});
|
||||
on<ScanError>((event, emit) {
|
||||
|
@ -53,7 +53,7 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
checker: checkerId!,
|
||||
io: io!,
|
||||
otherInputs: otherInputs!,
|
||||
roleId: roleId!,
|
||||
roleIdRoleName: roleIdRoleName!,
|
||||
token: token!));
|
||||
});
|
||||
on<PerformIncomingPostLog>((event, emit) {
|
||||
|
@ -64,7 +64,7 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
io: io!.toLowerCase() == "incoming" ? "i" : "o",
|
||||
otherInputs: otherInputs!,
|
||||
passerId: uuid!,
|
||||
roleId: roleId!,
|
||||
roleId: roleIdRoleName!.roleId,
|
||||
stationId: stationId,
|
||||
temp: event.temp));
|
||||
});
|
||||
|
@ -77,7 +77,7 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
io: io!.toLowerCase() == "incoming" ? "i" : "o",
|
||||
otherInputs: otherInputs!,
|
||||
passerId: uuid!,
|
||||
roleId: roleId!,
|
||||
roleId: roleIdRoleName!.roleId,
|
||||
stationId: stationId,
|
||||
temp: null));
|
||||
});
|
||||
|
@ -89,13 +89,13 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
try {
|
||||
PasserInfo? passerInfo = await PassCheckServices.instance
|
||||
.getPasserInfo(uuid: uuid!, token: event.token);
|
||||
if (roleId == 41 || roleId == 13 || roleId == 17 || roleId == 22) {
|
||||
if (roleIdRoleName!.roleName.toLowerCase() == "41" || roleIdRoleName!.roleName.toLowerCase() == 'qr code scanner' || roleIdRoleName!.roleName.toLowerCase() == 'office/branch chief' || roleIdRoleName!.roleName.toLowerCase() == 'registration in-charge') {
|
||||
stationId = assignedArea.id;
|
||||
} else if (roleId == 7) {
|
||||
} else if (roleIdRoleName!.roleName.toLowerCase() == 'barangay chairperson') {
|
||||
cpId = assignedArea.brgycode;
|
||||
} else if (roleId == 10) {
|
||||
} else if (roleIdRoleName!.roleName.toLowerCase() == 'purok pres') {
|
||||
cpId = assignedArea.purokdesc;
|
||||
} else if (roleId == 16) {
|
||||
} else if (roleIdRoleName!.roleName.toLowerCase() == 'establishment point-person') {
|
||||
cpId = assignedArea.id;
|
||||
}
|
||||
if (passerInfo == null) {
|
||||
|
@ -122,7 +122,7 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
io: io!.toLowerCase() == "incoming" ? "i" : "o",
|
||||
otherInputs: otherInputs!,
|
||||
passerId: uuid!,
|
||||
roleId: roleId!,
|
||||
roleId: roleIdRoleName!.roleId,
|
||||
stationId: stationId,
|
||||
temp: null));
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
checker: checkerId!,
|
||||
io: io!,
|
||||
otherInputs: otherInputs!,
|
||||
roleId: roleId!,
|
||||
roleIdRoleName: roleIdRoleName!,
|
||||
token: token!));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -8,13 +8,13 @@ abstract class PassCheckEvent extends Equatable {
|
|||
}
|
||||
|
||||
class GetPassCheckAreas extends PassCheckEvent {
|
||||
final int roleId;
|
||||
final RoleIdRoleName roleIdRoleName;
|
||||
final int userId;
|
||||
const GetPassCheckAreas({required this.roleId, required this.userId});
|
||||
const GetPassCheckAreas({required this.roleIdRoleName, required this.userId});
|
||||
}
|
||||
|
||||
class SetScannerSettings extends PassCheckEvent {
|
||||
final int roleId;
|
||||
final RoleIdRoleName roleIdRoleName;
|
||||
final String token;
|
||||
final dynamic assignedArea;
|
||||
final bool includeOtherInputs;
|
||||
|
@ -25,7 +25,7 @@ class SetScannerSettings extends PassCheckEvent {
|
|||
required this.checkerId,
|
||||
required this.entranceExit,
|
||||
required this.includeOtherInputs,
|
||||
required this.roleId,
|
||||
required this.roleIdRoleName,
|
||||
required this.token});
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ class PassCheckLoadingState extends PassCheckState {}
|
|||
|
||||
class AssignAreaLoaded extends PassCheckState {
|
||||
final List<dynamic> assignedArea;
|
||||
final int roleId;
|
||||
const AssignAreaLoaded({required this.assignedArea, required this.roleId});
|
||||
final RoleIdRoleName roleIdRoleName;
|
||||
const AssignAreaLoaded({required this.assignedArea, required this.roleIdRoleName});
|
||||
}
|
||||
|
||||
class SettingSaved extends PassCheckState {
|
||||
|
@ -33,13 +33,13 @@ class SettingSaved extends PassCheckState {
|
|||
final String io;
|
||||
final int checker;
|
||||
final bool otherInputs;
|
||||
final int roleId;
|
||||
final RoleIdRoleName roleIdRoleName;
|
||||
const SettingSaved(
|
||||
{required this.assignedArea,
|
||||
required this.checker,
|
||||
required this.io,
|
||||
required this.otherInputs,
|
||||
required this.roleId,
|
||||
required this.roleIdRoleName,
|
||||
required this.token});
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,8 @@ class UserBloc extends Bloc<UserEvent, UserState> {
|
|||
emit(InternetTimeout(message: timeoutError));
|
||||
} on Error catch (e) {
|
||||
emit(LoginErrorState(message: e.toString()));
|
||||
}catch(e){
|
||||
emit(LoginErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<UuidLogin>((event, emit) async {
|
||||
|
|
|
@ -81,8 +81,8 @@ class _LearningDevelopmentViewAttachmentState
|
|||
),
|
||||
imageUrl: state.fileUrl,
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../model/profile/attachment.dart';
|
||||
import '../../../theme-data.dart/box_shadow.dart';
|
||||
import '../../../theme-data.dart/colors.dart';
|
||||
import '../../../utils/alerts.dart';
|
||||
|
||||
class SingleAttachment extends StatelessWidget {
|
||||
final Function()? onpressed;
|
||||
|
@ -36,9 +34,9 @@ class SingleAttachment extends StatelessWidget {
|
|||
child:
|
||||
GestureDetector(
|
||||
onTap: view,
|
||||
child: AutoSizeText(
|
||||
child: Text(
|
||||
attachment.filename!,
|
||||
wrapWords: false,
|
||||
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
|
|
|
@ -264,13 +264,13 @@ class RbacModuleObjectsScreen extends StatelessWidget {
|
|||
},
|
||||
groupHeaderBuilder: (BuildContext context, int section) {
|
||||
return ListTile(
|
||||
tileColor: second,
|
||||
tileColor: Colors.white,
|
||||
title: Text(
|
||||
moduleObjects.keys.toList()[section].toUpperCase(),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(color: Colors.white),
|
||||
.copyWith(color: primary,fontWeight: FontWeight.bold),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -5,10 +5,12 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
|
|||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:search_page/search_page.dart';
|
||||
import 'package:unit2/bloc/rbac/rbac_operations/role/role_bloc.dart';
|
||||
import 'package:unit2/screens/superadmin/role/shared_pop_up_menu.dart';
|
||||
import 'package:unit2/widgets/Leadings/add_leading.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import '../../../model/rbac/rbac.dart';
|
||||
import '../../../theme-data.dart/box_shadow.dart';
|
||||
import '../../../theme-data.dart/btn-style.dart';
|
||||
import '../../../theme-data.dart/colors.dart';
|
||||
|
@ -24,12 +26,38 @@ class RbacRoleScreen extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final formKey = GlobalKey<FormBuilderState>();
|
||||
List<RBAC> roles = [];
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
title: const Text("Role Screen"),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
showSearch(
|
||||
context: context,
|
||||
delegate: SearchPage(
|
||||
barTheme: ThemeData(cardColor: primary),
|
||||
builder: (RBAC rbac) {
|
||||
return ListTile(
|
||||
title: Text(rbac.name!),
|
||||
);
|
||||
},
|
||||
filter: (RBAC rbac) {
|
||||
return [rbac.name];
|
||||
},
|
||||
failure: const Center(
|
||||
child: Text("No Role found :("),
|
||||
),
|
||||
items: roles,
|
||||
searchLabel: "Search Role",
|
||||
suggestion: const Center(
|
||||
child: Text("Search role by name"),
|
||||
)),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.search)),
|
||||
AddLeading(onPressed: () {
|
||||
BuildContext parent = context;
|
||||
showDialog(
|
||||
|
@ -174,6 +202,7 @@ class RbacRoleScreen extends StatelessWidget {
|
|||
final parent = context;
|
||||
if (state is RoleLoadedState) {
|
||||
if (state.roles.isNotEmpty) {
|
||||
roles = state.roles;
|
||||
return ListView.builder(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
|
||||
|
@ -191,8 +220,12 @@ class RbacRoleScreen extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(child: Text('${index+1}'),),
|
||||
const SizedBox(width: 12,),
|
||||
CircleAvatar(
|
||||
child: Text('${index + 1}'),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
Flexible(
|
||||
child: Text(state.roles[index].name!,
|
||||
style: Theme.of(context)
|
||||
|
@ -360,7 +393,8 @@ class RbacRoleScreen extends StatelessWidget {
|
|||
}
|
||||
if (state is RoleErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: state.message, onpressed: () {
|
||||
message: state.message,
|
||||
onpressed: () {
|
||||
context.read<RoleBloc>().add(GetRoles());
|
||||
});
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class RbacRoleAssignment extends StatelessWidget {
|
|||
elevation: 0,
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
title: const Text("User Roles Screenss"),
|
||||
title: const Text("User Roles Screens"),
|
||||
actions: [
|
||||
AddLeading(onPressed: () {
|
||||
BuildContext parent = context;
|
||||
|
|
|
@ -262,13 +262,13 @@ class RbacRoleExtendScreen extends StatelessWidget {
|
|||
},
|
||||
groupHeaderBuilder: (BuildContext context, int section) {
|
||||
return ListTile(
|
||||
tileColor: second,
|
||||
tileColor: Colors.white,
|
||||
title: Text(
|
||||
rolesExtend.keys.toList()[section].toUpperCase(),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(color: Colors.white),
|
||||
.copyWith(color: primary,fontWeight: FontWeight.bold),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -252,13 +252,13 @@ class RbacRoleModuleScreen extends StatelessWidget {
|
|||
},
|
||||
groupHeaderBuilder: (BuildContext context, int section) {
|
||||
return ListTile(
|
||||
tileColor: second,
|
||||
tileColor: Colors.white,
|
||||
title: Text(
|
||||
roleModules.keys.toList()[section].toUpperCase(),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(color: Colors.white),
|
||||
.copyWith(color: primary,fontWeight: FontWeight.bold),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
|
@ -13,6 +14,7 @@ import 'package:unit2/utils/global.dart';
|
|||
import 'package:unit2/utils/text_container.dart';
|
||||
import '../../../bloc/user/user_bloc.dart';
|
||||
import '../../../theme-data.dart/colors.dart';
|
||||
import '../../../utils/urls.dart';
|
||||
import '../../../widgets/splash_screen.dart';
|
||||
import '../signature/signature_pad.dart';
|
||||
import './components/cover-image.dart';
|
||||
|
@ -30,6 +32,8 @@ class BasicInfo extends StatelessWidget {
|
|||
child: BlocBuilder<UserBloc, UserState>(
|
||||
builder: (context, state) {
|
||||
if (state is UserLoggedIn) {
|
||||
String fileUrl =
|
||||
'${Url.instance.prefixHost()}://${Url.instance.host()}/media/${state.userData?.employeeInfo?.profile?.photoPath}';
|
||||
state.userData!.employeeInfo!.profile!.sex!.toUpperCase();
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
|
@ -47,17 +51,38 @@ class BasicInfo extends StatelessWidget {
|
|||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
const CircleAvatar(
|
||||
radius: 72,
|
||||
backgroundColor: Colors.white,
|
||||
CachedNetworkImage(
|
||||
imageUrl: fileUrl,
|
||||
imageBuilder: (context, imageProvider) =>
|
||||
Container(
|
||||
width: 160,
|
||||
height: 160,
|
||||
decoration: BoxDecoration(
|
||||
border:
|
||||
Border.all(color: Colors.black26, width: 3),
|
||||
shape: BoxShape.circle,
|
||||
image: DecorationImage(
|
||||
image: imageProvider,
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
placeholder: (context, url) =>
|
||||
const CircularProgressIndicator(),
|
||||
errorWidget: (context, url, error) =>
|
||||
Container(
|
||||
width: 160,
|
||||
height: 160,
|
||||
decoration: BoxDecoration(
|
||||
border:
|
||||
Border.all(color: Colors.white, width: 3),
|
||||
shape: BoxShape.circle,
|
||||
|
||||
),
|
||||
CircleAvatar(
|
||||
radius: 69,
|
||||
backgroundColor: Colors.grey.shade800,
|
||||
child: SvgPicture.asset(
|
||||
'assets/svgs/male.svg',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
||||
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||
import 'package:unit2/model/login_data/user_info/assigned_area.dart';
|
||||
import 'package:unit2/model/rbac/assigned_role.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard/dashboard_icon_generator.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard/superadmin_expanded_menu.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/module-screen.dart';
|
||||
|
@ -68,10 +69,6 @@ class _DashBoardState extends State<DashBoard> {
|
|||
docSmsCards.add(e);
|
||||
}
|
||||
});
|
||||
unit2Cards.forEach((element) {
|
||||
print(
|
||||
"${element.moduleName} - ${element.object.name!} - ${element.roleName} ");
|
||||
});
|
||||
if (superadminCards.length > 3) {
|
||||
tempSuperAdminCards = superadminCards.sublist(0, 4);
|
||||
}
|
||||
|
@ -79,6 +76,10 @@ class _DashBoardState extends State<DashBoard> {
|
|||
tempUnit2Cards = unit2Cards.sublist(0, 4);
|
||||
}
|
||||
|
||||
superadminCards.forEach((el) {
|
||||
print(el.object.name);
|
||||
});
|
||||
|
||||
return Container(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.symmetric(vertical: 24, horizontal: 24),
|
||||
|
@ -196,7 +197,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
: e.object.name!,
|
||||
ontap: () {
|
||||
if (e.object.name!.toLowerCase() == 'pass check') {
|
||||
PassCheckArguments passCheckArguments = PassCheckArguments(roleId: e.roleId, userId: widget.userId);
|
||||
PassCheckArguments passCheckArguments = PassCheckArguments(roleIdRoleName: RoleIdRoleName(roleId: e.roleId, roleName: e.roleName), userId: widget.userId);
|
||||
Navigator.pushNamed(context, '/pass-check', arguments: passCheckArguments);
|
||||
}
|
||||
if (e.object.name!.toLowerCase() == 'role based access control') {
|
||||
|
@ -312,7 +313,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
PassCheckArguments
|
||||
passCheckArguments =
|
||||
PassCheckArguments(
|
||||
roleId: 10,
|
||||
roleIdRoleName: RoleIdRoleName(roleId: e.roleId, roleName: e.roleName),
|
||||
userId:
|
||||
widget.userId);
|
||||
Navigator.pushNamed(
|
||||
|
@ -386,7 +387,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
PassCheckArguments
|
||||
passCheckArguments =
|
||||
PassCheckArguments(
|
||||
roleId: 10,
|
||||
roleIdRoleName: RoleIdRoleName(roleId: e.roleId,roleName: e.roleName),
|
||||
userId: widget.userId);
|
||||
Navigator.pushNamed(
|
||||
context, '/pass-check',
|
||||
|
@ -647,7 +648,8 @@ class _DashBoardState extends State<DashBoard> {
|
|||
? "Field Surveyor"
|
||||
: e.object.name!,
|
||||
ontap: () {
|
||||
Navigator.pushNamed(context, '/passo-home');
|
||||
Navigator.pushNamed(
|
||||
context, '/passo-home');
|
||||
})
|
||||
: Container(
|
||||
color: Colors.black,
|
||||
|
@ -706,7 +708,13 @@ class _DashBoardState extends State<DashBoard> {
|
|||
}
|
||||
|
||||
class PassCheckArguments {
|
||||
final int roleId;
|
||||
final RoleIdRoleName roleIdRoleName;
|
||||
final int userId;
|
||||
const PassCheckArguments({required this.roleId, required this.userId});
|
||||
const PassCheckArguments({required this.roleIdRoleName, required this.userId});
|
||||
}
|
||||
|
||||
class RoleIdRoleName{
|
||||
final int roleId;
|
||||
final String roleName;
|
||||
const RoleIdRoleName({required this.roleId, required this.roleName});
|
||||
}
|
||||
|
|
|
@ -271,6 +271,7 @@ class SuperAdminMenu extends StatelessWidget {
|
|||
roleAssignmentKey
|
||||
.currentState!
|
||||
.value['lastname'];
|
||||
Navigator.of(context).pop();
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder:
|
||||
(BuildContext
|
||||
|
|
|
@ -47,7 +47,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<UserBloc, UserState>(listener: (context, state) {
|
||||
print(state);
|
||||
if (state is UserLoggedIn || state is UuidLoaded) {
|
||||
if (state is UserLoggedIn || state is UuidLoaded || state is LoginErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.dismiss();
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
}));
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
print(state);
|
||||
if (state is VersionLoaded) {
|
||||
return Builder(builder: (context) {
|
||||
if (state.versionInfo!.version != state.apkVersion) {
|
||||
|
@ -251,9 +252,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
onPressed: () {
|
||||
final progress =
|
||||
ProgressHUD.of(context);
|
||||
|
||||
FocusScope.of(context).unfocus();
|
||||
|
||||
if (_formKey.currentState!
|
||||
.saveAndValidate()) {
|
||||
password = _formKey.currentState!
|
||||
|
@ -263,7 +262,6 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
progress?.showWithText(
|
||||
'Logging in...',
|
||||
);
|
||||
|
||||
BlocProvider.of<UserBloc>(context)
|
||||
.add(UserLogin(
|
||||
username: username,
|
||||
|
|
|
@ -302,28 +302,28 @@ class _QRCodeScannerState extends State<QRCodeScanner> {
|
|||
children: [
|
||||
SelectedState(
|
||||
//TODO add api data
|
||||
title: state.roleId == 41 ||
|
||||
state.roleId == 13 ||
|
||||
state.roleId == 17 ||
|
||||
state.roleId == 22
|
||||
title: state.roleIdRoleName.roleName.toLowerCase() == "41" ||
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'qr code scanner' ||
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'office/branch chief' ||
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'registration in-charge'
|
||||
? state.assignedArea.stationName
|
||||
: state.roleId == 7
|
||||
: state.roleIdRoleName.roleName.toLowerCase() == 'barangay chairperson'
|
||||
? state.assignedArea.brgydesc
|
||||
: state.roleId == 10
|
||||
: state.roleIdRoleName.roleName.toLowerCase() == 'purok president'
|
||||
? state.assignedArea.purokdesc
|
||||
: state.roleId == 16
|
||||
: state.roleIdRoleName.roleName.toLowerCase() == 'establishment point-person'
|
||||
? "Agency"
|
||||
: "",
|
||||
subtitle: state.roleId == 41 ||
|
||||
state.roleId == 13 ||
|
||||
state.roleId == 17 ||
|
||||
state.roleId == 22
|
||||
subtitle: state.roleIdRoleName.roleName.toLowerCase() == "41" ||
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'qr code scanner' ||
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'office/branch chief' ||
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'registration in-charge'
|
||||
? "Station"
|
||||
: state.roleId == 7
|
||||
: state.roleIdRoleName.roleName.toLowerCase() == 'barangay chairperson'
|
||||
? "Barangay"
|
||||
: state.roleId == 10
|
||||
: state.roleIdRoleName.roleName.toLowerCase() == 'purok president'
|
||||
? "Purok"
|
||||
: state.roleId == 16
|
||||
: state.roleIdRoleName.roleName.toLowerCase() == 'establishment point-person'
|
||||
? "Agency"
|
||||
: "",
|
||||
),
|
||||
|
|
|
@ -20,9 +20,9 @@ import '../../../../theme-data.dart/form-style.dart';
|
|||
import '../../../../utils/global.dart';
|
||||
|
||||
class QRCodeScannerSettings extends StatefulWidget {
|
||||
final int roleId;
|
||||
final int userId;
|
||||
const QRCodeScannerSettings({super.key, required this.roleId, required this.userId});
|
||||
final RoleIdRoleName roleIdRoleName;
|
||||
final int userId;
|
||||
const QRCodeScannerSettings({super.key, required this.roleIdRoleName, required this.userId});
|
||||
|
||||
@override
|
||||
State<QRCodeScannerSettings> createState() => _QRCodeScannerSettingsState();
|
||||
|
@ -172,7 +172,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
|
||||
////STATION
|
||||
Container(
|
||||
child: state.roleId == 41
|
||||
child: state.roleIdRoleName.roleName.toLowerCase() == "41"
|
||||
? DropdownButtonFormField(
|
||||
isExpanded: true,
|
||||
validator: FormBuilderValidators
|
||||
|
@ -219,7 +219,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
},
|
||||
////BARANGAY
|
||||
)
|
||||
: state.roleId == 7
|
||||
: state.roleIdRoleName.roleName.toLowerCase() == 'barangay nurse'
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
|
@ -270,7 +270,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
)
|
||||
:
|
||||
////PUROK
|
||||
state.roleId == 10
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'checkpoint in-charge'
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
|
@ -323,7 +323,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
)
|
||||
:
|
||||
////Registration InCharge
|
||||
state.roleId == 22
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'registration in-charge'
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
|
@ -398,7 +398,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
],
|
||||
)
|
||||
: ////QR Code Scanner
|
||||
state.roleId == 13
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'qr code scanner'
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
|
@ -469,7 +469,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
)
|
||||
:
|
||||
////Establishment Point-Person
|
||||
state.roleId == 16
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'establishment point-person'
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
|
@ -516,8 +516,8 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
],
|
||||
)
|
||||
: ////Office Branch Chief
|
||||
state.roleId ==
|
||||
17
|
||||
state.roleIdRoleName.roleName.toLowerCase() == 'office/branch chief'
|
||||
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
|
@ -578,10 +578,6 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
onPressed: () {
|
||||
if (_formKey.currentState!
|
||||
.saveAndValidate()) {
|
||||
print(scanMode);
|
||||
print(_includeOtherInputs);
|
||||
print(checkerId);
|
||||
print(assignedArea);
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder:
|
||||
(BuildContext context) {
|
||||
|
@ -595,7 +591,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
entranceExit: scanMode,
|
||||
includeOtherInputs:
|
||||
_includeOtherInputs,
|
||||
roleId: state.roleId)),
|
||||
roleIdRoleName: widget.roleIdRoleName)),
|
||||
child: const QRCodeScanner(),
|
||||
);
|
||||
}));
|
||||
|
@ -615,7 +611,7 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
return SomethingWentWrong(
|
||||
message: state.message, onpressed: () {
|
||||
|
||||
context.read<PassCheckBloc>().add(GetPassCheckAreas(roleId: widget.roleId, userId: widget.userId));
|
||||
context.read<PassCheckBloc>().add(GetPassCheckAreas(roleIdRoleName: widget.roleIdRoleName, userId: widget.userId));
|
||||
});
|
||||
}
|
||||
return Container();
|
||||
|
|
|
@ -39,16 +39,16 @@ class AuthService {
|
|||
Map<String, String> baseHeaders = {'Content-Type': 'application/json'};
|
||||
Map<dynamic, dynamic> responseStatus = {};
|
||||
String path = Url.instance.authentication();
|
||||
// try {
|
||||
try {
|
||||
http.Response response = await Request.instance
|
||||
.postRequest(path: path, param: {}, headers: baseHeaders, body: body);
|
||||
Map data = jsonDecode(response.body);
|
||||
responseStatus = data;
|
||||
|
||||
return responseStatus;
|
||||
// } catch (e) {
|
||||
// throw (e.toString());
|
||||
// }
|
||||
} catch (e) {
|
||||
throw (e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<Map<dynamic,dynamic>> qrLogin({String? uuid, String? password}) async {
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'package:unit2/model/roles/pass_check/agency_area_type.dart';
|
|||
import 'package:unit2/model/roles/pass_check/assign_role_area_type.dart';
|
||||
import 'package:unit2/model/roles/pass_check/barangay_assign_area.dart';
|
||||
import 'package:unit2/model/roles/pass_check/passer_info.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard/dashboard.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:unit2/utils/request.dart';
|
||||
|
@ -20,10 +21,10 @@ class PassCheckServices {
|
|||
static PassCheckServices get instance => _instance;
|
||||
|
||||
Future<List<dynamic>> getPassCheckArea(
|
||||
{required int roleId, required int userId}) async {
|
||||
{required RoleIdRoleName roleIdRoleName, required int userId}) async {
|
||||
String path = Url.instance.getAssignAreas();
|
||||
Map<String, String> params = {
|
||||
"assigned_role__role__id": roleId.toString(),
|
||||
"assigned_role__role__name__icontains": roleIdRoleName.roleName,
|
||||
"assigned_role__user__id": userId.toString()
|
||||
};
|
||||
List<dynamic>? statusResponse;
|
||||
|
|
|
@ -67,9 +67,12 @@ class AppRouter {
|
|||
return BlocProvider(
|
||||
create: (context) => PassCheckBloc()
|
||||
..add(GetPassCheckAreas(
|
||||
roleId: arguments.roleId, userId: arguments.userId)),
|
||||
roleIdRoleName: RoleIdRoleName(
|
||||
roleId: arguments.roleIdRoleName.roleId,
|
||||
roleName: arguments.roleIdRoleName.roleName),
|
||||
userId: arguments.userId)),
|
||||
child: QRCodeScannerSettings(
|
||||
roleId: arguments.roleId,
|
||||
roleIdRoleName: arguments.roleIdRoleName,
|
||||
userId: arguments.userId,
|
||||
),
|
||||
);
|
||||
|
|
|
@ -22,20 +22,20 @@ class Request {
|
|||
response = await get(Uri.https(host, path!, param), headers: headers)
|
||||
.timeout(Duration(seconds: requestTimeout));
|
||||
} on TimeoutException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on SocketException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on FormatException catch (_) {
|
||||
throw const FormatException(formatError);
|
||||
|
@ -43,12 +43,12 @@ class Request {
|
|||
throw const HttpException(httpError);
|
||||
} on Error catch (e) {
|
||||
debugPrint("get request error: $e");
|
||||
Fluttertoast.showToast(
|
||||
msg: onError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: onError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (onError);
|
||||
}
|
||||
return response;
|
||||
|
@ -65,20 +65,20 @@ class Request {
|
|||
headers: headers, body: jsonEncode(body))
|
||||
.timeout(Duration(seconds: requestTimeout));
|
||||
} on TimeoutException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on SocketException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on FormatException catch (_) {
|
||||
throw const FormatException(formatError);
|
||||
|
@ -86,12 +86,12 @@ class Request {
|
|||
throw const HttpException(httpError);
|
||||
} on Error catch (e) {
|
||||
debugPrint("post request error: $e");
|
||||
Fluttertoast.showToast(
|
||||
msg: onError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: onError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (e.toString());
|
||||
}
|
||||
return response;
|
||||
|
@ -107,20 +107,20 @@ class Request {
|
|||
response = await put(Uri.https(host, path, param),
|
||||
headers: headers, body: jsonEncode(body));
|
||||
} on TimeoutException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on SocketException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on FormatException catch (_) {
|
||||
throw const FormatException(formatError);
|
||||
|
@ -128,12 +128,12 @@ class Request {
|
|||
throw const HttpException(httpError);
|
||||
} on Error catch (e) {
|
||||
debugPrint("post request error: $e");
|
||||
Fluttertoast.showToast(
|
||||
msg: onError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: onError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (e.toString());
|
||||
}
|
||||
return response;
|
||||
|
@ -149,20 +149,20 @@ class Request {
|
|||
response = await patch(
|
||||
path: host + path, headers: headers, body: body, param: param);
|
||||
} on TimeoutException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on SocketException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on FormatException catch (_) {
|
||||
throw const FormatException(formatError);
|
||||
|
@ -170,12 +170,12 @@ class Request {
|
|||
throw const HttpException(httpError);
|
||||
} on Error catch (e) {
|
||||
debugPrint("post request error: $e");
|
||||
Fluttertoast.showToast(
|
||||
msg: onError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: onError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (e.toString());
|
||||
}
|
||||
return response;
|
||||
|
@ -192,32 +192,32 @@ class Request {
|
|||
headers: headers, body: jsonEncode(body))
|
||||
.timeout(Duration(seconds: requestTimeout));
|
||||
} on TimeoutException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on SocketException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: timeoutError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (timeoutError);
|
||||
} on FormatException catch (_) {
|
||||
throw const FormatException(formatError);
|
||||
} on HttpException catch (_) {
|
||||
throw const HttpException(httpError);
|
||||
} on Error catch (e) {
|
||||
Fluttertoast.showToast(
|
||||
msg: onError,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: onError,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.BOTTOM,
|
||||
// backgroundColor: Colors.black,
|
||||
// );
|
||||
throw (e.toString());
|
||||
}
|
||||
return response;
|
||||
|
|
Loading…
Reference in New Issue