tested profile screen

feature/passo/PASSO-#1-Sync-data-from-device-to-postgre-and-vice-versa
PGAN-MIS 2023-08-20 17:36:16 +08:00
parent 14dd524c71
commit 7cc0ab1f56
47 changed files with 1307 additions and 276 deletions

View File

@ -49,27 +49,6 @@ class OrganizationMembershipBloc
agencies: agencies,
agencyCategory: agencyCategory));
});
////SHOW ADD ORG MEMBERSHIP FORM
on<ShowAddOrgMembershipForm>((event, emit) async {
emit(OrgmembershipLoadingState());
try {
if (agencies.isEmpty) {
List<Agency> newAgencies =
await ProfileUtilities.instance.getAgecies();
agencies = newAgencies;
}
if (agencyCategory.isEmpty) {
List<Category> newAgencyCategories =
await ProfileUtilities.instance.agencyCategory();
agencyCategory = newAgencyCategories;
}
emit(AddOrgMembershipState(
agencies: agencies, agencyCategories: agencyCategory));
} catch (e) {
emit(OrganizationMembershipErrorState(message: e.toString()));
}
});
//// ADD ORGMEMBERSHIP
on<AddOrgMembership>((event, emit) async {
try {

View File

@ -1,9 +1,7 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:unit2/bloc/profile/eligibility/eligibility_bloc.dart';
import 'package:unit2/model/location/barangay.dart';
import 'package:unit2/model/location/subdivision.dart';
import 'package:unit2/model/profile/voluntary_works.dart';
import 'package:unit2/sevices/profile/address_service.dart';
import '../../../../model/location/city.dart';

View File

@ -17,16 +17,7 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
List<ProfileOtherInfo> indigencies = [];
List<ProfileOtherInfo> disabilities = [];
List<ProfileOtherInfo> genders = [];
List<String> bloodType = [
"A+",
"B+",
"A-",
"B-",
"AB+",
"AB-",
"O+",
"O-"
];
List<String> bloodType = ["A+", "B+", "A-", "B-", "AB+", "AB-", "O+", "O-"];
List<String> nameExtensions = [
"NONE",
"N/A",
@ -56,9 +47,12 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
on<LoadProfile>((event, emit) async {
emit(ProfileLoading());
try {
ProfileInformation? profileInformation =
await ProfileService.instance.getProfile(event.token, event.userID);
globalProfileInformation = profileInformation;
if (globalProfileInformation == null) {
ProfileInformation? profileInformation = await ProfileService.instance
.getProfile(event.token, event.userID);
globalProfileInformation = profileInformation;
}
emit(ProfileLoaded(profileInformation: globalProfileInformation!));
} catch (e) {
emit(ProfileErrorState(mesage: e.toString()));
@ -69,8 +63,8 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
emit(BasicInformationProfileLoaded(
primaryBasicInformation: event.primaryBasicInformation));
});
on<LoadBasicPrimaryInfo>((event,emit){
emit(BasicInformationProfileLoaded(
on<LoadBasicPrimaryInfo>((event, emit) {
emit(BasicInformationProfileLoaded(
primaryBasicInformation: currentProfileInformation!));
});
on<ShowPrimaryInfoEditForm>((event, emit) async {
@ -79,22 +73,34 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
if (religions.isEmpty) {
religions = await ProfileOtherInfoServices.instace
.getReligions(token: event.token);
religions.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
}
if (genders.isEmpty) {
genders = await ProfileOtherInfoServices.instace
.getGenders(token: event.token);
genders.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
}
if (ethnicities.isEmpty) {
ethnicities = await ProfileOtherInfoServices.instace
.getEthnicity(token: event.token);
ethnicities.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
}
if (disabilities.isEmpty) {
disabilities = await ProfileOtherInfoServices.instace
.getDisability(token: event.token);
disabilities.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
}
if (indigencies.isEmpty) {
indigencies = await ProfileOtherInfoServices.instace
.getIndigency(token: event.token);
indigencies.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
}
emit(BasicInformationEditingState(
primaryInformation: currentProfileInformation!,

View File

@ -3,7 +3,6 @@ import 'package:equatable/equatable.dart';
import 'package:intl/intl.dart';
import 'package:unit2/sevices/profile/volunatary_services.dart';
import 'package:unit2/utils/profile_utilities.dart';
import '../../../model/location/city.dart';
import '../../../model/location/country.dart';
import '../../../model/location/provinces.dart';
@ -13,7 +12,6 @@ import '../../../model/utils/agency.dart';
import '../../../model/utils/category.dart';
import '../../../model/utils/position.dart';
import '../../../utils/location_utilities.dart';
part 'voluntary_work_event.dart';
part 'voluntary_work_state.dart';

View File

@ -1,17 +1,14 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:unit2/bloc/profile/eligibility/eligibility_bloc.dart';
import 'package:unit2/model/profile/work_history.dart';
import 'package:unit2/model/utils/agency.dart';
import 'package:unit2/model/utils/agency_position.dart';
import 'package:unit2/model/utils/position.dart';
import 'package:unit2/sevices/profile/work_history_services.dart';
import 'package:unit2/utils/profile_utilities.dart';
import '../../../model/profile/attachment.dart';
import '../../../model/utils/category.dart';
import '../../../utils/attachment_services.dart';
part 'workHistory_event.dart';
part 'workHistory_state.dart';

View File

@ -1,9 +1,7 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:unit2/bloc/rbac/rbac_operations/roles_under/roles_under_bloc.dart';
import 'package:unit2/model/rbac/role_extend.dart';
import 'package:unit2/sevices/roles/rbac_operations/role_extend_services.dart';
import '../../../../model/rbac/rbac.dart';
import '../../../../sevices/roles/rbac_operations/role_services.dart';

View File

@ -0,0 +1,79 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:unit2/model/rbac/rbac.dart';
import 'package:unit2/model/rbac/role_under.dart';
import '../../../../../sevices/roles/est_point_person/est_point_person_role_assignment_services.dart';
import '../../../../../sevices/roles/rbac_operations/role_services.dart';
import '../../../../../sevices/roles/rbac_operations/roles_under_services.dart';
part 'est_point_person_assinable_role_event.dart';
part 'est_point_person_assinable_role_state.dart';
class EstPointPersonAssinableRoleBloc extends Bloc<
EstPointPersonAssinableRoleEvent, EstPointPersonAssinableRoleState> {
EstPointPersonAssinableRoleBloc()
: super(EstPointPersonAssinableRoleInitial()) {
List<RBAC> rolesUnder = [];
List<RBAC> roles = [];
RBAC? mainRole;
on<GetEstPointPersonAssignableRoles>((event, emit) async {
emit(EstPointPersonAssignableRoleLoadingState());
try {
if (rolesUnder.isEmpty) {
List<RolesUnder> rolesUnders = await EstPointPersonRoleAssignment
.instance
.getRolesUnder(roleId: event.roleId);
for (var roleUnder in rolesUnders) {
RBAC roleChild = roleUnder.roleUnderChild;
roleChild.id = roleUnder.id;
rolesUnder.add(roleUnder.roleUnderChild);
}
}
if (roles.isEmpty) {
roles = await RbacRoleServices.instance.getRbacRoles();
}
RBAC role = roles.firstWhere((e) => e.id == event.roleId);
mainRole = role;
emit(EstPointPersonAssignableRoleLoaded(
roles: roles, rolesUnder: rolesUnder, mainRole: role));
} catch (e) {
emit(EstPointPersonAssignableErrorState(message: e.toString()));
}
});
on<AddEstPointPersonAssignableRoles>((event, emit) async {
try {
emit(EstPointPersonAssignableRoleLoadingState());
Map<dynamic, dynamic> statusResponse = await RbacRoleUnderServices
.instance
.add(roleId: event.mainRoleId, rolesId: event.rolesUnder);
if (statusResponse['success']) {
emit(EstPointPersonAssignableRoleLoaded(
mainRole: mainRole!, roles: roles, rolesUnder: rolesUnder));
} else {
emit(EstPointPersonAssignableRoleLoaded(
mainRole: mainRole!, roles: roles, rolesUnder: rolesUnder));
}
} catch (e) {
emit(EstPointPersonAssignableErrorState(message: e.toString()));
}
});
on<DeleteEstPointPersonAssignableRoles>((event, emit) async {
emit(EstPointPersonAssignableRoleLoadingState());
try {
bool success = await RbacRoleUnderServices.instance
.deleteRbacRoleUnder(roleUnderId: event.roleId);
if (success) {
rolesUnder.removeWhere((element) => element.id == event.roleId);
emit(EstPointPersonAssignableDeletedState(success: success));
} else {
emit(EstPointPersonAssignableDeletedState(success: success));
}
} catch (e) {
emit(EstPointPersonAssignableErrorState(message: e.toString()));
}
});
}
}

View File

@ -0,0 +1,28 @@
part of 'est_point_person_assinable_role_bloc.dart';
abstract class EstPointPersonAssinableRoleEvent extends Equatable {
const EstPointPersonAssinableRoleEvent();
@override
List<Object> get props => [];
}
class GetEstPointPersonAssignableRoles
extends EstPointPersonAssinableRoleEvent {
final int roleId;
const GetEstPointPersonAssignableRoles({required this.roleId});
}
class AddEstPointPersonAssignableRoles
extends EstPointPersonAssinableRoleEvent {
final int mainRoleId;
final List<int> rolesUnder;
const AddEstPointPersonAssignableRoles(
{required this.mainRoleId, required this.rolesUnder});
}
class DeleteEstPointPersonAssignableRoles
extends EstPointPersonAssinableRoleEvent {
final int roleId;
const DeleteEstPointPersonAssignableRoles({required this.roleId});
}

View File

@ -0,0 +1,38 @@
part of 'est_point_person_assinable_role_bloc.dart';
abstract class EstPointPersonAssinableRoleState extends Equatable {
const EstPointPersonAssinableRoleState();
@override
List<Object> get props => [];
}
class EstPointPersonAssignableRoleLoadingState
extends EstPointPersonAssinableRoleState {}
class EstPointPersonAssignableErrorState
extends EstPointPersonAssinableRoleState {
final String message;
const EstPointPersonAssignableErrorState({required this.message});
}
class EstPointPersonAssginableRoleAssignState
extends EstPointPersonAssinableRoleState {
final Map<dynamic, dynamic> responseStatus;
const EstPointPersonAssginableRoleAssignState({required this.responseStatus});
}
class EstPointPersonAssinableRoleInitial
extends EstPointPersonAssinableRoleState {}
class EstPointPersonAssignableRoleLoaded
extends EstPointPersonAssinableRoleState {
final List<RBAC> roles;
final List<RBAC> rolesUnder;
final RBAC mainRole;
const EstPointPersonAssignableRoleLoaded({required this.roles, required this.rolesUnder, required this.mainRole});
}
class EstPointPersonAssignableDeletedState extends EstPointPersonAssinableRoleState {
final bool success;
const EstPointPersonAssignableDeletedState({required this.success});
}

View File

@ -0,0 +1,79 @@
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:unit2/model/rbac/assigned_role.dart';
import 'package:unit2/model/rbac/role_under.dart';
import '../../../../../model/rbac/rbac.dart';
import '../../../../../sevices/roles/est_point_person/est_point_person_role_assignment_services.dart';
import '../../../../../sevices/roles/rbac_operations/role_assignment_services.dart';
part 'est_role_assignment_event.dart';
part 'est_role_assignment_state.dart';
class EstRoleAssignmentBloc
extends Bloc<EstRoleAssignmentEvent, EstRoleAssignmentState> {
EstRoleAssignmentBloc() : super(EstRoleAssignmentInitial()) {
List<RolesUnder> rolesUnders = [];
List<AssignedRole> assignedRoles = [];
List<RBAC> assignableRoles = [];
on<GetEstPointPersonRolesUnder>((event, emit) async {
emit(EstPointPersonRoleLoadingState());
try {
if (assignedRoles.isEmpty) {
assignedRoles = await EstPointPersonRoleAssignment.instance
.getAssignedRoles(webuserId: event.userId);
}
if (rolesUnders.isEmpty) {
rolesUnders = await EstPointPersonRoleAssignment.instance
.getRolesUnder(roleId: 16);
}
for (var roleUnder in rolesUnders) {
assignableRoles.add(roleUnder.roleUnderChild);
}
emit(EstPointPersonRolesUnderLoadedState(
assignedRoles: assignedRoles,
rolesUnders: rolesUnders,
assignableRole: assignableRoles));
} catch (e) {
emit(EstPointPersonRolesUnderErrorState(message: e.toString()));
}
});
on<EstPointPersonAssignRole>((event, emit) async {
emit(EstPointPersonRoleLoadingState());
try {
Map<dynamic, dynamic> statusResponse =
await RbacRoleAssignmentServices.instance.add(
userId: event.userId,
assignerId: event.assingerId,
roles: event.rolesId);
if (statusResponse['success']) {
assignedRoles = [];
statusResponse['data'].forEach((var roles) {
AssignedRole newAssignRole = AssignedRole.fromJson(roles);
});
emit(EstPointPersonRoleUnderAddedState(response: statusResponse));
} else {
emit(EstPointPersonRoleUnderAddedState(response: statusResponse));
}
} catch (e) {
emit(EstPointPersonRolesUnderErrorState(message: e.toString()));
}
});
on<EstPointPersonDeleteAssignRole>((event, emit) async {
emit(EstPointPersonRoleLoadingState());
try {
bool success = await RbacRoleAssignmentServices.instance
.deleteAssignedRole(roleId: event.roleId);
if (success) {
assignedRoles.removeWhere((element) => element.id == event.roleId);
emit(EstPointPersonDeletedState(success: success));
} else {
emit(EstPointPersonDeletedState(success: success));
}
} catch (e) {
emit(EstPointPersonRolesUnderErrorState(message: e.toString()));
}
});
}
}

View File

@ -0,0 +1,25 @@
part of 'est_role_assignment_bloc.dart';
abstract class EstRoleAssignmentEvent extends Equatable {
const EstRoleAssignmentEvent();
@override
List<Object> get props => [];
}
class GetEstPointPersonRolesUnder extends EstRoleAssignmentEvent{
final int userId;
const GetEstPointPersonRolesUnder({required this.userId});
}
class EstPointPersonAssignRole extends EstRoleAssignmentEvent{
final int userId;
final List<int> rolesId;
final int assingerId;
const EstPointPersonAssignRole({required this.assingerId, required this.rolesId, required this.userId});
}
class EstPointPersonDeleteAssignRole extends EstRoleAssignmentEvent {
final int roleId;
const EstPointPersonDeleteAssignRole({required this.roleId});
}

View File

@ -0,0 +1,36 @@
part of 'est_role_assignment_bloc.dart';
abstract class EstRoleAssignmentState extends Equatable {
const EstRoleAssignmentState();
@override
List<Object> get props => [];
}
class EstPointPersonRolesUnderLoadedState extends EstRoleAssignmentState{
final List<RolesUnder> rolesUnders;
final List<AssignedRole> assignedRoles;
final List<RBAC> assignableRole;
const EstPointPersonRolesUnderLoadedState({required this.assignedRoles, required this.rolesUnders, required this.assignableRole});
}
class EstPointPersonRolesUnderErrorState extends EstRoleAssignmentState{
final String message;
const EstPointPersonRolesUnderErrorState({required this.message});
}
class EstPointPersonRoleLoadingState extends EstRoleAssignmentState{
}
class EstPointPersonRoleUnderAddedState extends EstRoleAssignmentState{
final Map<dynamic,dynamic> response;
const EstPointPersonRoleUnderAddedState({required this.response});
}
class EstPointPersonDeletedState extends EstRoleAssignmentState {
final bool success;
const EstPointPersonDeletedState({required this.success});
}
class EstRoleAssignmentInitial extends EstRoleAssignmentState {}

View File

@ -26,7 +26,6 @@ class RoleAssignmentBloc
fname = event.firstname;
lname = event.lastname;
fullname = "${event.firstname} ${event.lastname}";
try {
profile = await RbacRoleAssignmentServices.instance.searchUser(
page: 1, name: event.firstname, lastname: event.lastname);

View File

@ -10,7 +10,7 @@ RBAC rbacFromJson(String str) => RBAC.fromJson(json.decode(str));
String rbacToJson(RBAC data) => json.encode(data.toJson());
class RBAC {
final int? id;
int? id;
final String? name;
final String? slug;
final String? shorthand;

View File

@ -1,4 +1,6 @@
import '../../utils/category.dart';
class AgencyAssignedArea {
final bool? isactive;
final Area? area;
@ -51,25 +53,6 @@ class Area {
};
}
class Category {
final int? id;
final IndustryClass? industryClass;
Category({
required this.id,
required this.industryClass,
});
factory Category.fromJson(Map<String, dynamic> json) => Category(
id: json["id"],
industryClass: json["industry_class"] == null?null:IndustryClass.fromJson(json["industry_class"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"industry_class": industryClass?.toJson(),
};
}
class IndustryClass {
final int? id;

View File

@ -26,6 +26,7 @@ class AddressScreen extends StatelessWidget {
int? profileId;
String? token;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: context.watch<AddressBloc>().state is AddAddressState?const Text("Add Address"):context.watch<AddressBloc>().state is EditAddressState?const Text("Edit Address"):const Text("Addresses"),
centerTitle: true,

View File

@ -62,8 +62,8 @@ class _EditContactInformationScreenState
selectedServiceType = state.selectedServiceType;
selectedCommProvider = state.selectedProvider;
commServiceProviders = state.commServiceProviders;
primaryaContact = state.contactInfo.primary!;
active = state.contactInfo.active!;
primaryaContact = state.contactInfo.primary;
active = state.contactInfo.active;
numberMailController.text = state.contactInfo.numbermail!;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 24),
@ -223,7 +223,7 @@ class _EditContactInformationScreenState
});
},
decoration: normalTextFieldStyle("", ''),
name: 'overseas',
name: 'primary',
title: const Text("Primary ?"),
);
}),
@ -241,7 +241,7 @@ class _EditContactInformationScreenState
});
},
decoration: normalTextFieldStyle("", ''),
name: 'overseas',
name: 'active',
title: const Text("Active ?"),
);
}),

View File

@ -28,6 +28,7 @@ class ContactInformationScreen extends StatelessWidget {
String token;
return SafeArea(
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: context.watch<ContactBloc>().state is ContactAddingState
? const Text("Add Contact")

View File

@ -99,16 +99,9 @@ class _EditBasicProfileInfoScreenState
state.primaryInformation.disability!.toLowerCase());
}
state.genders.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
state.indigenous.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
state.disability.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
state.ethnicity.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
state.religion.insert(
0, ProfileOtherInfo(id: null, name: "NONE", description: null));
return Container(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 32),
child: FormBuilder(
@ -375,7 +368,7 @@ class _EditBasicProfileInfoScreenState
////Indigency
Flexible(
flex: 1,
child: DropdownButtonFormField<ProfileOtherInfo>(
child: DropdownButtonFormField<ProfileOtherInfo>(
isExpanded: true,
value: selectedIndigency,
decoration: normalTextFieldStyle("Indigency", ""),
@ -408,6 +401,9 @@ class _EditBasicProfileInfoScreenState
.toList(),
onChanged: (e) {
selectedEthnicity = e;
print(selectedEthnicity!.name);
print(selectedEthnicity!
.id);
},
),
),
@ -444,6 +440,7 @@ class _EditBasicProfileInfoScreenState
Flexible(
flex: 1,
child: DropdownButtonFormField<ProfileOtherInfo>(
isExpanded: true,
value: selectedDisability,
decoration: normalTextFieldStyle("Disability", ""),
@ -524,7 +521,7 @@ class _EditBasicProfileInfoScreenState
context.read<ProfileBloc>().add(
EditBasicProfileInformation(
disabilityId: selectedDisability?.id,
ethnicityId: selectedDisability?.id,
ethnicityId: selectedEthnicity?.id,
genderId: selectedGender?.id,
indigencyId: selectedIndigency?.id,
profileId: widget.profileId,

View File

@ -29,6 +29,7 @@ class IdentificationsScreen extends StatelessWidget {
String? token;
int? profileId;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: context.watch<IdentificationBloc>().state is IdentificationAddingState ? const Text("Add Identification"):context.watch<IdentificationBloc>().state is IdentificationEditingState?const Text("Edit Identification"):const Text("Identifications"),

View File

@ -28,8 +28,6 @@ class PrimaryInfo extends StatefulWidget {
class _PrimaryInfoState extends State<PrimaryInfo> {
@override
Widget build(BuildContext context) {
final _formKey = GlobalKey<FormBuilderState>();
bool enabled = false;
DateFormat dteFormat2 = DateFormat.yMMMMd('en_US');
return Scaffold(
@ -237,6 +235,7 @@ class _PrimaryInfoState extends State<PrimaryInfo> {
Flexible(
flex: 1,
child: FormBuilderTextField(
maxLines: 2,
enabled: enabled,
name: height,
initialValue: state
@ -284,6 +283,7 @@ class _PrimaryInfoState extends State<PrimaryInfo> {
Flexible(
flex: 1,
child: FormBuilderTextField(
maxLines: 2,
enabled: enabled,
name: height,
initialValue: state.primaryBasicInformation.ip ??=
@ -316,6 +316,7 @@ class _PrimaryInfoState extends State<PrimaryInfo> {
Flexible(
flex: 1,
child: FormBuilderTextField(
maxLines: 2,
enabled: enabled,
name: height,
initialValue: state
@ -329,6 +330,7 @@ class _PrimaryInfoState extends State<PrimaryInfo> {
Flexible(
flex: 1,
child: FormBuilderTextField(
maxLines: 2,
enabled: enabled,
name: width,
initialValue: state

View File

@ -558,7 +558,7 @@ class _EditEducationScreenState extends State<EditEducationScreen> {
yearGraduated:
graduated ? yearGraduated.text : null,
unitsEarned: !graduated
? int.parse(unitsController.text)
? int.tryParse(unitsController.text)
: null,
attachments: null,
);

View File

@ -7,10 +7,7 @@ import 'package:flutter_progress_hud/flutter_progress_hud.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_svg/svg.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:unit2/bloc/profile/eligibility/eligibility_bloc.dart';
import 'package:unit2/bloc/profile/learningDevelopment/learning_development_bloc.dart';
import 'package:unit2/bloc/profile/profile_bloc.dart';
import 'package:unit2/bloc/profile/workHistory/workHistory_bloc.dart';
import 'package:unit2/bloc/user/user_bloc.dart';
import 'package:unit2/model/profile/educational_background.dart';
import 'package:unit2/screens/profile/components/education/add_modal.dart';
@ -42,6 +39,7 @@ class EducationScreen extends StatelessWidget {
int profileId;
String? token;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: context.watch<EducationBloc>().state is AddEducationState
? const FittedBox(child: Text("Add Educational Background"))
@ -322,10 +320,13 @@ class EducationScreen extends StatelessWidget {
),
Column(
children: honors
.map((Honor honor) => Text(
"-${honor.name!.trim()}",
style: Theme.of(context).textTheme.labelMedium,
))
.map((Honor honor) => Padding(
padding: const EdgeInsets.all(3.0),
child: Text(
"-${honor.name!.trim()}",
style: Theme.of(context).textTheme.labelSmall,
),
))
.toList(),
),
],
@ -398,7 +399,7 @@ class EducationScreen extends StatelessWidget {
index]));
}
if (value == 3) {
results.clear();
results.clear();
showDialog(
context: context,
builder:

View File

@ -8,10 +8,7 @@ import 'package:flutter_progress_hud/flutter_progress_hud.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_svg/svg.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:unit2/bloc/profile/education/education_bloc.dart';
import 'package:unit2/bloc/profile/learningDevelopment/learning_development_bloc.dart';
import 'package:unit2/bloc/profile/profile_bloc.dart';
import 'package:unit2/bloc/profile/workHistory/workHistory_bloc.dart';
import 'package:unit2/bloc/user/user_bloc.dart';
import 'package:unit2/model/profile/attachment.dart';
import 'package:unit2/model/profile/eligibility.dart';
@ -49,7 +46,7 @@ class EligibiltyScreen extends StatelessWidget {
return true;
},
child: Scaffold(
resizeToAvoidBottomInset: true,
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: context.watch<EligibilityBloc>().state is AddEligibilityState
? const Text("Add Eligiblity")

View File

@ -1316,6 +1316,7 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
],
),
Container(
child: children.isNotEmpty
? Column(
mainAxisSize:
@ -1332,7 +1333,7 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
const EdgeInsets
.symmetric(
horizontal: 12,
vertical: 8),
vertical: 0),
width: screenWidth,
child: Column(
mainAxisAlignment:
@ -1645,7 +1646,7 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
const EdgeInsets
.symmetric(
horizontal: 12,
vertical: 8),
vertical: 0),
width: screenWidth,
child: Column(
mainAxisAlignment:

View File

@ -8,10 +8,8 @@ import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_svg/svg.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:intl/intl.dart';
import 'package:unit2/bloc/profile/education/education_bloc.dart';
import 'package:unit2/bloc/profile/eligibility/eligibility_bloc.dart';
import 'package:unit2/bloc/profile/profile_bloc.dart';
import 'package:unit2/bloc/profile/workHistory/workHistory_bloc.dart';
import 'package:unit2/bloc/user/user_bloc.dart';
import 'package:unit2/screens/profile/components/learning_development/edit_modal.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';

View File

@ -29,6 +29,7 @@ import '../../../../theme-data.dart/form-style.dart';
import '../../../../utils/formatters.dart';
import '../../../../utils/global.dart';
import '../../../../utils/location_utilities.dart';
import '../../../../widgets/error_state.dart';
import '../../shared/add_for_empty_search.dart';
class AddLearningAndDevelopmentScreen extends StatefulWidget {
@ -141,6 +142,21 @@ class _AddLearningAndDevelopmentScreenState
SizedBox(
child: show
? SearchableDropdownFormField.paginated(
errorWidget: (value) {
return SomethingWentWrong(
message: value,
onpressed: () {
context
.read<
LearningDevelopmentBloc>()
.add(
GetLearningDevelopments(
profileId: widget
.profileId,
token:
widget.token));
});
},
noRecordTex: SizedBox(
width: double.infinity,
height: 300,
@ -189,13 +205,21 @@ class _AddLearningAndDevelopmentScreenState
paginatedRequest: (int page,
String? searchKey) async {
List<ConductedTraining>
paginatedList =
await LearningDevelopmentServices
.instance
.getConductedTrainings(
page: page,
key: searchKey ??= "");
return paginatedList.map((e) {
paginatedList=[];
try {
paginatedList =
await LearningDevelopmentServices
.instance
.getConductedTrainings(
page: page,
key: searchKey ??= "");
} catch (e) {
context
.read<LearningDevelopmentBloc>()
.add(CallErrorState(
message: e.toString()));
}
return paginatedList.map((e) {
return SearchableDropdownMenuItem(
value: e,
onTap: () {},
@ -442,70 +466,12 @@ class _AddLearningAndDevelopmentScreenState
width: screenWidth,
child: StatefulBuilder(
builder: (context, setState) {
return StatefulBuilder(
builder: (context,setState) {
return Row(
children: [
//// FROM DATE
Flexible(
flex: 1,
child: DateTimePicker(
validator:
FormBuilderValidators
.required(
errorText:
"This field is required"),
use24HourFormat:
false,
icon: const Icon(
Icons.date_range),
controller:
fromDateController,
firstDate:
DateTime(1990),
lastDate:
DateTime(2100),
selectableDayPredicate:
(date) {
if (to != null &&
to!.microsecondsSinceEpoch <=
date.microsecondsSinceEpoch) {
return false;
}
return true;
},
onChanged: (value) {
setState(() {
from = DateTime
.parse(value);
});
},
initialDate: to ==
null
? DateTime.now()
: to!.subtract(
const Duration(
days: 1)),
timeHintText:
"Date of Examination/Conferment",
decoration:
normalTextFieldStyle(
"From *",
"From *")
.copyWith(
prefixIcon:
const Icon(
Icons.date_range,
color:
Colors.black87,
)),
initialValue: null,
)),
const SizedBox(
width: 12,
),
//// TO DATE
Flexible(
return StatefulBuilder(builder:
(context, setState) {
return Row(
children: [
//// FROM DATE
Flexible(
flex: 1,
child: DateTimePicker(
validator:
@ -513,14 +479,21 @@ class _AddLearningAndDevelopmentScreenState
.required(
errorText:
"This field is required"),
use24HourFormat:
false,
icon: const Icon(
Icons
.date_range),
controller:
toDateController,
fromDateController,
firstDate:
DateTime(1990),
lastDate:
DateTime(2100),
selectableDayPredicate:
(date) {
if (from != null &&
from!.microsecondsSinceEpoch >=
if (to != null &&
to!.microsecondsSinceEpoch <=
date.microsecondsSinceEpoch) {
return false;
}
@ -528,37 +501,89 @@ class _AddLearningAndDevelopmentScreenState
},
onChanged: (value) {
setState(() {
to = DateTime.parse(
value);
from = DateTime
.parse(
value);
});
},
initialDate: from ==
initialDate: to ==
null
? DateTime.now()
: from!.add(
: to!.subtract(
const Duration(
days: 1)),
lastDate:
DateTime(2100),
decoration:
normalTextFieldStyle(
"To *",
"To *")
.copyWith(
prefixIcon:
const Icon(
Icons.date_range,
color:
Colors.black87,
),
),
days:
1)),
timeHintText:
"Date of Examination/Conferment",
decoration: normalTextFieldStyle(
"From *",
"From *")
.copyWith(
prefixIcon:
const Icon(
Icons.date_range,
color: Colors
.black87,
)),
initialValue: null,
)),
const SizedBox(
width: 12,
),
//// TO DATE
Flexible(
flex: 1,
child: DateTimePicker(
validator:
FormBuilderValidators
.required(
errorText:
"This field is required"),
controller:
toDateController,
firstDate:
DateTime(1990),
selectableDayPredicate:
(date) {
if (from != null &&
from!.microsecondsSinceEpoch >=
date.microsecondsSinceEpoch) {
return false;
}
return true;
},
onChanged: (value) {
setState(() {
to = DateTime
.parse(value);
});
},
initialDate: from ==
null
? DateTime.now()
: from!.add(
const Duration(
days: 1)),
lastDate:
DateTime(2100),
decoration:
normalTextFieldStyle(
"To *",
"To *")
.copyWith(
prefixIcon:
const Icon(
Icons.date_range,
color: Colors
.black87,
),
),
initialValue: null,
),
],
);
}
);
),
],
);
});
}),
),
const SizedBox(

View File

@ -29,6 +29,7 @@ class NonAcademicRecognitionScreen extends StatelessWidget {
int? profileId;
String? token;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: context.watch<NonAcademicRecognitionBloc>().state
is AddNonAcademeRecognitionState

View File

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
@ -18,8 +19,11 @@ import '../../../../../utils/formatters.dart';
class AddOrgMemberShipScreen extends StatefulWidget {
final int profileId;
final String token;
final List<Agency> agencies;
final List<Category> agencyCategories;
final Bloc bloc;
const AddOrgMemberShipScreen(
{super.key, required this.profileId, required this.token});
{super.key, required this.profileId, required this.token, required this.agencies, required this.agencyCategories, required this.bloc});
@override
State<AddOrgMemberShipScreen> createState() => _AddOrgMemberShipScreenState();
@ -45,20 +49,13 @@ class _AddOrgMemberShipScreenState extends State<AddOrgMemberShipScreen> {
@override
Widget build(BuildContext context) {
return BlocBuilder<OrganizationMembershipBloc, OrganizationMembershipState>(
builder: (context, state) {
if (state is AddOrgMembershipState) {
return Padding(
padding: const EdgeInsets.all(24),
child: Card(
child: SingleChildScrollView(
child: FormBuilder(
return FormBuilder(
key: _formKey,
child: Container(
padding:
const EdgeInsets.symmetric(vertical:24, horizontal: 24),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -71,14 +68,17 @@ class _AddOrgMemberShipScreenState extends State<AddOrgMemberShipScreen> {
inputFormatters: [UpperCaseTextFormatter()],
itemHeight: 100,
suggestions: state.agencies
suggestions: widget.agencies
.map((Agency agency) =>
SearchFieldListItem(agency.name!,
item: agency,
child: ListTile(
title: Text(
agency.name!.toUpperCase(),
overflow: TextOverflow.visible,
title: AutoSizeText(
agency.name!.toUpperCase(),
minFontSize: 12,
),
subtitle: Text(
agency.privateEntity == true
@ -179,7 +179,7 @@ class _AddOrgMemberShipScreenState extends State<AddOrgMemberShipScreen> {
name: addAgencyController.text.toUpperCase(),
category: null,
privateEntity: null);
state.agencies.insert(0,
widget.agencies.insert(0,
newAgency!);
addAgencyController.clear();
Navigator.pop(context);
@ -205,7 +205,7 @@ class _AddOrgMemberShipScreenState extends State<AddOrgMemberShipScreen> {
? SearchField(
focusNode: agencyCategoryFocusNode,
itemHeight: 70,
suggestions: state.agencyCategories
suggestions: widget.agencyCategories
.map((Category category) =>
SearchFieldListItem(
category.name!,
@ -322,10 +322,8 @@ class _AddOrgMemberShipScreenState extends State<AddOrgMemberShipScreen> {
category: selectedCategory,
privateEntity: isPrivate);
}
final progress = ProgressHUD.of(context);
progress!.showWithText("Loading...");
context
.read<OrganizationMembershipBloc>()
Navigator.of(context).pop();
widget.bloc
.add(AddOrgMembership(
agency: newAgency!,
profileId: widget.profileId,
@ -339,13 +337,6 @@ class _AddOrgMemberShipScreenState extends State<AddOrgMemberShipScreen> {
child: const Text(submit)),
)
]),
)),
),
),
);
}
return Container();
},
);
));
}
}

View File

@ -3,10 +3,9 @@ import 'package:flutter/material.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:fluttericon/font_awesome_icons.dart';
import 'package:unit2/bloc/profile/profile_bloc.dart';
import 'package:unit2/bloc/user/user_bloc.dart';
import 'package:unit2/model/profile/other_information/organization_memberships.dart';
import 'package:unit2/model/utils/agency.dart';
import 'package:unit2/screens/profile/components/other_information/org_membership/add_modal.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart';
@ -16,6 +15,7 @@ import 'package:unit2/widgets/Leadings/close_leading.dart';
import 'package:unit2/widgets/empty_data.dart';
import 'package:unit2/widgets/error_state.dart';
import '../../../../bloc/profile/other_information/org_membership/organization_membership_bloc.dart';
import '../../../../model/utils/category.dart';
import '../../../../utils/alerts.dart';
import '../../../../utils/global.dart';
@ -25,7 +25,10 @@ class OrgMembershipsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
String? token;
int profileId;
int? profileId;
List<Agency> agencies = [];
List<Category> agencyCategory = [];
final orgBloc = BlocProvider.of<OrganizationMembershipBloc>(context);
return Scaffold(
appBar: AppBar(
title: context.watch<OrganizationMembershipBloc>().state
@ -38,9 +41,12 @@ class OrgMembershipsScreen extends StatelessWidget {
is OrganizationMembershipLoaded
? [
AddLeading(onPressed: () {
context
.read<OrganizationMembershipBloc>()
.add(ShowAddOrgMembershipForm());
showDialog(context: (context),builder: (BuildContext context){
return AlertDialog(
title: const Text("Add Organization Membership"),
content: AddOrgMemberShipScreen(profileId: profileId!, token: token!,agencies: agencies,agencyCategories: agencyCategory,bloc: orgBloc,),
);
});
})
]
: context.watch<OrganizationMembershipBloc>().state
@ -124,6 +130,8 @@ class OrgMembershipsScreen extends StatelessWidget {
},
builder: (context, state) {
if (state is OrganizationMembershipLoaded) {
agencies = state.agencies;
agencyCategory = state.agencyCategory;
if (state.orgMemberships.isNotEmpty) {
return ListView.builder(
itemCount: state.orgMemberships.length,
@ -190,7 +198,7 @@ class OrgMembershipsScreen extends StatelessWidget {
OrganizationMembershipBloc>()
.add(DeleteOrgMemberShip(
profileId:
profileId,
profileId!,
token: token!,
org: state
.orgMemberships[
@ -225,13 +233,7 @@ class OrgMembershipsScreen extends StatelessWidget {
"You don't have any Orgazational Membership added. Please click + to add");
}
}
if (state is AddOrgMembershipState) {
return
AddOrgMemberShipScreen(
profileId: profileId,
token: token!,
);
}
if (state is OrganizationMembershipErrorState) {
return SomethingWentWrong(
message: state.message,

View File

@ -123,9 +123,12 @@ class _AddReferenceScreenState extends State<AddReferenceScreen> {
Flexible(
flex: 1,
child: FormBuilderTextField(
keyboardType: TextInputType.number,
inputFormatters: [mobileFormatter],
name: "mobile",
decoration: normalTextFieldStyle(
"Tel./Mobile *", "Tel./Mobile"),
decoration: normalTextFieldStyle(
"Mobile *",
"+63 (9xx) xxx - xxxx"),
validator: FormBuilderValidators.required(
errorText: "This field is required"),
),

View File

@ -88,7 +88,7 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
Flexible(
flex: 1,
child: FormBuilderTextField(
inputFormatters: [UpperCaseTextFormatter()],
inputFormatters: [UpperCaseTextFormatter(),mobileFormatter],
initialValue: state.ref.lastName,
decoration: normalTextFieldStyle(
"Last name *", "Last name *"),

View File

@ -23,7 +23,7 @@ class ReferencesScreen extends StatelessWidget {
int? profileId;
String? token;
return Scaffold(
resizeToAvoidBottomInset: true,
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: context.watch<ReferencesBloc>().state is AddReferenceState
? const Text("Add Personal Reference")

View File

@ -3,7 +3,6 @@ import 'package:flutter/material.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:fluttericon/font_awesome_icons.dart';
import 'package:intl/intl.dart';
import 'package:unit2/bloc/profile/profile_bloc.dart';
import 'package:unit2/bloc/user/user_bloc.dart';
@ -29,6 +28,7 @@ class VolunataryWorkScreen extends StatelessWidget {
int? profileId;
DateFormat dteFormat2 = DateFormat.yMMMMd('en_US');
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title:context.watch<VoluntaryWorkBloc>().state is AddVoluntaryWorkState? const FittedBox(child: Text("Add $voluntaryScreenTitle"),) :context.watch<VoluntaryWorkBloc>().state is EditVoluntaryWorks? const FittedBox(child: Text("Edit $voluntaryScreenTitle"),): const FittedBox(child: Text(voluntaryScreenTitle)),
backgroundColor: primary,
@ -302,7 +302,7 @@ class VolunataryWorkScreen extends StatelessWidget {
}
if (state is VoluntaryWorkErrorState) {
return SomethingWentWrong(
message: state.toString(), onpressed: () {
message: state.message, onpressed: () {
context.read<VoluntaryWorkBloc>().add(GetVoluntarWorks(profileId: profileId!, token: token!));
});
}

View File

@ -90,7 +90,7 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
StatefulBuilder(builder: (context, setState) {
return SearchField(
inputFormatters: [UpperCaseTextFormatter()],
itemHeight: 100,
itemHeight: 70,
suggestionsDecoration: box1(),
suggestions: state.agencyPositions
.map((PositionTitle position) => SearchFieldListItem(
@ -478,6 +478,7 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
),
////MONTHLY SALARY
FormBuilderTextField(
keyboardType: TextInputType.number,
onChanged: (value) {
setState(() {
salary = value;

View File

@ -9,9 +9,6 @@ import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_svg/svg.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:intl/intl.dart';
import 'package:unit2/bloc/profile/education/education_bloc.dart';
import 'package:unit2/bloc/profile/eligibility/eligibility_bloc.dart';
import 'package:unit2/bloc/profile/learningDevelopment/learning_development_bloc.dart';
import 'package:unit2/bloc/profile/profile_bloc.dart';
import 'package:unit2/bloc/user/user_bloc.dart';
import 'package:unit2/screens/profile/components/work_history/add_modal.dart';
@ -47,6 +44,7 @@ class WorkHistoryScreen extends StatelessWidget {
AttachmentCategory? selectedAttachmentCategory;
List<AttachmentCategory> attachmentCategories = [];
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: context.watch<WorkHistoryBloc>().state is AddWorkHistoryState
? const FittedBox(child: Text("Add Work History"))

View File

@ -70,14 +70,19 @@ class ProfileInfo extends StatelessWidget {
profileId = state.userData!.user!.login!.user!.profileId;
token = state.userData!.user!.login!.token!;
profile = state.userData!.employeeInfo!.profile!;
return BlocConsumer<ProfileBloc, ProfileState>(
listener: (context, state,){
listener: (
context,
state,
) {
if (state is ProfileLoading) {
final progress = ProgressHUD.of(context);
progress!.showWithText("Please wait...");
}
if (state is ProfileLoaded || state is ProfileErrorState || state is BasicInformationEditingState) {
if (state is ProfileLoaded ||
state is ProfileErrorState ||
state is BasicInformationEditingState) {
final progress = ProgressHUD.of(context);
progress?.dismiss();
}
@ -110,10 +115,17 @@ class ProfileInfo extends StatelessWidget {
),
items: [
subMenu(Icons.person, "Primary", () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) {
return BlocProvider<ProfileBloc>.value(value: ProfileBloc()..add(GetPrimaryBasicInfo(primaryBasicInformation: profile)),child: PrimaryInfo(token: token!,profileId: profileId!,),);
return BlocProvider<ProfileBloc>.value(
value: ProfileBloc()
..add(GetPrimaryBasicInfo(
primaryBasicInformation: profile)),
child: PrimaryInfo(
token: token!,
profileId: profileId!,
),
);
}));
}),
subMenu(Icons.home, "Addresses", () {
@ -159,9 +171,8 @@ class ProfileInfo extends StatelessWidget {
}));
}),
subMenu(Icons.flag, "Citizenships", () {
Navigator.push(context, MaterialPageRoute(
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) {
return BlocProvider(
create: (context) => CitizenshipBloc()
..add(GetCitizenship(
@ -169,7 +180,8 @@ class ProfileInfo extends StatelessWidget {
.profileInformation
.basicInfo
.citizenships)),
child: CitizenShipScreen(profileId: profileId!,token: token!),
child: CitizenShipScreen(
profileId: profileId!, token: token!),
);
}));
}),
@ -368,13 +380,15 @@ class ProfileInfo extends StatelessWidget {
);
}
if (state is ProfileLoading) {
return const LoadingScreen();
}
if (state is ProfileErrorState) {
return SomethingWentWrong(message: state.mesage, onpressed: (){ BlocProvider.of<ProfileBloc>(
context)
.add(LoadProfile(token:token!, userID: profileId!));});
return SomethingWentWrong(
message: state.mesage,
onpressed: () {
BlocProvider.of<ProfileBloc>(context).add(
LoadProfile(token: token!, userID: profileId!));
});
}
return Container();

View File

@ -10,9 +10,14 @@ import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/theme-data.dart/form-style.dart';
import '../../../../../bloc/rbac/rbac_operations/agency/agency_bloc.dart';
import '../../../../../bloc/role/pass_check/est_point_person/assign_area/assign_area_agency_bloc.dart';
import '../../../../../bloc/role/pass_check/est_point_person/est_point_person_assignable/est_point_person_assinable_role_bloc.dart';
import '../../../../../bloc/role/pass_check/est_point_person/est_point_person_role_assignment/est_role_assignment_bloc.dart';
import '../../../../../bloc/role/pass_check/est_point_person/est_point_person_station/est_point_person_station_bloc.dart';
import '../../../../../sevices/roles/est_point_person/est_point_person_role_assignment_services.dart';
import '../../../../superadmin/agency.dart/agency_screen.dart';
import '../../../roles/establishment_point_person/est_point_person_agecies.dart';
import '../../../roles/establishment_point_person/est_point_person_role_member_screen.dart';
import '../../../roles/establishment_point_person/est_point_person_role_under_screen.dart';
import '../../../roles/establishment_point_person/est_point_person_station.dart';
import './shared_card_label.dart';
@ -204,6 +209,23 @@ class _DashBoardState extends State<DashBoard> {
);
}));
}
if (e.object.name!.toLowerCase() == "role member") {
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) {
return BlocProvider<EstRoleAssignmentBloc>(
create: (context) => EstRoleAssignmentBloc()..add(GetEstPointPersonRolesUnder(userId: widget.userId)),
child: EstPointPersonRoleAssignmentScreen(id: widget.userId,),
);
}));
}
if (e.object.name!.toLowerCase() == 'assignable role') {
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) {
return BlocProvider<EstPointPersonAssinableRoleBloc>(
create: (context) => EstPointPersonAssinableRoleBloc()..add(const GetEstPointPersonAssignableRoles(roleId: 16)),
child: EstPointPersonRoleUnderScreen(id: widget.userId,),
);
}));
}
////Station
if (e.object.name == 'Station') {
showDialog(

View File

@ -75,9 +75,7 @@ class SuperAdminMenu extends StatelessWidget {
? CardLabel(
icon: iconGenerator(name: object.object.name!),
title:
object.object.name!.toLowerCase() == 'assignable role'
? "Role Assignment"
: object.object.name!,
object.object.name!,
ontap: () {
if (object.object.name == 'Role') {
Navigator.push(context, MaterialPageRoute(

View File

@ -0,0 +1,307 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
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:group_list_view/group_list_view.dart';
import 'package:multi_dropdown/models/value_item.dart';
import 'package:multi_dropdown/multiselect_dropdown.dart';
import 'package:unit2/bloc/role/pass_check/est_point_person/est_point_person_role_assignment/est_role_assignment_bloc.dart';
import 'package:unit2/bloc/role/pass_check/est_point_person/est_point_person_station/est_point_person_station_bloc.dart';
import 'package:unit2/bloc/role_assignment/role_assignment_bloc.dart';
import 'package:unit2/theme-data.dart/form-style.dart';
import 'package:unit2/widgets/Leadings/add_leading.dart';
import 'package:unit2/widgets/empty_data.dart';
import 'package:unit2/widgets/error_state.dart';
import '../../../../model/rbac/assigned_role.dart';
import '../../../../model/rbac/rbac.dart';
import '../../../../theme-data.dart/btn-style.dart';
import '../../../../theme-data.dart/colors.dart';
import '../../../../utils/alerts.dart';
import '../../../../utils/global_context.dart';
class EstPointPersonRoleAssignmentScreen extends StatelessWidget {
final int id;
const EstPointPersonRoleAssignmentScreen({super.key, required this.id});
@override
Widget build(BuildContext context) {
Map<String, List<Content>> assignedRoles = {};
List<AssignedRole> roles = [];
List<ValueItem> valueItemAssignableRoles = [];
List<ValueItem> selectedValueItemAssignableRoles = [];
List<RBAC> assignabledRoles = [];
List<Content> users = [];
List<int> userIds = [];
int? selectedUserId;
final formKey = GlobalKey<FormBuilderState>();
final parent = context;
return Scaffold(
appBar: AppBar(
title: const Text("Role Members"),
backgroundColor: primary,
actions: [
AddLeading(onPressed: () {
for (var role in roles) {
String fullname =
"${role.user!.firstName} ${role.user!.lastName}";
if (!userIds.contains(role.user!.id)) {
userIds.add(role.user!.id);
users.add(Content(id: role.user!.id, name: fullname));
}
}
showDialog(
context: NavigationService.navigatorKey.currentState!.context,
builder: (context) {
valueItemAssignableRoles = assignabledRoles.map((e) {
return ValueItem(label: e.name!, value: e.id.toString());
}).toList();
return AlertDialog(
title: const Text("Assign Role to User"),
content: FormBuilder(
key: formKey,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
FormBuilderDropdown(
decoration: normalTextFieldStyle(
"Select Person", "Select Person"),
name: 'users',
onChanged: (value) {
selectedUserId = value!.id;
},
items: users.map((e) {
return DropdownMenuItem(
value: e,
child: Text(e.name),
);
}).toList()),
const SizedBox(
height: 12,
),
MultiSelectDropDown(
onOptionSelected:
(List<ValueItem> selectedOptions) {
selectedValueItemAssignableRoles =
selectedOptions;
},
borderColor: Colors.grey,
borderWidth: 1,
borderRadius: 5,
hint: "Select Roles",
padding: const EdgeInsets.all(8),
options: valueItemAssignableRoles,
selectionType: SelectionType.multi,
chipConfig:
const ChipConfig(wrapType: WrapType.wrap),
dropdownHeight: 300,
optionTextStyle: const TextStyle(fontSize: 16),
selectedOptionIcon:
const Icon(Icons.check_circle),
),
const SizedBox(
height: 12,
),
SizedBox(
width: double.infinity,
height: 50,
child: ElevatedButton(
style: mainBtnStyle(
primary, Colors.transparent, second),
onPressed: () {
if (formKey.currentState!
.saveAndValidate()) {
List<int> rolesId = [];
for (var role in assignabledRoles) {
selectedValueItemAssignableRoles
.forEach((element) {
if (element.value ==
role.id.toString()) {
rolesId.add(role.id!);
}
});
}
parent
.read<EstRoleAssignmentBloc>()
.add(EstPointPersonAssignRole(
rolesId: rolesId,
assingerId: id,
userId: selectedUserId!));
Navigator.pop(context);
}
},
child: const Text("Add"))),
],
)),
);
});
})
],
),
body: ProgressHUD(
padding: const EdgeInsets.all(24),
backgroundColor: Colors.black87,
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
child: BlocConsumer<EstRoleAssignmentBloc, EstRoleAssignmentState>(
builder: (context, state) {
if (state is EstPointPersonRolesUnderLoadedState) {
roles = state.assignedRoles;
assignabledRoles = state.assignableRole;
assignedRoles = {};
if (state.assignedRoles.isNotEmpty) {
for (var assignedRole in state.assignedRoles) {
String? fullName =
"${assignedRole.user!.firstName} ${assignedRole.user!.lastName}";
if (!assignedRoles.keys.contains(fullName)) {
assignedRoles.addAll({fullName: []});
assignedRoles[fullName]!.add(Content(
id: assignedRole.id!, name: assignedRole.role!.name));
} else {
assignedRoles[fullName]!.add(Content(
id: assignedRole.id!,
name: assignedRole.role!.name));
}
}
}
if (state.assignedRoles.isNotEmpty) {
return GroupListView(
sectionsCount: assignedRoles.keys.toList().length,
countOfItemInSection: (int section) {
return assignedRoles.values.toList()[section].length;
},
separatorBuilder: (context, index) {
return const Divider();
},
itemBuilder: (BuildContext context, IndexPath index) {
return ListTile(
trailing: IconButton(
color: Colors.grey.shade600,
icon: const Icon(Icons.delete),
onPressed: () {
confirmAlert(context, () {
context.read<EstRoleAssignmentBloc>().add(
EstPointPersonDeleteAssignRole(
roleId: assignedRoles.values
.toList()[index.section][index.index]
.id));
}, "Delete?", "Confirm Delete?");
},
),
title: Row(
children: [
CircleAvatar(
child: Text("${index.index + 1}",
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(color: Colors.white))),
const SizedBox(
width: 20,
),
Expanded(
child: Text(
assignedRoles.values
.toList()[index.section][index.index]
.name
.toUpperCase(),
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(
fontWeight: FontWeight.w600,
color: primary),
),
),
],
),
);
},
groupHeaderBuilder: (BuildContext context, int section) {
return ListTile(
tileColor: second,
title: Text(
assignedRoles.keys.toList()[section].toUpperCase(),
style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(color: Colors.white),
),
);
},
);
} else {
return const EmptyData(message: "Empty");
}
}
if (state is EstPointPersonRolesUnderErrorState) {
return SomethingWentWrong(
message: "something went wrong. Please try again!",
onpressed: () {});
}
return Container();
}, listener: (context, state) {
if (state is EstPointPersonRoleLoadingState) {
final progress = ProgressHUD.of(context);
progress!.showWithText("Please wait...");
}
////Added State
if (state is EstPointPersonRoleUnderAddedState) {
if (state.response['success']) {
successAlert(
context, "Adding Successfull!", state.response['message'],
() {
Navigator.of(context).pop();
context
.read<EstRoleAssignmentBloc>()
.add(GetEstPointPersonRolesUnder(userId: id));
});
} else {
errorAlert(context, "Adding Failed", state.response['message'],
() {
Navigator.of(context).pop();
context
.read<EstRoleAssignmentBloc>()
.add(GetEstPointPersonRolesUnder(userId: id));
});
}
}
////Deleted State
if (state is EstPointPersonDeletedState) {
if (state.success) {
successAlert(
context, "Delete Successfull!", "Role Deleted Successfully",
() {
Navigator.of(context).pop();
context
.read<EstRoleAssignmentBloc>()
.add(GetEstPointPersonRolesUnder(userId: id));
});
} else {
errorAlert(context, "Delete Failed", "Role Delete Failed", () {
Navigator.of(context).pop();
context
.read<EstRoleAssignmentBloc>()
.add(GetEstPointPersonRolesUnder(userId: id));
});
}
}
if (state is EstPointPersonRolesUnderLoadedState ||
state is EstPointPersonRoleUnderAddedState ||
state is EstPointPersonRoleLoadingState) {
final progress = ProgressHUD.of(context);
progress!.dismiss();
}
}),
),
);
}
}
class Content {
final int id;
final String name;
const Content({required this.id, required this.name});
}

View File

@ -0,0 +1,264 @@
import 'package:app_popup_menu/app_popup_menu.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
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:multi_dropdown/models/value_item.dart';
import 'package:multi_dropdown/multiselect_dropdown.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 '../../../../bloc/role/pass_check/est_point_person/est_point_person_assignable/est_point_person_assinable_role_bloc.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';
import '../../../../theme-data.dart/form-style.dart';
import '../../../../utils/alerts.dart';
import '../../../../utils/global.dart';
import '../../../../widgets/empty_data.dart';
class EstPointPersonRoleUnderScreen extends StatelessWidget {
final int id;
const EstPointPersonRoleUnderScreen({super.key, required this.id});
@override
Widget build(BuildContext context) {
final formKey = GlobalKey<FormBuilderState>();
List<RBAC> roles = [];
List<ValueItem> valueItemRoles = [];
List<ValueItem> selectedValueItemRoles = [];
RBAC? mainRole;
return Scaffold(
appBar: AppBar(
centerTitle: true,
backgroundColor: primary,
title: const Text("Establishment Point Person Role Under Screen"),
actions: [
AddLeading(onPressed: () {
valueItemRoles = roles.map((e) {
return ValueItem(label: e.name!, value: e.name);
}).toList();
BuildContext parent = context;
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text("Add New Role"),
content: FormBuilder(
key: formKey,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
FormBuilderDropdown(
decoration: normalTextFieldStyle("", ""),
initialValue: mainRole!.name,
name: "main-role",items:[] ,),
const SizedBox(height: 12,),
MultiSelectDropDown(
onOptionSelected:
(List<ValueItem> selectedOptions) {
selectedValueItemRoles = selectedOptions;
},
borderColor: Colors.grey,
borderWidth: 1,
borderRadius: 5,
hint: "Roles Under",
padding: const EdgeInsets.all(8),
options: valueItemRoles,
selectionType: SelectionType.multi,
chipConfig:
const ChipConfig(wrapType: WrapType.wrap),
dropdownHeight: 300,
optionTextStyle: const TextStyle(fontSize: 16),
selectedOptionIcon:
const Icon(Icons.check_circle),
),
const SizedBox(
height: 8,
),
const SizedBox(
height: 12,
),
SizedBox(
width: double.infinity,
height: 50,
child: ElevatedButton(
style: mainBtnStyle(
primary, Colors.transparent, second),
onPressed: () {
if (formKey.currentState!
.saveAndValidate()) {
List<int> rolesId = [];
for (var role in roles) {
selectedValueItemRoles
.forEach((element) {
if (element.label.toLowerCase() ==
role.name?.toLowerCase()) {
rolesId.add(role.id!);
}
});
}
Navigator.pop(context);
parent.read<EstPointPersonAssinableRoleBloc>().add(
AddEstPointPersonAssignableRoles(
mainRoleId: mainRole!.id!,
rolesUnder: rolesId));
}
},
child: const Text("Add"))),
],
),
),
);
});
})
],
),
body: ProgressHUD(
padding: const EdgeInsets.all(24),
backgroundColor: Colors.black87,
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
child: BlocConsumer<EstPointPersonAssinableRoleBloc, EstPointPersonAssinableRoleState>(
listener: (context, state) {
if (state is EstPointPersonAssignableRoleLoadingState) {
final progress = ProgressHUD.of(context);
progress!.showWithText("Please wait...");
}
if (state is EstPointPersonAssignableRoleLoaded ||
state is EstPointPersonAssginableRoleAssignState ||
state is EstPointPersonAssignableErrorState) {
final progress = ProgressHUD.of(context);
progress!.dismiss();
}
////Added State
if (state is EstPointPersonAssginableRoleAssignState) {
if (state.responseStatus['success']) {
successAlert(
context, "Adding Successfull!", state.responseStatus['message'],
() {
Navigator.of(context).pop();
context.read<EstPointPersonAssinableRoleBloc>().add(GetEstPointPersonAssignableRoles(roleId:16 ));
});
} else {
errorAlert(context, "Adding Failed", state.responseStatus['message'],
() {
Navigator.of(context).pop();
context.read<EstPointPersonAssinableRoleBloc>().add(GetEstPointPersonAssignableRoles(roleId:16 ));
});
}
}
////Deleted State
if (state is EstPointPersonAssignableDeletedState) {
if (state.success) {
successAlert(
context, "Delete Successfull!", "Role Deleted Successfully",
() {
Navigator.of(context).pop();
context.read<EstPointPersonAssinableRoleBloc>().add(GetEstPointPersonAssignableRoles(roleId:16 ));
});
} else {
errorAlert(context, "Delete Failed", "Role Delete Failed", () {
Navigator.of(context).pop();
context.read<EstPointPersonAssinableRoleBloc>().add(GetEstPointPersonAssignableRoles(roleId:16 ));
});
}
}
},
builder: (context, state) {
final parent = context;
if (state is EstPointPersonAssignableRoleLoaded) {
roles = state.roles;
mainRole = state.mainRole;
if (state.rolesUnder.isNotEmpty) {
return ListView.builder(
padding:
const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
itemCount: state.rolesUnder.length,
itemBuilder: (BuildContext context, int index) {
return Column(
children: [
Container(
width: screenWidth,
decoration: box1(),
padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 8),
child: Row(
children: [
Expanded(
child: Row(
children: [
CircleAvatar(child: Text('${index+1}'),),
const SizedBox(width: 12,),
Flexible(
child: Text(state.rolesUnder[index].name!,
style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(
fontWeight: FontWeight.w500,
color: primary)),
),
],
)),
AppPopupMenu<int>(
offset: const Offset(-10, -10),
elevation: 3,
onSelected: (value) {
if (value == 1) {
confirmAlert(context, () {
context.read<EstPointPersonAssinableRoleBloc>().add(
DeleteEstPointPersonAssignableRoles(
roleId:
state.rolesUnder[index].id!));
}, "Delete?", "Confirm Delete?");
}
},
menuItems: [
popMenuItem(
text: "Remove",
value: 1,
icon: Icons.delete),
],
icon: const Icon(
Icons.more_vert,
color: Colors.grey,
),
tooltip: "Options",
),
],
),
),
const SizedBox(
height: 5,
)
],
);
});
} else {
return const EmptyData(
message: "No Role available. Please click + to add.");
}
}
if (state is EstPointPersonAssignableErrorState) {
return SomethingWentWrong(
message: state.message, onpressed: () {
context.read<RoleBloc>().add(GetRoles());
});
}
return Container();
},
),
),
);
}
}

View File

@ -68,7 +68,7 @@ class EducationService {
try {
http.Response response = await Request.instance
.postRequest(path: path, param: {}, body: body, headers: headers);
if (response.statusCode == 201) {
if (response.statusCode == 2011) {
Map data = jsonDecode(response.body);
statusResponse = data;
} else {
@ -150,7 +150,7 @@ class EducationService {
http.Response response = await Request.instance.deleteRequest(
path: path, headers: headers, body: body, param: params);
if (response.statusCode == 200) {
if (response.statusCode == 2001) {
Map data = jsonDecode(response.body);
success = data['success'];
} else {

View File

@ -21,7 +21,7 @@ class ProfileOtherInfoServices{
try {
http.Response response = await Request.instance
.getRequest(path: path, headers: headers, param: {});
if (response.statusCode == 200) {
if (response.statusCode == 20012) {
Map data = jsonDecode(response.body);
if (data['data'] != null) {
data['data'].forEach((var e) {

View File

@ -0,0 +1,163 @@
import 'dart:convert';
import 'package:unit2/model/rbac/assigned_role.dart';
import 'package:unit2/model/rbac/rbac.dart';
import 'package:unit2/utils/request.dart';
import 'package:unit2/utils/urls.dart';
import 'package:http/http.dart' as http;
import '../../../model/profile/basic_information/primary-information.dart';
import '../../../model/rbac/role_under.dart';
class EstPointPersonRoleAssignment {
static final EstPointPersonRoleAssignment _instance =
EstPointPersonRoleAssignment();
static EstPointPersonRoleAssignment get instance => _instance;
String xClientKey = "unitK3CQaXiWlPReDsBzmmwBZPd9Re1z";
String xClientKeySecret = "unitcYqAN7GGalyz";
Future<List<AssignedRole>> getAssignedRoles(
{required int webuserId}) async {
List<AssignedRole> assignedRoles = [];
String path = Url.instance.getRoleAssignment();
Map<String, String> headers = {
'Content-Type': 'application/json; charset=UTF-8',
'X-Client-Key': xClientKey,
'X-Client-Secret': xClientKeySecret
};
Map<String, String> param = {
"created_by__id": webuserId.toString()
};
try {
http.Response response = await Request.instance
.getRequest(param: param, path: path, headers: headers);
if (response.statusCode == 200) {
Map data = jsonDecode(response.body);
if (data['data'] != null) {
for (var role in data['data']) {
AssignedRole newRole = AssignedRole.fromJson(role);
assignedRoles.add(newRole);
}
}
}
} catch (e) {
throw e.toString();
}
return assignedRoles;
}
Future<List<RolesUnder>> getRolesUnder({required int roleId}) async {
List<RolesUnder> rolesUnder = [];
String path = Url.instance.getRolesUnder();
Map<String, String> headers = {
'Content-Type': 'application/json; charset=UTF-8',
'X-Client-Key': xClientKey,
'X-Client-Secret': xClientKeySecret
};
Map<String,String> param={"role_under_main__id":roleId.toString()};
try {
http.Response response = await Request.instance
.getRequest(param: param, path: path, headers: headers);
if (response.statusCode == 200) {
Map data = jsonDecode(response.body);
if (data['data'] != null) {
for (var roleUnd in data['data']) {
RolesUnder newRoleUnder = RolesUnder.fromJson(roleUnd);
rolesUnder.add(newRoleUnder);
}
}
}
} catch (e) {
throw e.toString();
}
return rolesUnder;
}
Future<bool> deleteAssignedRole({required int roleId}) async {
bool success = false;
String path = "${Url.instance.getRoleAssignment()}$roleId/";
Map<String, String> headers = {
'Content-Type': 'application/json; charset=UTF-8',
'X-Client-Key': xClientKey,
'X-Client-Secret': xClientKeySecret
};
try {
http.Response response = await Request.instance
.deleteRequest(path: path, headers: headers, body: {}, param: {});
if (response.statusCode == 200) {
success = true;
}
} catch (e) {
throw e.toString();
}
return success;
}
////Add
Future<Map<dynamic, dynamic>> add({
required int userId,
required int? assignerId,
required List<int> roles,
}) async {
String path = Url.instance.getRoleAssignment();
Map<dynamic, dynamic> statusResponse = {};
Map<String, String> headers = {
'Content-Type': 'application/json; charset=UTF-8',
'X-Client-Key': xClientKey,
'X-Client-Secret': xClientKeySecret
};
Map body = {
"user_id": userId,
"roles": roles,
"assigner_user_id": assignerId,
};
try {
http.Response response = await Request.instance
.postRequest(path: path, body: body, headers: headers, param: {});
if (response.statusCode == 201) {
Map data = jsonDecode(response.body);
statusResponse = data;
} else {
Map data = jsonDecode(response.body);
String message = data['message'];
statusResponse.addAll({'message': message});
statusResponse.addAll(
{'success': false},
);
}
} catch (e) {
throw e.toString();
}
return statusResponse;
}
Future<Profile?> searchUser(
{required int page, required String name, required String lastname}) async {
String path = Url.instance.searchUsers();
Profile? user;
Map<String, String> params = {
"profile__last_name__icontains": lastname,
"profile__first_name__icontains": name,
"page": page.toString(),
"is_paginated": "true",
};
Map<String, String> headers = {
'Content-Type': 'application/json; charset=UTF-8',
};
http.Response response = await Request.instance
.getRequest(param: params, path: path, headers: headers);
if (response.statusCode == 200) {
Map data = jsonDecode(response.body);
for(var profile in data['data']) {
int websuerId = profile['webuserid'];
Profile newUser = Profile.fromJson(profile['profile']);
newUser.webuserId = websuerId;
user= newUser;
break;
}
}
return user;
}
}

View File

@ -12,7 +12,7 @@ class AttachmentServices {
Future<List<AttachmentCategory>> getCategories() async {
List<AttachmentCategory> attachmentCategories = [];
String path = Url.instance.attachmentCategories();
String path = Url.instance.attachmentCategories()+"11232";
Map<String, String> headers = {
'Content-Type': 'application/json; charset=UTF-8',
};

View File

@ -19,7 +19,7 @@ class Request {
Map<String, String>? param}) async {
Response response;
try {
response = await get(Uri.http(host, path!, param), headers: headers)
response = await get(Uri.https(host, path!, param), headers: headers)
.timeout(Duration(seconds: requestTimeout));
} on TimeoutException catch (_) {
Fluttertoast.showToast(
@ -61,7 +61,7 @@ class Request {
Map<String, String>? param}) async {
Response response;
try {
response = await post(Uri.http(host, path!, param),
response = await post(Uri.https(host, path!, param),
headers: headers, body: jsonEncode(body))
.timeout(Duration(seconds: requestTimeout));
} on TimeoutException catch (_) {
@ -104,7 +104,7 @@ class Request {
required Map<String, dynamic>? param}) async {
Response response;
try {
response =await put(Uri.http(host,path,param),headers: headers,body: jsonEncode(body));
response =await put(Uri.https(host,path,param),headers: headers,body: jsonEncode(body));
} on TimeoutException catch (_) {
Fluttertoast.showToast(
msg: timeoutError,
@ -186,7 +186,7 @@ class Request {
required Map<String, dynamic>? param}) async {
Response response;
try {
response = await delete(Uri.http(host, path, param),
response = await delete(Uri.https(host, path, param),
headers: headers, body: jsonEncode(body))
.timeout(Duration(seconds: requestTimeout));
} on TimeoutException catch (_) {

View File

@ -5,8 +5,8 @@ class Url {
String host() {
// return '192.168.10.183:3000';
// return 'agusandelnorte.gov.ph';
return "192.168.10.219:3000";
return 'agusandelnorte.gov.ph';
// return "192.168.10.219:3000";
// return "192.168.10.241";
// return "192.168.10.221:3004";
// return "playweb.agusandelnorte.gov.ph";