fix bugs for profile and final test in live
parent
e7d6cb8133
commit
4a5d6afcbc
|
@ -241,11 +241,11 @@ class EducationBloc extends Bloc<EducationEvent, EducationState> {
|
|||
final result = await Share.shareXFiles(
|
||||
[XFile("$appDocumentPath/${event.fileName}")]);
|
||||
if (result.status == ShareResultStatus.success) {
|
||||
Fluttertoast.showToast(msg: "Attachment shared successfully");
|
||||
Fluttertoast.showToast(msg: "Attachment shared successful");
|
||||
emit(EducationAttachmentViewState(
|
||||
fileUrl: event.source, fileName: event.fileName));
|
||||
} else {
|
||||
Fluttertoast.showToast(msg: "Attachment shared unsuccessfully");
|
||||
Fluttertoast.showToast(msg: "Attachment shared unsuccessful");
|
||||
emit(EducationAttachmentViewState(
|
||||
fileUrl: event.source, fileName: event.fileName));
|
||||
}
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:unit2/screens/profile/components/eligibility/eligibility_view_attachment.dart';
|
||||
import 'package:unit2/utils/attachment_services.dart';
|
||||
import '../../../model/location/city.dart';
|
||||
import '../../../model/location/country.dart';
|
||||
|
@ -11,6 +18,7 @@ import '../../../model/utils/eligibility.dart';
|
|||
import '../../../sevices/profile/eligibility_services.dart';
|
||||
import '../../../utils/location_utilities.dart';
|
||||
import '../../../utils/profile_utilities.dart';
|
||||
import '../../../utils/request_permission.dart';
|
||||
import '../../../utils/urls.dart';
|
||||
part 'eligibility_event.dart';
|
||||
part 'eligibility_state.dart';
|
||||
|
@ -283,7 +291,40 @@ class EligibilityBloc extends Bloc<EligibilityEvent, EligibilityState> {
|
|||
});
|
||||
on<EligibiltyViewAttachmentEvent>((event,emit){
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}${event.source}';
|
||||
emit(EligibilityAttachmentViewState(fileUrl: fileUrl));
|
||||
emit(EligibilityAttachmentViewState(fileUrl: fileUrl,fileName: event.filename));
|
||||
});
|
||||
on<ShareAttachment>((event, emit) async {
|
||||
emit(EligibilityLoadingState());
|
||||
Directory directory;
|
||||
String? appDocumentPath;
|
||||
if (await requestPermission(Permission.storage)) {
|
||||
directory = await getApplicationDocumentsDirectory();
|
||||
appDocumentPath = directory.path;
|
||||
}
|
||||
try{
|
||||
final bool success = await AttachmentServices.instance.downloadAttachment(
|
||||
filename: event.fileName,
|
||||
source: event.source,
|
||||
downLoadDir: appDocumentPath!);
|
||||
if (success) {
|
||||
final result = await Share.shareXFiles(
|
||||
[XFile("$appDocumentPath/${event.fileName}")]);
|
||||
if (result.status == ShareResultStatus.success) {
|
||||
Fluttertoast.showToast(msg: "Attachment shared successful");
|
||||
emit(EligibilityAttachmentViewState(
|
||||
fileUrl: event.source, fileName: event.fileName));
|
||||
} else {
|
||||
Fluttertoast.showToast(msg: "Attachment shared unsuccessful");
|
||||
emit(EligibilityAttachmentViewState(
|
||||
fileUrl: event.source, fileName: event.fileName));
|
||||
}
|
||||
} else {
|
||||
emit(EligibilityAttachmentViewState(
|
||||
fileUrl: event.source, fileName: event.fileName));
|
||||
}
|
||||
}catch(e){
|
||||
emit(EligibilityErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,13 +103,15 @@ class DeleteEligibyAttachment extends EligibilityEvent {
|
|||
required this.token});
|
||||
}
|
||||
|
||||
class EligibilityViewAttachments extends EligibilityEvent {
|
||||
final String source;
|
||||
const EligibilityViewAttachments({required this.source});
|
||||
}
|
||||
|
||||
class EligibiltyViewAttachmentEvent extends EligibilityEvent{
|
||||
final String source;
|
||||
const EligibiltyViewAttachmentEvent({required this.source});
|
||||
final String filename;
|
||||
const EligibiltyViewAttachmentEvent({required this.source, required this.filename});
|
||||
}
|
||||
class ShareAttachment extends EligibilityEvent{
|
||||
final String fileName;
|
||||
final String source;
|
||||
const ShareAttachment({required this.fileName, required this.source});
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,12 @@ class EligibilitytAttachmentDeletedState extends EligibilityState {
|
|||
}
|
||||
|
||||
class EligibilityAttachmentViewState extends EligibilityState {
|
||||
final String fileName;
|
||||
final String fileUrl;
|
||||
const EligibilityAttachmentViewState({required this.fileUrl});
|
||||
const EligibilityAttachmentViewState({required this.fileUrl, required this.fileName});
|
||||
}
|
||||
class EligibilityAttachmentShareState extends EligibilityState{
|
||||
final bool success;
|
||||
const EligibilityAttachmentShareState({required this.success,});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:unit2/model/location/country.dart';
|
||||
import 'package:unit2/model/location/region.dart';
|
||||
import 'package:unit2/sevices/profile/learningDevelopment_service.dart';
|
||||
|
@ -13,6 +19,7 @@ import '../../../model/utils/category.dart';
|
|||
import '../../../utils/attachment_services.dart';
|
||||
import '../../../utils/location_utilities.dart';
|
||||
import '../../../utils/profile_utilities.dart';
|
||||
import '../../../utils/request_permission.dart';
|
||||
import '../../../utils/urls.dart';
|
||||
part 'learning_development_event.dart';
|
||||
part 'learning_development_state.dart';
|
||||
|
@ -328,7 +335,40 @@ class LearningDevelopmentBloc
|
|||
});
|
||||
on<LearningDevelopmentViewAttachmentEvent>((event,emit){
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}${event.source}';
|
||||
emit(LearningAndDevelopmentAttachmentViewState(fileUrl: fileUrl));
|
||||
emit(LearningAndDevelopmentAttachmentViewState(fileUrl: fileUrl, filename: event.filename));
|
||||
});
|
||||
on<ShareAttachment>((event, emit) async {
|
||||
emit(LearningDevelopmentLoadingState());
|
||||
Directory directory;
|
||||
String? appDocumentPath;
|
||||
if (await requestPermission(Permission.storage)) {
|
||||
directory = await getApplicationDocumentsDirectory();
|
||||
appDocumentPath = directory.path;
|
||||
}
|
||||
try{
|
||||
final bool success = await AttachmentServices.instance.downloadAttachment(
|
||||
filename: event.fileName,
|
||||
source: event.source,
|
||||
downLoadDir: appDocumentPath!);
|
||||
if (success) {
|
||||
final result = await Share.shareXFiles(
|
||||
[XFile("$appDocumentPath/${event.fileName}")]);
|
||||
if (result.status == ShareResultStatus.success) {
|
||||
Fluttertoast.showToast(msg: "Attachment shared successful");
|
||||
emit(LearningAndDevelopmentAttachmentViewState(
|
||||
fileUrl: event.source, filename: event.fileName));
|
||||
} else {
|
||||
Fluttertoast.showToast(msg: "Attachment shared unsuccessful");
|
||||
emit(LearningAndDevelopmentAttachmentViewState(
|
||||
fileUrl: event.source, filename: event.fileName));
|
||||
}
|
||||
} else {
|
||||
emit(LearningAndDevelopmentAttachmentViewState(
|
||||
fileUrl: event.source, filename: event.fileName));
|
||||
}
|
||||
}catch(e){
|
||||
emit(LearningDevelopmentErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -89,8 +89,15 @@ class DeleteLearningDevAttachment extends LearningDevelopmentEvent{
|
|||
}
|
||||
|
||||
class LearningDevelopmentViewAttachmentEvent extends LearningDevelopmentEvent{
|
||||
final String filename;
|
||||
final String source;
|
||||
const LearningDevelopmentViewAttachmentEvent({required this.source});
|
||||
const LearningDevelopmentViewAttachmentEvent({required this.source, required this.filename});
|
||||
}
|
||||
|
||||
class ShareAttachment extends LearningDevelopmentEvent{
|
||||
final String fileName;
|
||||
final String source;
|
||||
const ShareAttachment({required this.fileName, required this.source});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -136,6 +136,11 @@ class LearningDevAttachmentDeletedState extends LearningDevelopmentState {
|
|||
|
||||
|
||||
class LearningAndDevelopmentAttachmentViewState extends LearningDevelopmentState {
|
||||
final String filename;
|
||||
final String fileUrl;
|
||||
const LearningAndDevelopmentAttachmentViewState({required this.fileUrl});
|
||||
}
|
||||
const LearningAndDevelopmentAttachmentViewState({required this.fileUrl, required this.filename});
|
||||
}
|
||||
class LearningDevelopmentAttachmentShareState extends LearningDevelopmentState{
|
||||
final bool success;
|
||||
const LearningDevelopmentAttachmentShareState({required this.success,});
|
||||
}
|
||||
|
|
|
@ -46,24 +46,25 @@ class ContactBloc extends Bloc<ContactEvent, ContactState> {
|
|||
ServiceType serviceType;
|
||||
List<CommService> commServiceProvivers;
|
||||
CommService serviceProvider;
|
||||
try{
|
||||
if (serviceTypes.isEmpty) {
|
||||
serviceTypes = await ProfileUtilities.instance.getServiceType();
|
||||
}
|
||||
serviceType = serviceTypes.firstWhere((ServiceType element) {
|
||||
return element.id == event.contactInfo.commService!.serviceType!.id;
|
||||
});
|
||||
commServiceProvivers = await ContactService.instance
|
||||
.getServiceProvider(serviceTypeId: serviceType.id!);
|
||||
serviceProvider = commServiceProvivers.firstWhere((CommService element) =>
|
||||
element.id == event.contactInfo.commService!.id);
|
||||
emit(ContactEditingState(
|
||||
serviceTypes: serviceTypes,
|
||||
selectedServiceType: serviceType,
|
||||
commServiceProviders: commServiceProvivers,
|
||||
selectedProvider: serviceProvider,
|
||||
contactInfo: event.contactInfo));
|
||||
}catch(e){
|
||||
try {
|
||||
if (serviceTypes.isEmpty) {
|
||||
serviceTypes = await ProfileUtilities.instance.getServiceType();
|
||||
}
|
||||
serviceType = serviceTypes.firstWhere((ServiceType element) {
|
||||
return element.id == event.contactInfo.commService!.serviceType!.id;
|
||||
});
|
||||
commServiceProvivers = await ContactService.instance
|
||||
.getServiceProvider(serviceTypeId: serviceType.id!);
|
||||
serviceProvider = commServiceProvivers.firstWhere(
|
||||
(CommService element) =>
|
||||
element.id == event.contactInfo.commService!.id);
|
||||
emit(ContactEditingState(
|
||||
serviceTypes: serviceTypes,
|
||||
selectedServiceType: serviceType,
|
||||
commServiceProviders: commServiceProvivers,
|
||||
selectedProvider: serviceProvider,
|
||||
contactInfo: event.contactInfo));
|
||||
} catch (e) {
|
||||
emit(ContactErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
|
@ -81,18 +82,17 @@ class ContactBloc extends Bloc<ContactEvent, ContactState> {
|
|||
contactInformations.removeWhere(
|
||||
(ContactInfo element) => element.id == event.contactInfo.id);
|
||||
contactInformations.add(contactInfo);
|
||||
emit(ContactEditedState(
|
||||
|
||||
response: responseStatus));
|
||||
emit(ContactEditedState(response: responseStatus));
|
||||
} else {
|
||||
emit(ContactEditedState(
|
||||
|
||||
response: responseStatus));
|
||||
emit(ContactEditedState(response: responseStatus));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(ContactErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<CallErrorEvent>((event, emit) {
|
||||
emit(ContactErrorState(message: event.message));
|
||||
});
|
||||
|
||||
//// add contact
|
||||
|
||||
|
@ -107,13 +107,9 @@ class ContactBloc extends Bloc<ContactEvent, ContactState> {
|
|||
ContactInfo contactInfo =
|
||||
ContactInfo.fromJson(responseStatus['data']['contact_info']);
|
||||
contactInformations.add(contactInfo);
|
||||
emit(ContactAddedState(
|
||||
|
||||
response: responseStatus));
|
||||
emit(ContactAddedState(response: responseStatus));
|
||||
} else {
|
||||
emit(ContactAddedState(
|
||||
|
||||
response: responseStatus));
|
||||
emit(ContactAddedState(response: responseStatus));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(ContactErrorState(message: e.toString()));
|
||||
|
@ -129,11 +125,9 @@ class ContactBloc extends Bloc<ContactEvent, ContactState> {
|
|||
if (success) {
|
||||
contactInformations
|
||||
.removeWhere((element) => element.id == event.contactInfo.id);
|
||||
emit(ContactDeletedState(
|
||||
succcess: success));
|
||||
emit(ContactDeletedState(succcess: success));
|
||||
} else {
|
||||
emit(ContactDeletedState(
|
||||
succcess: success));
|
||||
emit(ContactDeletedState(succcess: success));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(ContactErrorState(message: e.toString()));
|
||||
|
|
|
@ -8,63 +8,71 @@ abstract class ContactEvent extends Equatable {
|
|||
}
|
||||
|
||||
////get contacts
|
||||
class GetContacts extends ContactEvent{
|
||||
final List<ContactInfo> contactInformations;
|
||||
class GetContacts extends ContactEvent {
|
||||
final List<ContactInfo> contactInformations;
|
||||
const GetContacts({required this.contactInformations});
|
||||
@override
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
//// load contacts
|
||||
class LoadContacts extends ContactEvent{
|
||||
|
||||
@override
|
||||
class LoadContacts extends ContactEvent {
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
//// show add form
|
||||
class ShowAddForm extends ContactEvent{
|
||||
class ShowAddForm extends ContactEvent {}
|
||||
|
||||
class CallErrorEvent extends ContactEvent {
|
||||
final String message;
|
||||
const CallErrorEvent({required this.message});
|
||||
}
|
||||
|
||||
//// show edit form
|
||||
class ShowEditForm extends ContactEvent{
|
||||
class ShowEditForm extends ContactEvent {
|
||||
final ContactInfo contactInfo;
|
||||
const ShowEditForm({required this.contactInfo});
|
||||
@override
|
||||
@override
|
||||
List<Object> get props => [contactInfo];
|
||||
|
||||
}
|
||||
|
||||
////add event
|
||||
class AddContactInformation extends ContactEvent{
|
||||
class AddContactInformation extends ContactEvent {
|
||||
final int profileId;
|
||||
final String token;
|
||||
final ContactInfo contactInfo;
|
||||
const AddContactInformation({required this.contactInfo, required this.profileId, required this.token});
|
||||
@override
|
||||
List<Object> get props => [profileId,token,contactInfo];
|
||||
const AddContactInformation(
|
||||
{required this.contactInfo,
|
||||
required this.profileId,
|
||||
required this.token});
|
||||
@override
|
||||
List<Object> get props => [profileId, token, contactInfo];
|
||||
}
|
||||
|
||||
////edit event
|
||||
class EditContactInformation extends ContactEvent{
|
||||
class EditContactInformation extends ContactEvent {
|
||||
final int profileId;
|
||||
final String token;
|
||||
final ContactInfo contactInfo;
|
||||
const EditContactInformation({required this.contactInfo, required this.profileId, required this.token});
|
||||
@override
|
||||
List<Object> get props => [profileId,token,contactInfo];
|
||||
const EditContactInformation(
|
||||
{required this.contactInfo,
|
||||
required this.profileId,
|
||||
required this.token});
|
||||
@override
|
||||
List<Object> get props => [profileId, token, contactInfo];
|
||||
}
|
||||
|
||||
//// delete event
|
||||
|
||||
class DeleteContactInformation extends ContactEvent{
|
||||
final int profileId;
|
||||
class DeleteContactInformation extends ContactEvent {
|
||||
final int profileId;
|
||||
final String token;
|
||||
final ContactInfo contactInfo;
|
||||
const DeleteContactInformation({required this.contactInfo, required this.profileId, required this.token});
|
||||
@override
|
||||
List<Object> get props => [profileId,token,contactInfo];
|
||||
const DeleteContactInformation(
|
||||
{required this.contactInfo,
|
||||
required this.profileId,
|
||||
required this.token});
|
||||
@override
|
||||
List<Object> get props => [profileId, token, contactInfo];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class WorkHistoryBloc extends Bloc<WorkHistorytEvent, WorkHistoryState> {
|
|||
});
|
||||
//// ADD WORK HISTORIES
|
||||
on<AddWorkHostory>((event, emit) async {
|
||||
// try {
|
||||
try {
|
||||
Map<dynamic, dynamic> status = await WorkHistoryService.instance.add(
|
||||
accomplishment: event.accomplishment,
|
||||
actualDuties: event.actualDuties,
|
||||
|
@ -83,36 +83,36 @@ class WorkHistoryBloc extends Bloc<WorkHistorytEvent, WorkHistoryState> {
|
|||
} else {
|
||||
emit(WorkHistoryAddedState(response: status));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(WorkHistoryErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
|
||||
////UPDATE WORK HISTORY
|
||||
on<UpdateWorkHistory>((event, emit) async {
|
||||
// try {
|
||||
Map<dynamic, dynamic> status = await WorkHistoryService.instance.update(
|
||||
isPrivate: event.isPrivate,
|
||||
workHistory: event.workHistory,
|
||||
token: event.token,
|
||||
profileId: event.profileId);
|
||||
if (status['success']) {
|
||||
WorkHistory workHistory = WorkHistory.fromJson(status['data']);
|
||||
// workExperiences.removeWhere((WorkHistory work) {
|
||||
// return work.id == event.workHistory.id;
|
||||
// });
|
||||
workExperiences.add(workHistory);
|
||||
emit(WorkHistoryEditedState(response: status));
|
||||
} else {
|
||||
emit(WorkHistoryEditedState(
|
||||
response: status,
|
||||
));
|
||||
}
|
||||
// } catch (e) {
|
||||
// emit(WorkHistoryErrorState(message: e.toString()));
|
||||
// }
|
||||
});
|
||||
|
||||
////UPDATE WORK HISTORY
|
||||
// on<UpdateWorkHistory>((event, emit) async {
|
||||
// try {
|
||||
// Map<dynamic, dynamic> status = await WorkHistoryService.instance.update(
|
||||
// oldWorkHistory: event.oldWorkHistory,
|
||||
// newWorkHistory: event.workHistory,
|
||||
// token: event.token,
|
||||
// profileId: event.profileId);
|
||||
// if (status['success']) {
|
||||
// WorkHistory workHistory = WorkHistory.fromJson(status['data']);
|
||||
// workExperiences.removeWhere((WorkHistory work) {
|
||||
// return work.id == event.oldWorkHistory.id;
|
||||
// });
|
||||
// workExperiences.add(workHistory);
|
||||
// emit(WorkHistoryEditedState(response: status));
|
||||
// } else {
|
||||
// emit(WorkHistoryEditedState(
|
||||
// response: status,
|
||||
// ));
|
||||
// }
|
||||
// } catch (e) {
|
||||
// emit(WorkHistoryErrorState(message: e.toString()));
|
||||
// }
|
||||
// });
|
||||
|
||||
////SHOW EDIT WORK HISTORIES
|
||||
on<ShowEditWorkHistoryForm>((event, emit) async {
|
||||
try {
|
||||
|
|
|
@ -46,9 +46,8 @@ class UpdateWorkHistory extends WorkHistorytEvent{
|
|||
final bool isPrivate;
|
||||
final int profileId;
|
||||
final String token;
|
||||
final String? actualDuties;
|
||||
final String? accomplishment;
|
||||
const UpdateWorkHistory({required this.profileId, required this.token, required this.workHistory, required this.accomplishment, required this.actualDuties, required this.isPrivate});
|
||||
|
||||
const UpdateWorkHistory({required this.profileId, required this.token, required this.workHistory, required this.isPrivate});
|
||||
@override
|
||||
List<Object> get props => [profileId,token,workHistory,];
|
||||
}
|
||||
|
|
|
@ -77,348 +77,341 @@ class _AddAddressScreenState extends State<AddAddressScreen> {
|
|||
const EdgeInsets.symmetric(vertical: 32, horizontal: 24),
|
||||
child: SizedBox(
|
||||
height: screenHeight * 88,
|
||||
child: Column(
|
||||
child: ListView(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
FormBuilderDropdown(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("Category*", "Category"),
|
||||
name: "category",
|
||||
onChanged: (AddressCategory? category) {
|
||||
selectedAddressCategory = category;
|
||||
},
|
||||
items: category
|
||||
.map<DropdownMenuItem<AddressCategory>>(
|
||||
(AddressCategory category) {
|
||||
return DropdownMenuItem(
|
||||
value: category, child: Text(category.name!));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Area Class
|
||||
FormBuilderDropdown(
|
||||
decoration: normalTextFieldStyle(
|
||||
"Area class *", "Area class"),
|
||||
name: "area_class",
|
||||
onChanged: (Area? area) {
|
||||
selectedAreaClass = area!.value;
|
||||
},
|
||||
items: areaClass
|
||||
.map<DropdownMenuItem<Area>>((Area area) {
|
||||
return area.group == 0
|
||||
? DropdownMenuItem(
|
||||
enabled: false,
|
||||
value: area,
|
||||
child: Text(area.value.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: Colors.black38)))
|
||||
: DropdownMenuItem(
|
||||
value: area,
|
||||
enabled: true,
|
||||
child: Text(
|
||||
" ${area.value.toUpperCase()}"));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////stateful builder
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
//// category
|
||||
FormBuilderDropdown(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("Category*", "Category"),
|
||||
name: "category",
|
||||
onChanged: (AddressCategory? category) {
|
||||
selectedAddressCategory = category;
|
||||
},
|
||||
items: category
|
||||
.map<DropdownMenuItem<AddressCategory>>(
|
||||
(AddressCategory category) {
|
||||
return DropdownMenuItem(
|
||||
value: category, child: Text(category.name!));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Area Class
|
||||
FormBuilderDropdown(
|
||||
decoration: normalTextFieldStyle(
|
||||
"Area class *", "Area class"),
|
||||
name: "area_class",
|
||||
onChanged: (Area? area) {
|
||||
selectedAreaClass = area!.value;
|
||||
},
|
||||
items: areaClass
|
||||
.map<DropdownMenuItem<Area>>((Area area) {
|
||||
return area.group == 0
|
||||
? DropdownMenuItem(
|
||||
enabled: false,
|
||||
value: area,
|
||||
child: Text(area.value.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: Colors.black38)))
|
||||
: DropdownMenuItem(
|
||||
value: area,
|
||||
enabled: true,
|
||||
child: Text(
|
||||
" ${area.value.toUpperCase()}"));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////stateful builder
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
////with block & Lot Switch
|
||||
FormBuilderSwitch(
|
||||
initialValue: hasLotandBlock,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
hasLotandBlock = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"With Lot and Block?", 'Graduated?'),
|
||||
name: 'graudated',
|
||||
title: Text(hasLotandBlock ? "YES" : "NO"),
|
||||
),
|
||||
SizedBox(
|
||||
height: hasLotandBlock ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: hasLotandBlock
|
||||
? Row(
|
||||
children: [
|
||||
////block #
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators
|
||||
.compose([numericRequired]),
|
||||
keyboardType:
|
||||
TextInputType.number,
|
||||
name: "block_number",
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Block #*", "Block #"),
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
//// lot #
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators
|
||||
.compose([numericRequired]),
|
||||
name: "lot_number",
|
||||
keyboardType:
|
||||
TextInputType.number,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Lot #*", "Lot #"),
|
||||
)),
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// Address Line
|
||||
FormBuilderTextField(
|
||||
name: "address_line",
|
||||
////with block & Lot Switch
|
||||
FormBuilderSwitch(
|
||||
initialValue: hasLotandBlock,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
hasLotandBlock = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Line ", "Address Line"),
|
||||
"With Lot and Block?", 'Graduated?'),
|
||||
name: 'graudated',
|
||||
title: Text(hasLotandBlock ? "YES" : "NO"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
SizedBox(
|
||||
height: hasLotandBlock ? 12 : 0,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Overseas Address?", ''),
|
||||
name: 'overseas',
|
||||
title: Text(overseas ? "YES" : "NO"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 8 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
FormBuilderDropdown<Region?>(
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged: (Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: hasLotandBlock
|
||||
? Row(
|
||||
children: [
|
||||
////block #
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators
|
||||
.compose([numericRequired]),
|
||||
keyboardType:
|
||||
TextInputType.number,
|
||||
name: "block_number",
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Block #*", "Block #"),
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
//// lot #
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators
|
||||
.compose([numericRequired]),
|
||||
name: "lot_number",
|
||||
keyboardType:
|
||||
TextInputType.number,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Lot #*", "Lot #"),
|
||||
)),
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// Address Line
|
||||
FormBuilderTextField(
|
||||
name: "address_line",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Line ", "Address Line"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Overseas Address?", ''),
|
||||
name: 'overseas',
|
||||
title: Text(overseas ? "YES" : "NO"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 8 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
FormBuilderDropdown<Region?>(
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged: (Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
getProvinces();
|
||||
}
|
||||
},
|
||||
initialValue: null,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
name: 'region',
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged:
|
||||
(Province? province) {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
cityCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
getProvinces();
|
||||
selectedProvince =
|
||||
province;
|
||||
getCities();
|
||||
}
|
||||
},
|
||||
initialValue: null,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
name: 'region',
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged:
|
||||
(Province? province) {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
selectedProvince =
|
||||
province;
|
||||
getCities();
|
||||
}
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
if (selectedMunicipality !=
|
||||
city) {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality = city;
|
||||
getBarangays();
|
||||
}
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
//// BARANGAY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child: DropdownButtonFormField<
|
||||
Barangay>(
|
||||
isExpanded: true,
|
||||
onChanged: (Barangay? baragay) {
|
||||
selectedBarangay = baragay;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Barangay*",
|
||||
"Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: FormBuilderDropdown<Country>(
|
||||
initialValue: null,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child:
|
||||
Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
if (selectedMunicipality !=
|
||||
city) {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality = city;
|
||||
getBarangays();
|
||||
}
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
////sumit button
|
||||
),
|
||||
//// BARANGAY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child: DropdownButtonFormField<
|
||||
Barangay>(
|
||||
isExpanded: true,
|
||||
onChanged: (Barangay? baragay) {
|
||||
selectedBarangay = baragay;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Barangay*",
|
||||
"Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: FormBuilderDropdown<Country>(
|
||||
initialValue: null,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child:
|
||||
Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 24,),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
|
@ -464,12 +457,13 @@ class _AddAddressScreenState extends State<AddAddressScreen> {
|
|||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
return Placeholder();
|
||||
return const Placeholder();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -106,208 +106,313 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
vertical: 32, horizontal: 24),
|
||||
child: SizedBox(
|
||||
height: screenHeight * 88,
|
||||
child: Column(
|
||||
child: ListView(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
//// category
|
||||
FormBuilderDropdown(
|
||||
initialValue: selectedAddressCategory,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("Category*", "Category"),
|
||||
name: "category",
|
||||
onChanged: (AddressCategory? category) {
|
||||
selectedAddressCategory = category;
|
||||
},
|
||||
items: category
|
||||
.map<DropdownMenuItem<AddressCategory>>(
|
||||
(AddressCategory category) {
|
||||
return DropdownMenuItem(
|
||||
value: category, child: Text(category.name!));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Area Class
|
||||
FormBuilderDropdown(
|
||||
initialValue: selectedAreaClass,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Area class *", "Area class"),
|
||||
name: "area_class",
|
||||
onChanged: (Area? area) {
|
||||
selectedAreaClass = area;
|
||||
},
|
||||
items: areaClass
|
||||
.map<DropdownMenuItem<Area>>((Area area) {
|
||||
return area.group == 0
|
||||
? DropdownMenuItem(
|
||||
enabled: false,
|
||||
value: area,
|
||||
child: Text(area.value.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: Colors.black38)))
|
||||
: DropdownMenuItem(
|
||||
value: area,
|
||||
enabled: true,
|
||||
child: Text(
|
||||
" ${area.value.toUpperCase()}"));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////stateful builder
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
//// category
|
||||
FormBuilderDropdown(
|
||||
initialValue: selectedAddressCategory,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("Category*", "Category"),
|
||||
name: "category",
|
||||
onChanged: (AddressCategory? category) {
|
||||
selectedAddressCategory = category;
|
||||
},
|
||||
items: category
|
||||
.map<DropdownMenuItem<AddressCategory>>(
|
||||
(AddressCategory category) {
|
||||
return DropdownMenuItem(
|
||||
value: category, child: Text(category.name!));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Area Class
|
||||
FormBuilderDropdown(
|
||||
initialValue: selectedAreaClass,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Area class *", "Area class"),
|
||||
name: "area_class",
|
||||
onChanged: (Area? area) {
|
||||
selectedAreaClass = area;
|
||||
},
|
||||
items: areaClass
|
||||
.map<DropdownMenuItem<Area>>((Area area) {
|
||||
return area.group == 0
|
||||
? DropdownMenuItem(
|
||||
enabled: false,
|
||||
value: area,
|
||||
child: Text(area.value.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: Colors.black38)))
|
||||
: DropdownMenuItem(
|
||||
value: area,
|
||||
enabled: true,
|
||||
child: Text(
|
||||
" ${area.value.toUpperCase()}"));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////stateful builder
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
////with block & Lot Switch
|
||||
FormBuilderSwitch(
|
||||
initialValue: hasLotandBlock,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
hasLotandBlock = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"With Lot and Block?", 'Graduated?'),
|
||||
name: 'graudated',
|
||||
title: Text(hasLotandBlock ? "YES" : "NO"),
|
||||
),
|
||||
SizedBox(
|
||||
height: hasLotandBlock ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: hasLotandBlock
|
||||
? Row(
|
||||
children: [
|
||||
////block #
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
initialValue: state.address
|
||||
.subdivision?.blockNo
|
||||
?.toString(),
|
||||
validator: FormBuilderValidators
|
||||
.compose([numericRequired]),
|
||||
keyboardType:
|
||||
TextInputType.number,
|
||||
name: "block_number",
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Block #*", "Block #"),
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
//// lot #
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
initialValue: state
|
||||
.address.subdivision?.lotNo
|
||||
?.toString(),
|
||||
validator: FormBuilderValidators
|
||||
.compose([numericRequired]),
|
||||
name: "lot_number",
|
||||
keyboardType:
|
||||
TextInputType.number,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Lot #*", "Lot #"),
|
||||
)),
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// Address Line
|
||||
FormBuilderTextField(
|
||||
initialValue: state.address.details,
|
||||
name: "address_line",
|
||||
////with block & Lot Switch
|
||||
FormBuilderSwitch(
|
||||
initialValue: hasLotandBlock,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
hasLotandBlock = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Line *", "Address Line"),
|
||||
"With Lot and Block?", 'Graduated?'),
|
||||
name: 'graudated',
|
||||
title: Text(hasLotandBlock ? "YES" : "NO"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
SizedBox(
|
||||
height: hasLotandBlock ? 12 : 0,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Overseas Address?", ''),
|
||||
name: 'overseas',
|
||||
title: Text(overseas ? "YES" : "NO"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 8 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: hasLotandBlock
|
||||
? Row(
|
||||
children: [
|
||||
////block #
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
initialValue: state.address
|
||||
.subdivision?.blockNo
|
||||
?.toString(),
|
||||
validator: FormBuilderValidators
|
||||
.compose([numericRequired]),
|
||||
keyboardType:
|
||||
TextInputType.number,
|
||||
name: "block_number",
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Block #*", "Block #"),
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
//// lot #
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
initialValue: state
|
||||
.address.subdivision?.lotNo
|
||||
?.toString(),
|
||||
validator: FormBuilderValidators
|
||||
.compose([numericRequired]),
|
||||
name: "lot_number",
|
||||
keyboardType:
|
||||
TextInputType.number,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Lot #*", "Lot #"),
|
||||
)),
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// Address Line
|
||||
FormBuilderTextField(
|
||||
initialValue: state.address.details,
|
||||
name: "address_line",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Line *", "Address Line"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Overseas Address?", ''),
|
||||
name: 'overseas',
|
||||
title: Text(overseas ? "YES" : "NO"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 8 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
isExpanded: true,
|
||||
value: selectedRegion,
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged: (Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
//// GET PROVINCES
|
||||
try{
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!.code
|
||||
.toString());
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
//// GET CITIES
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
////GET CITY MUNICIPALITY
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAYS
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedRegion,
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged: (Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
//// GET PROVINCES
|
||||
try{
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!.code
|
||||
.toString());
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
value: selectedProvince,
|
||||
onChanged: (Province?
|
||||
province) async {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
province;
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
|
||||
//// GET CITIES
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
code:
|
||||
selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
@ -323,40 +428,8 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
////GET CITY MUNICIPALITY
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAYS
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
|
@ -364,231 +437,151 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
});
|
||||
}
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged: (Province?
|
||||
province) async {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
selectedProvince =
|
||||
province;
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
|
||||
//// GET CITIES
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code:
|
||||
selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged: (CityMunicipality?
|
||||
city) async {
|
||||
if (selectedMunicipality !=
|
||||
city) {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality = city;
|
||||
selectedMunicipality = city;
|
||||
//// GET BARANGAYS
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
//// BARANGAY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child: DropdownButtonFormField<
|
||||
Barangay>(
|
||||
isExpanded: true,
|
||||
onChanged: (Barangay? baragay) {
|
||||
selectedBarangay = baragay;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Barangay*",
|
||||
"Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: FormBuilderDropdown<Country>(
|
||||
initialValue:selectedCountry!.id == 175?null:selectedCountry,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child:
|
||||
Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
setState((){
|
||||
selectedCountry = value;
|
||||
});
|
||||
isExpanded: true,
|
||||
onChanged: (CityMunicipality?
|
||||
city) async {
|
||||
if (selectedMunicipality !=
|
||||
city) {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality = city;
|
||||
selectedMunicipality = city;
|
||||
//// GET BARANGAYS
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
|
||||
),
|
||||
//// BARANGAY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child: DropdownButtonFormField<
|
||||
Barangay>(
|
||||
isExpanded: true,
|
||||
onChanged: (Barangay? baragay) {
|
||||
selectedBarangay = baragay;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Barangay*",
|
||||
"Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: FormBuilderDropdown<Country>(
|
||||
initialValue:selectedCountry!.id == 175?null:selectedCountry,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child:
|
||||
Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
setState((){
|
||||
selectedCountry = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 8,),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
|
@ -645,13 +638,13 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
return Placeholder();
|
||||
return const Placeholder();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class AddressScreen extends StatelessWidget {
|
|||
int? profileId;
|
||||
String? token;
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
resizeToAvoidBottomInset: true,
|
||||
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,
|
||||
|
|
|
@ -50,210 +50,206 @@ class _AddContactInformationScreenState
|
|||
builder: (context, state) {
|
||||
if (state is ContactAddingState) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 32, horizontal: 24),
|
||||
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 24),
|
||||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: StatefulBuilder(builder: (context, setState) {
|
||||
return SizedBox(
|
||||
height: screenHeight * 90,
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
|
||||
////Service Type
|
||||
FormBuilderDropdown<ServiceType>(
|
||||
return ListView(
|
||||
children: [
|
||||
////Service Type
|
||||
FormBuilderDropdown<ServiceType>(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: "service_type",
|
||||
items: state.serviceTypes
|
||||
.map<DropdownMenuItem<ServiceType>>(
|
||||
(ServiceType e) {
|
||||
return DropdownMenuItem<ServiceType>(
|
||||
value: e, child: Text(e.name!));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle("Service Type*", ""),
|
||||
onChanged: (var service) async {
|
||||
if (selectedServiceType != service) {
|
||||
selectedServiceType = service;
|
||||
setState(() {
|
||||
callServiceType = true;
|
||||
selectedCommServiceProvider = null;
|
||||
numberMailController.text = "";
|
||||
});
|
||||
|
||||
try {
|
||||
commServiceProviders = await ContactService
|
||||
.instance
|
||||
.getServiceProvider(
|
||||
serviceTypeId:
|
||||
selectedServiceType!.id!);
|
||||
} catch (e) {
|
||||
context
|
||||
.read<ContactBloc>()
|
||||
.add(CallErrorEvent(message: e.toString()));
|
||||
}
|
||||
setState(() {
|
||||
setState(() {
|
||||
callServiceType = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Service Provider
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: callServiceType,
|
||||
child: DropdownButtonFormField<CommService>(
|
||||
isExpanded: true,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
items: commServiceProviders.isEmpty
|
||||
? []
|
||||
: commServiceProviders
|
||||
.map<DropdownMenuItem<CommService>>(
|
||||
(CommService e) {
|
||||
return DropdownMenuItem<CommService>(
|
||||
value: e,
|
||||
child: Text(e
|
||||
.serviceProvider!.agency!.name!));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Communication Service *", ""),
|
||||
onChanged: (var serviceProvider) {
|
||||
selectedCommServiceProvider = serviceProvider;
|
||||
}),
|
||||
),
|
||||
),
|
||||
selectedServiceType != null
|
||||
? selectedServiceType?.id == 2
|
||||
//// Landline
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
inputFormatters: [landLineFormatter],
|
||||
name: 'number-mail',
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: "service_type",
|
||||
items: state.serviceTypes
|
||||
.map<DropdownMenuItem<ServiceType>>(
|
||||
(ServiceType e) {
|
||||
return DropdownMenuItem<ServiceType>(
|
||||
value: e, child: Text(e.name!));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle("Service Type*", ""),
|
||||
onChanged: (var service) async {
|
||||
if (selectedServiceType != service) {
|
||||
selectedServiceType = service;
|
||||
setState(() {
|
||||
callServiceType = true;
|
||||
selectedCommServiceProvider = null;
|
||||
numberMailController.text = "";
|
||||
});
|
||||
|
||||
commServiceProviders = await ContactService
|
||||
.instance
|
||||
.getServiceProvider(
|
||||
serviceTypeId: selectedServiceType!.id!);
|
||||
setState(() {
|
||||
setState(() {
|
||||
callServiceType = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Service Provider
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: callServiceType,
|
||||
child: DropdownButtonFormField<CommService>(
|
||||
isExpanded: true,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Landline number *",
|
||||
"(area code) xxx - xxxx"),
|
||||
)
|
||||
: selectedServiceType!.id == 1 ||
|
||||
selectedServiceType!.id == 19
|
||||
//// Mobile number
|
||||
? FormBuilderTextField(
|
||||
keyboardType: TextInputType.number,
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
inputFormatters: [mobileFormatter],
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
items: commServiceProviders.isEmpty
|
||||
? []
|
||||
: commServiceProviders
|
||||
.map<DropdownMenuItem<CommService>>(
|
||||
(CommService e) {
|
||||
return DropdownMenuItem<CommService>(
|
||||
value: e,
|
||||
child: Text(e
|
||||
.serviceProvider!.agency!.name!));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Communication Service *", ""),
|
||||
onChanged: (var serviceProvider) {
|
||||
selectedCommServiceProvider = serviceProvider;
|
||||
}),
|
||||
),
|
||||
),
|
||||
selectedServiceType != null
|
||||
? selectedServiceType?.id == 2
|
||||
//// Landline
|
||||
"Mobile number *",
|
||||
"+63 (9xx) xxx - xxxx"),
|
||||
)
|
||||
: selectedServiceType!.id == 4
|
||||
////Social Media
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
inputFormatters: [landLineFormatter],
|
||||
name: 'number-mail',
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Landline number *",
|
||||
"(area code) xxx - xxxx"),
|
||||
"Account ID / Username *", ""),
|
||||
)
|
||||
: selectedServiceType!.id == 1 ||
|
||||
selectedServiceType!.id == 19
|
||||
//// Mobile number
|
||||
: selectedServiceType!.id == 3
|
||||
////Email Address
|
||||
? FormBuilderTextField(
|
||||
keyboardType: TextInputType.number,
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
inputFormatters: [mobileFormatter],
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
validator: FormBuilderValidators
|
||||
.compose([
|
||||
FormBuilderValidators.email(
|
||||
errorText:
|
||||
"Input vaild email"),
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required")
|
||||
]),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Mobile number *",
|
||||
"+63 (9xx) xxx - xxxx"),
|
||||
"Email Address*", ""),
|
||||
)
|
||||
: selectedServiceType!.id == 4
|
||||
////Social Media
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Account ID / Username *", ""),
|
||||
)
|
||||
: selectedServiceType!.id == 3
|
||||
////Email Address
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
validator: FormBuilderValidators
|
||||
.compose([
|
||||
FormBuilderValidators.email(
|
||||
errorText:
|
||||
"Input vaild email"),
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required")
|
||||
]),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Email Address*", ""),
|
||||
)
|
||||
: Container()
|
||||
: const SizedBox(),
|
||||
SizedBox(
|
||||
height: selectedServiceType != null ? 12 : 0,
|
||||
),
|
||||
//// Primary
|
||||
FormBuilderSwitch(
|
||||
initialValue: primaryaContact,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
primaryaContact = value!;
|
||||
});
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle("Primary?", 'Primary?'),
|
||||
name: 'overseas',
|
||||
title: Text(primaryaContact ? "YES" : "NO"),
|
||||
),
|
||||
//// Active
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderSwitch(
|
||||
initialValue: primaryaContact,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
active = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("Active?", ''),
|
||||
name: 'overseas',
|
||||
title: Text(active ? "YES" : "NO"),
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
: Container()
|
||||
: const SizedBox(),
|
||||
SizedBox(
|
||||
height: selectedServiceType != null ? 12 : 0,
|
||||
),
|
||||
//// Primary
|
||||
FormBuilderSwitch(
|
||||
initialValue: primaryaContact,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
primaryaContact = value!;
|
||||
});
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle("Primary?", 'Primary?'),
|
||||
name: 'overseas',
|
||||
title: Text(primaryaContact ? "YES" : "NO"),
|
||||
),
|
||||
//// Active
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderSwitch(
|
||||
initialValue: primaryaContact,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
active = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("Active?", ''),
|
||||
name: 'overseas',
|
||||
title: Text(active ? "YES" : "NO"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
SizedBox(
|
||||
height: 60,
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
if (formKey.currentState!.saveAndValidate()) {
|
||||
numberMail =
|
||||
formKey.currentState!.value['number-mail'];
|
||||
CommService commService =
|
||||
selectedCommServiceProvider!;
|
||||
ContactInfo contactInfo = ContactInfo(
|
||||
id: null,
|
||||
active: active,
|
||||
primary: primaryaContact,
|
||||
numbermail: numberMail,
|
||||
commService: commService);
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Loading...");
|
||||
context.read<ContactBloc>().add(
|
||||
AddContactInformation(
|
||||
contactInfo: contactInfo,
|
||||
profileId: widget.profileId,
|
||||
token: widget.token));
|
||||
}
|
||||
},
|
||||
style:
|
||||
mainBtnStyle(primary, Colors.transparent, second),
|
||||
child: const Text(submit),
|
||||
),
|
||||
SizedBox(
|
||||
height: 60,
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
if (formKey.currentState!.saveAndValidate()) {
|
||||
numberMail =
|
||||
formKey.currentState!.value['number-mail'];
|
||||
CommService commService =
|
||||
selectedCommServiceProvider!;
|
||||
ContactInfo contactInfo = ContactInfo(
|
||||
id: null,
|
||||
active: active,
|
||||
primary: primaryaContact,
|
||||
numbermail: numberMail,
|
||||
commService: commService);
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Loading...");
|
||||
context.read<ContactBloc>().add(
|
||||
AddContactInformation(
|
||||
contactInfo: contactInfo,
|
||||
profileId: widget.profileId,
|
||||
token: widget.token));
|
||||
}
|
||||
},
|
||||
style:
|
||||
mainBtnStyle(primary, Colors.transparent, second),
|
||||
child: const Text(submit),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
})),
|
||||
);
|
||||
|
|
|
@ -35,7 +35,6 @@ class _EditContactInformationScreenState
|
|||
bool? primaryaContact;
|
||||
bool? active;
|
||||
|
||||
|
||||
var mobileFormatter = MaskTextInputFormatter(
|
||||
mask: "+63 (###) ###-####",
|
||||
filter: {"#": RegExp(r"^[1-9][0-9]*$")},
|
||||
|
@ -51,9 +50,10 @@ class _EditContactInformationScreenState
|
|||
final numberMailController = TextEditingController();
|
||||
@override
|
||||
void dispose() {
|
||||
numberMailController.dispose();
|
||||
numberMailController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<ContactBloc, ContactState>(
|
||||
|
@ -64,221 +64,218 @@ class _EditContactInformationScreenState
|
|||
commServiceProviders = state.commServiceProviders;
|
||||
primaryaContact = state.contactInfo.primary;
|
||||
active = state.contactInfo.active;
|
||||
numberMailController.text = state.contactInfo.numbermail!;
|
||||
numberMailController.text = state.contactInfo.numbermail!;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 24),
|
||||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
child: ListView(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(children: [
|
||||
////Service Type
|
||||
DropdownButtonFormField<ServiceType>(
|
||||
isExpanded: true,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
value: selectedServiceType,
|
||||
items: state.serviceTypes
|
||||
.map<DropdownMenuItem<ServiceType>>(
|
||||
(ServiceType e) {
|
||||
return DropdownMenuItem<ServiceType>(
|
||||
value: e, child: Text(e.name!));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle("Service Type*", ""),
|
||||
onChanged: (var service) async {
|
||||
if (selectedServiceType!.id != service!.id) {
|
||||
selectedServiceType = service;
|
||||
setState(() {
|
||||
callServiceType = true;
|
||||
callServiceType = true;
|
||||
|
||||
numberMailController.text = "";
|
||||
});
|
||||
commServiceProviders = await ContactService
|
||||
.instance
|
||||
.getServiceProvider(
|
||||
serviceTypeId:
|
||||
selectedServiceType!.id!);
|
||||
selectedCommProvider = null;
|
||||
setState(() {
|
||||
setState(() {
|
||||
callServiceType = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Service Provider
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: callServiceType,
|
||||
child: DropdownButtonFormField<CommService>(
|
||||
isExpanded: true,
|
||||
value: selectedCommProvider,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
items: commServiceProviders.isEmpty
|
||||
? []
|
||||
: commServiceProviders
|
||||
.map<DropdownMenuItem<CommService>>(
|
||||
(CommService e) {
|
||||
return DropdownMenuItem<CommService>(
|
||||
value: e,
|
||||
child: Text(e.serviceProvider!
|
||||
.agency!.name!));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Communication Service *", ""),
|
||||
onChanged: (var commServiceProvider) {
|
||||
selectedCommProvider = commServiceProvider;
|
||||
}),
|
||||
),
|
||||
),
|
||||
selectedServiceType != null
|
||||
? selectedServiceType?.id == 2
|
||||
//// Landline
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
|
||||
inputFormatters: [landLineFormatter],
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Landline number *",
|
||||
"(area code) xxx - xxxx"),
|
||||
)
|
||||
: selectedServiceType!.id == 1 ||
|
||||
selectedServiceType!.id == 19
|
||||
//// Mobile number
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
inputFormatters: [mobileFormatter],
|
||||
|
||||
validator:
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(children: [
|
||||
////Service Type
|
||||
DropdownButtonFormField<ServiceType>(
|
||||
isExpanded: true,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
value: selectedServiceType,
|
||||
items: state.serviceTypes
|
||||
.map<DropdownMenuItem<ServiceType>>(
|
||||
(ServiceType e) {
|
||||
return DropdownMenuItem<ServiceType>(
|
||||
value: e, child: Text(e.name!));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle("Service Type*", ""),
|
||||
onChanged: (var service) async {
|
||||
if (selectedServiceType!.id != service!.id) {
|
||||
selectedServiceType = service;
|
||||
setState(() {
|
||||
callServiceType = true;
|
||||
callServiceType = true;
|
||||
|
||||
numberMailController.text = "";
|
||||
});
|
||||
try {
|
||||
commServiceProviders = await ContactService
|
||||
.instance
|
||||
.getServiceProvider(
|
||||
serviceTypeId:
|
||||
selectedServiceType!.id!);
|
||||
} catch (e) {
|
||||
context.read<ContactBloc>().add(
|
||||
CallErrorEvent(message: e.toString()));
|
||||
}
|
||||
selectedCommProvider = null;
|
||||
setState(() {
|
||||
setState(() {
|
||||
callServiceType = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Service Provider
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: callServiceType,
|
||||
child: DropdownButtonFormField<CommService>(
|
||||
isExpanded: true,
|
||||
value: selectedCommProvider,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
items: commServiceProviders.isEmpty
|
||||
? []
|
||||
: commServiceProviders
|
||||
.map<DropdownMenuItem<CommService>>(
|
||||
(CommService e) {
|
||||
return DropdownMenuItem<CommService>(
|
||||
value: e,
|
||||
child: Text(e.serviceProvider!
|
||||
.agency!.name!));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Communication Service *", ""),
|
||||
onChanged: (var commServiceProvider) {
|
||||
selectedCommProvider = commServiceProvider;
|
||||
}),
|
||||
),
|
||||
),
|
||||
selectedServiceType != null
|
||||
? selectedServiceType?.id == 2
|
||||
//// Landline
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
inputFormatters: [landLineFormatter],
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Landline number *",
|
||||
"(area code) xxx - xxxx"),
|
||||
)
|
||||
: selectedServiceType!.id == 1 ||
|
||||
selectedServiceType!.id == 19
|
||||
//// Mobile number
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
inputFormatters: [mobileFormatter],
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Mobile number *",
|
||||
"+63 (9xx) xxx - xxxx"),
|
||||
)
|
||||
: selectedServiceType!.id == 4
|
||||
////Social Media
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Account ID / Username *", ""),
|
||||
)
|
||||
: selectedServiceType!.id == 3
|
||||
////Email Address
|
||||
? FormBuilderTextField(
|
||||
controller:
|
||||
numberMailController,
|
||||
name: 'number-mail',
|
||||
validator: FormBuilderValidators
|
||||
.compose([
|
||||
FormBuilderValidators.email(
|
||||
errorText:
|
||||
"Input vaild email"),
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Mobile number *",
|
||||
"+63 (9xx) xxx - xxxx"),
|
||||
)
|
||||
: selectedServiceType!.id == 4
|
||||
////Social Media
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Account ID / Username *", ""),
|
||||
)
|
||||
: selectedServiceType!.id == 3
|
||||
////Email Address
|
||||
? FormBuilderTextField(
|
||||
controller: numberMailController,
|
||||
name: 'number-mail',
|
||||
|
||||
validator: FormBuilderValidators
|
||||
.compose([
|
||||
FormBuilderValidators.email(
|
||||
errorText:
|
||||
"Input vaild email"),
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required")
|
||||
]),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Email Address*", ""),
|
||||
)
|
||||
: Container()
|
||||
: const SizedBox(),
|
||||
]);
|
||||
}),
|
||||
SizedBox(
|
||||
height: selectedServiceType != null ? 12 : 0,
|
||||
),
|
||||
//// Primary
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return FormBuilderSwitch(
|
||||
initialValue: primaryaContact,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
primaryaContact = value;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'primary',
|
||||
title: const Text("Primary ?"),
|
||||
);
|
||||
}),
|
||||
//// Active
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return FormBuilderSwitch(
|
||||
initialValue: active,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
active = value;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'active',
|
||||
title: const Text("Active ?"),
|
||||
);
|
||||
}),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
"This field is required")
|
||||
]),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Email Address*", ""),
|
||||
)
|
||||
: Container()
|
||||
: const SizedBox(),
|
||||
]);
|
||||
}),
|
||||
SizedBox(
|
||||
height: selectedServiceType != null ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
height: 60,
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
if (formKey.currentState!.saveAndValidate()) {
|
||||
numberMail =
|
||||
formKey.currentState!.value['number-mail'];
|
||||
CommService commService = selectedCommProvider!;
|
||||
ContactInfo contactInfo = ContactInfo(
|
||||
id: state.contactInfo.id,
|
||||
active: active,
|
||||
primary: primaryaContact,
|
||||
numbermail: numberMail,
|
||||
commService: commService);
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Loading...");
|
||||
context.read<ContactBloc>().add(
|
||||
EditContactInformation(
|
||||
contactInfo: contactInfo,
|
||||
profileId: widget.profileId,
|
||||
token: widget.token));
|
||||
}
|
||||
},
|
||||
style:
|
||||
mainBtnStyle(primary, Colors.transparent, second),
|
||||
child: const Text(submit),
|
||||
),
|
||||
)
|
||||
//// Primary
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return FormBuilderSwitch(
|
||||
initialValue: primaryaContact,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
primaryaContact = value;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'primary',
|
||||
title: const Text("Primary ?"),
|
||||
);
|
||||
}),
|
||||
//// Active
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return FormBuilderSwitch(
|
||||
initialValue: active,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
active = value;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'active',
|
||||
title: const Text("Active ?"),
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
SizedBox(
|
||||
height: 60,
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
if (formKey.currentState!.saveAndValidate()) {
|
||||
numberMail =
|
||||
formKey.currentState!.value['number-mail'];
|
||||
CommService commService = selectedCommProvider!;
|
||||
ContactInfo contactInfo = ContactInfo(
|
||||
id: state.contactInfo.id,
|
||||
active: active,
|
||||
primary: primaryaContact,
|
||||
numbermail: numberMail,
|
||||
commService: commService);
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Loading...");
|
||||
context.read<ContactBloc>().add(
|
||||
EditContactInformation(
|
||||
contactInfo: contactInfo,
|
||||
profileId: widget.profileId,
|
||||
token: widget.token));
|
||||
}
|
||||
},
|
||||
style:
|
||||
mainBtnStyle(primary, Colors.transparent, second),
|
||||
child: const Text(submit),
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
);
|
||||
|
|
|
@ -28,7 +28,7 @@ class ContactInformationScreen extends StatelessWidget {
|
|||
String token;
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
title: context.watch<ContactBloc>().state is ContactAddingState
|
||||
? const Text("Add Contact")
|
||||
|
|
|
@ -131,7 +131,7 @@ class _ChildAlertState extends State<ChildAlert> {
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
firstDate: DateTime(1970),
|
||||
firstDate: DateTime(1900),
|
||||
lastDate: DateTime(2100),
|
||||
icon: const Icon(Icons.date_range),
|
||||
),
|
||||
|
|
|
@ -7,7 +7,6 @@ import 'package:flutter_spinkit/flutter_spinkit.dart';
|
|||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:unit2/bloc/profile/family/family_bloc.dart';
|
||||
import 'package:unit2/model/profile/family_backround.dart';
|
||||
|
||||
import '../../../../../model/utils/position.dart';
|
||||
import '../../../../../theme-data.dart/btn-style.dart';
|
||||
import '../../../../../theme-data.dart/colors.dart';
|
||||
|
@ -15,7 +14,6 @@ import '../../../../../theme-data.dart/form-style.dart';
|
|||
import '../../../../../utils/formatters.dart';
|
||||
import '../../../../../utils/global.dart';
|
||||
import '../../../../../utils/text_container.dart';
|
||||
import '../../../../../utils/validators.dart';
|
||||
|
||||
class ChildEditAlert extends StatefulWidget {
|
||||
final FamilyBackground familyBackground;
|
||||
|
@ -150,7 +148,7 @@ class _ChildEditAlertState extends State<ChildEditAlert> {
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
firstDate: DateTime(1970),
|
||||
firstDate: DateTime(1900),
|
||||
lastDate: DateTime(2100),
|
||||
icon: const Icon(Icons.date_range),
|
||||
),
|
||||
|
|
|
@ -129,7 +129,7 @@ class _FatherAlertState extends State<FatherAlert> {
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
firstDate: DateTime(1970),
|
||||
firstDate: DateTime(1900),
|
||||
lastDate: DateTime(2100),
|
||||
icon: const Icon(Icons.date_range),
|
||||
),
|
||||
|
|
|
@ -149,7 +149,7 @@ class _FatherEditAlertState extends State<FatherEditAlert> {
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
firstDate: DateTime(1970),
|
||||
firstDate: DateTime(1900),
|
||||
lastDate: DateTime(2100),
|
||||
icon: const Icon(Icons.date_range),
|
||||
),
|
||||
|
|
|
@ -129,7 +129,7 @@ class _MotherAlertState extends State<MotherAlert> {
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
firstDate: DateTime(1970),
|
||||
firstDate: DateTime(1900),
|
||||
lastDate: DateTime(2100),
|
||||
icon: const Icon(Icons.date_range),
|
||||
),
|
||||
|
|
|
@ -139,7 +139,7 @@ class _MotherEditAlertState extends State<MotherEditAlert> {
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
firstDate: DateTime(1970),
|
||||
firstDate: DateTime(1900),
|
||||
lastDate: DateTime(2100),
|
||||
icon: const Icon(Icons.date_range),
|
||||
),
|
||||
|
|
|
@ -154,7 +154,7 @@ bdayController.dispose();
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
firstDate: DateTime(1970),
|
||||
firstDate: DateTime(1900),
|
||||
lastDate: DateTime(2100),
|
||||
icon: const Icon(Icons.date_range),
|
||||
),
|
||||
|
|
|
@ -172,7 +172,7 @@ class _RelatedEditAlertState extends State<RelatedEditAlert> {
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
firstDate: DateTime(1970),
|
||||
firstDate: DateTime(1900),
|
||||
lastDate: DateTime(2100),
|
||||
icon: const Icon(Icons.date_range),
|
||||
),
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -87,381 +87,375 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
|
|||
key: formKey,
|
||||
child: SizedBox(
|
||||
height: screenHeight * 90,
|
||||
child: Column(
|
||||
child: ListView(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
FormBuilderTextField(
|
||||
initialValue: state.identification.agency!.name,
|
||||
enabled: false,
|
||||
name: "",
|
||||
decoration: normalTextFieldStyle("", "").copyWith(
|
||||
filled: true, fillColor: Colors.black12),
|
||||
),
|
||||
SizedBox(
|
||||
height: otherAgency ? 8 : 0,
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// Identification numner
|
||||
FormBuilderTextField(
|
||||
initialValue:
|
||||
state.identification.identificationNumber,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: "identification_number",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Identification Number *", ""),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(
|
||||
builder: (context,setState) {
|
||||
return Row(
|
||||
children: [
|
||||
//// Date Issued
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
controller: dateIssuedController,
|
||||
use24HourFormat: false,
|
||||
icon: const Icon(Icons.date_range),
|
||||
firstDate: DateTime(1990),
|
||||
lastDate: DateTime(2100),
|
||||
timeHintText: "Date Issued",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Date Issued ", "Date Issued *")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
onChanged: (value){
|
||||
setState((){
|
||||
issuedDate = value;
|
||||
});
|
||||
},
|
||||
selectableDayPredicate: (date) {
|
||||
if ((expDate != "null" && expDate != null) &&
|
||||
DateTime.tryParse(expDate!)!
|
||||
.microsecondsSinceEpoch <=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
initialDate: expDate == "null" || expDate == null
|
||||
? DateTime.now()
|
||||
: DateTime.tryParse(expDate!)?.subtract(
|
||||
const Duration(days: 1)),
|
||||
)),
|
||||
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
//// Expiration Date
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
controller: expirationController,
|
||||
use24HourFormat: false,
|
||||
icon: const Icon(Icons.date_range),
|
||||
firstDate: DateTime(1990),
|
||||
lastDate: DateTime(2100),
|
||||
timeHintText: "Expiration date",
|
||||
onChanged: (value){
|
||||
setState((){
|
||||
expDate = value;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Expiration Date",
|
||||
"Expiration Date")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
selectableDayPredicate: (date) {
|
||||
if ((issuedDate != "null" && issuedDate != null) &&
|
||||
DateTime.tryParse(issuedDate!)!
|
||||
.microsecondsSinceEpoch >=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
initialDate: issuedDate == null && issuedDate == "null"
|
||||
? DateTime.now()
|
||||
: DateTime.tryParse(issuedDate!)?.add(
|
||||
const Duration(days: 1)),
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
||||
//// OVERSEAS
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
FormBuilderTextField(
|
||||
initialValue: state.identification.agency!.name,
|
||||
enabled: false,
|
||||
name: "",
|
||||
decoration: normalTextFieldStyle("", "").copyWith(
|
||||
filled: true, fillColor: Colors.black12),
|
||||
),
|
||||
SizedBox(
|
||||
height: otherAgency ? 8 : 0,
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// Identification numner
|
||||
FormBuilderTextField(
|
||||
initialValue:
|
||||
state.identification.identificationNumber,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: "identification_number",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Identification Number *", ""),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(
|
||||
builder: (context,setState) {
|
||||
return Row(
|
||||
children: [
|
||||
//// Date Issued
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
controller: dateIssuedController,
|
||||
use24HourFormat: false,
|
||||
icon: const Icon(Icons.date_range),
|
||||
firstDate: DateTime(1990),
|
||||
lastDate: DateTime(2100),
|
||||
timeHintText: "Date Issued",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Date Issued ", "Date Issued *")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
onChanged: (value){
|
||||
setState((){
|
||||
issuedDate = value;
|
||||
});
|
||||
},
|
||||
selectableDayPredicate: (date) {
|
||||
if ((expDate != "null" && expDate != null) &&
|
||||
DateTime.tryParse(expDate!)!
|
||||
.microsecondsSinceEpoch <=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
initialDate: expDate == "null" || expDate == null
|
||||
? DateTime.now()
|
||||
: DateTime.tryParse(expDate!)?.subtract(
|
||||
const Duration(days: 1)),
|
||||
)),
|
||||
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
//// Expiration Date
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
controller: expirationController,
|
||||
use24HourFormat: false,
|
||||
icon: const Icon(Icons.date_range),
|
||||
firstDate: DateTime(1990),
|
||||
lastDate: DateTime(2100),
|
||||
timeHintText: "Expiration date",
|
||||
onChanged: (value){
|
||||
setState((){
|
||||
expDate = value;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Overseas Address?", ''),
|
||||
name: 'overseas',
|
||||
title: Text(overseas ? "YES" : "NO"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
"Expiration Date",
|
||||
"Expiration Date")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
selectableDayPredicate: (date) {
|
||||
if ((issuedDate != "null" && issuedDate != null) &&
|
||||
DateTime.tryParse(issuedDate!)!
|
||||
.microsecondsSinceEpoch >=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
initialDate: issuedDate == null && issuedDate == "null"
|
||||
? DateTime.now()
|
||||
: DateTime.tryParse(issuedDate!)?.add(
|
||||
const Duration(days: 1)),
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
||||
//// OVERSEAS
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Overseas Address?", ''),
|
||||
name: 'overseas',
|
||||
title: Text(overseas ? "YES" : "NO"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
isExpanded: true,
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged:
|
||||
(Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
try {
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
} catch (e) {
|
||||
context
|
||||
.read<
|
||||
IdentificationBloc>()
|
||||
.add(ShowErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code
|
||||
.toString());
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
});
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
IdentificationBloc>()
|
||||
.add(ShowErrorState(
|
||||
message: e
|
||||
.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
value: selectedRegion,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: state.regions.map<
|
||||
DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
value: selectedProvince,
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged:
|
||||
(Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
onChanged: (Province?
|
||||
province) async {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
cityCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
selectedProvince =
|
||||
province;
|
||||
try {
|
||||
provinces = await LocationUtils
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
} catch (e) {
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code
|
||||
.toString());
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
});
|
||||
} catch (e) {
|
||||
context
|
||||
.read<
|
||||
IdentificationBloc>()
|
||||
.add(ShowErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
message: e
|
||||
.toString()));
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code
|
||||
.toString());
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
});
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
IdentificationBloc>()
|
||||
.add(ShowErrorState(
|
||||
message: e
|
||||
.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
value: selectedRegion,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: state.regions.map<
|
||||
DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
value: selectedProvince,
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
onChanged: (Province?
|
||||
province) async {
|
||||
if (selectedProvince !=
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province
|
||||
province) {
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
selectedProvince =
|
||||
province;
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code
|
||||
.toString());
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
});
|
||||
} catch (e) {
|
||||
context
|
||||
.read<
|
||||
IdentificationBloc>()
|
||||
.add(ShowErrorState(
|
||||
message: e
|
||||
.toString()));
|
||||
}
|
||||
}
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province
|
||||
province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child:
|
||||
FittedBox(
|
||||
child: Text(
|
||||
province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province *",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
if (selectedMunicipality !=
|
||||
city) {
|
||||
selectedMunicipality =
|
||||
city;
|
||||
}
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality *",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child:
|
||||
DropdownButtonFormField<Country>(
|
||||
isExpanded: true,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child:
|
||||
FittedBox(
|
||||
child: Text(
|
||||
province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province *",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child:
|
||||
Text(country.name!)));
|
||||
}).toList(),
|
||||
value: selectedCountry?.id==175?null:selectedCountry,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country *", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
if (selectedMunicipality !=
|
||||
city) {
|
||||
selectedMunicipality =
|
||||
city;
|
||||
}
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality *",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child:
|
||||
DropdownButtonFormField<Country>(
|
||||
isExpanded: true,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child:
|
||||
Text(country.name!)));
|
||||
}).toList(),
|
||||
value: selectedCountry?.id==175?null:selectedCountry,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country *", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
);
|
||||
}),
|
||||
|
||||
const SizedBox(height: 8,),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
|
@ -522,7 +516,6 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
|
|||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
const SizedBox(height: 24,),
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
|
|
@ -3,20 +3,16 @@ 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/primary_information/identification/identification_bloc.dart';
|
||||
import 'package:unit2/bloc/profile/profile_bloc.dart';
|
||||
import 'package:unit2/model/profile/basic_information/identification_information.dart';
|
||||
import 'package:unit2/screens/profile/components/basic_information/identification/add_modal.dart';
|
||||
import 'package:unit2/screens/profile/components/basic_information/identification/edit_modal.dart';
|
||||
import 'package:unit2/theme-data.dart/box_shadow.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/Leadings/add_leading.dart';
|
||||
import 'package:unit2/widgets/empty_data.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
import '../../../../bloc/user/user_bloc.dart';
|
||||
import '../../../../utils/alerts.dart';
|
||||
import '../../../../widgets/Leadings/close_leading.dart';
|
||||
|
@ -29,7 +25,7 @@ class IdentificationsScreen extends StatelessWidget {
|
|||
String? token;
|
||||
int? profileId;
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
resizeToAvoidBottomInset: true,
|
||||
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"),
|
||||
|
||||
|
|
|
@ -88,379 +88,369 @@ class _AddEducationScreenState extends State<AddEducationScreen> {
|
|||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: SizedBox(
|
||||
height: blockSizeVertical * 85,
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(children: [
|
||||
//// LEVEL
|
||||
child: ListView(children: [
|
||||
//// LEVEL
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderDropdown(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("level*", "level"),
|
||||
name: "education_level",
|
||||
onChanged: (EducationLevel? level) {
|
||||
setState(() {
|
||||
selectedLevel = level;
|
||||
});
|
||||
},
|
||||
items: educationLevel
|
||||
.map<DropdownMenuItem<EducationLevel>>(
|
||||
(EducationLevel level) {
|
||||
return level.type == "label"
|
||||
? DropdownMenuItem(
|
||||
enabled: false,
|
||||
value: level,
|
||||
child: Text(level.value.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: Colors.black38)))
|
||||
: DropdownMenuItem(
|
||||
value: level,
|
||||
enabled: true,
|
||||
child: Text(
|
||||
" ${level.value.toUpperCase()}"));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////school
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderDropdown(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("level*", "level"),
|
||||
name: "education_level",
|
||||
onChanged: (EducationLevel? level) {
|
||||
setState(() {
|
||||
selectedLevel = level;
|
||||
});
|
||||
},
|
||||
items: educationLevel
|
||||
.map<DropdownMenuItem<EducationLevel>>(
|
||||
(EducationLevel level) {
|
||||
return level.type == "label"
|
||||
? DropdownMenuItem(
|
||||
enabled: false,
|
||||
value: level,
|
||||
child: Text(level.value.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: Colors.black38)))
|
||||
: DropdownMenuItem(
|
||||
value: level,
|
||||
enabled: true,
|
||||
child: Text(
|
||||
" ${level.value.toUpperCase()}"));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////school
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return SearchField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
itemHeight: 70,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.schools
|
||||
.map((School school) =>
|
||||
SearchFieldListItem(school.name!,
|
||||
item: school,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10),
|
||||
child: ListTile(
|
||||
title: Text(school.name!,overflow: TextOverflow.visible,)),
|
||||
)))
|
||||
.toList(),
|
||||
validator: (agency) {
|
||||
if (agency!.isEmpty) {
|
||||
return "This field is required";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
focusNode: schoolFocusNode,
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle("School *", "").copyWith(
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.arrow_drop_down),
|
||||
onPressed: () {
|
||||
schoolFocusNode.unfocus();
|
||||
},
|
||||
)),
|
||||
onSuggestionTap: (school) {
|
||||
setState(() {
|
||||
selectedSchool = school.item;
|
||||
schoolFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
emptyWidget: EmptyWidget(
|
||||
title: "Add School",
|
||||
controller: addSchoolController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
School newSchool = School(
|
||||
id: null,
|
||||
name: addSchoolController.text
|
||||
.toUpperCase());
|
||||
state.schools.insert(0, newSchool);
|
||||
addSchoolController.text = "";
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}),
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////Programs
|
||||
Container(
|
||||
child: selectedLevel != null &&
|
||||
selectedLevel!.group != 1
|
||||
? SearchField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
itemHeight: 100,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.programs
|
||||
.map((Course program) =>
|
||||
SearchFieldListItem(
|
||||
program.program!,
|
||||
item: program,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets
|
||||
.symmetric(
|
||||
horizontal: 10),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
program.program!,overflow: TextOverflow.visible,)),
|
||||
)))
|
||||
.toList(),
|
||||
validator: (agency) {
|
||||
if (agency!.isEmpty) {
|
||||
return "This field is required";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
focusNode: programFocusNode,
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle(
|
||||
"Course/Programs *", "")
|
||||
.copyWith(
|
||||
suffixIcon: GestureDetector(
|
||||
onTap: () => programFocusNode.unfocus(),
|
||||
child: const Icon(
|
||||
Icons.arrow_drop_down),
|
||||
)),
|
||||
onSuggestionTap: (position) {
|
||||
setState(() {
|
||||
selectedProgram = position.item;
|
||||
programFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
emptyWidget: EmptyWidget(
|
||||
title: "Add Program",
|
||||
controller: addProgramController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
Course newProgram = Course(
|
||||
id: null,
|
||||
program: addProgramController
|
||||
.text
|
||||
.toUpperCase());
|
||||
state.programs
|
||||
.insert(0, newProgram);
|
||||
addProgramController.text = "";
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}),
|
||||
)
|
||||
: Container())
|
||||
],
|
||||
return SearchField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
itemHeight: 70,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.schools
|
||||
.map((School school) =>
|
||||
SearchFieldListItem(school.name!,
|
||||
item: school,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10),
|
||||
child: ListTile(
|
||||
title: Text(school.name!,overflow: TextOverflow.visible,)),
|
||||
)))
|
||||
.toList(),
|
||||
validator: (agency) {
|
||||
if (agency!.isEmpty) {
|
||||
return "This field is required";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
focusNode: schoolFocusNode,
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle("School *", "").copyWith(
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.arrow_drop_down),
|
||||
onPressed: () {
|
||||
schoolFocusNode.unfocus();
|
||||
},
|
||||
)),
|
||||
onSuggestionTap: (school) {
|
||||
setState(() {
|
||||
selectedSchool = school.item;
|
||||
schoolFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
emptyWidget: EmptyWidget(
|
||||
title: "Add School",
|
||||
controller: addSchoolController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
School newSchool = School(
|
||||
id: null,
|
||||
name: addSchoolController.text
|
||||
.toUpperCase());
|
||||
state.schools.insert(0, newSchool);
|
||||
addSchoolController.text = "";
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}),
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
////Programs
|
||||
Container(
|
||||
child: selectedLevel != null &&
|
||||
selectedLevel!.group != 1
|
||||
? SearchField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
itemHeight: 100,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.programs
|
||||
.map((Course program) =>
|
||||
SearchFieldListItem(
|
||||
program.program!,
|
||||
item: program,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets
|
||||
.symmetric(
|
||||
horizontal: 10),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
program.program!,overflow: TextOverflow.visible,)),
|
||||
)))
|
||||
.toList(),
|
||||
validator: (agency) {
|
||||
if (agency!.isEmpty) {
|
||||
return "This field is required";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
focusNode: programFocusNode,
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle(
|
||||
"Course/Programs *", "")
|
||||
.copyWith(
|
||||
suffixIcon: GestureDetector(
|
||||
onTap: () => programFocusNode.unfocus(),
|
||||
child: const Icon(
|
||||
Icons.arrow_drop_down),
|
||||
)),
|
||||
onSuggestionTap: (position) {
|
||||
setState(() {
|
||||
selectedProgram = position.item;
|
||||
programFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
emptyWidget: EmptyWidget(
|
||||
title: "Add Program",
|
||||
controller: addProgramController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
Course newProgram = Course(
|
||||
id: null,
|
||||
program: addProgramController
|
||||
.text
|
||||
.toUpperCase());
|
||||
state.programs
|
||||
.insert(0, newProgram);
|
||||
addProgramController.text = "";
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}),
|
||||
)
|
||||
: Container())
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
//// GRADUATED SWITCH
|
||||
FormBuilderSwitch(
|
||||
initialValue: graduated,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
graduated = value!;
|
||||
if (graduated) {
|
||||
unitsEarned = null;
|
||||
} else {
|
||||
yearGraduated.text = "";
|
||||
}
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Graduated?", 'Graduated?'),
|
||||
name: 'graudated',
|
||||
title: Text(graduated ? "YES" : "NO"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////FROM
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
//// GRADUATED SWITCH
|
||||
FormBuilderSwitch(
|
||||
initialValue: graduated,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
graduated = value!;
|
||||
if (graduated) {
|
||||
unitsEarned = null;
|
||||
} else {
|
||||
yearGraduated.text = "";
|
||||
}
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Graduated?", 'Graduated?'),
|
||||
name: 'graudated',
|
||||
title: Text(graduated ? "YES" : "NO"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////FROM
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("from *", "from"),
|
||||
name: "",
|
||||
controller: fromController,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
fromController.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////UNTIL
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"until *", "until"),
|
||||
name: "",
|
||||
controller: untilController,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
untilController.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
],
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("from *", "from"),
|
||||
name: "",
|
||||
controller: fromController,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
fromController.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
width: 8,
|
||||
),
|
||||
SizedBox(
|
||||
child: graduated
|
||||
////GRADUATED YEAR
|
||||
? FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
yearGraduated.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
name: "year_graduated",
|
||||
controller: yearGraduated,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Year Graduated *", "Year Graduated *"),
|
||||
)
|
||||
//// HIGHEST UNITS EARNED
|
||||
: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
name: "units_earned",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Highest Level/Units Earned *",
|
||||
"Highest Level/Units Earned *")),
|
||||
////UNTIL
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"until *", "until"),
|
||||
name: "",
|
||||
controller: untilController,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
untilController.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// HONORS
|
||||
MultiSelectDropDown(
|
||||
onOptionSelected: (List<ValueItem> selectedOptions) {
|
||||
selectedValueItem = selectedOptions;
|
||||
},
|
||||
borderColor: Colors.grey,
|
||||
borderWidth: 1,
|
||||
borderRadius: 5,
|
||||
hint: "Honors",
|
||||
padding: const EdgeInsets.all(8),
|
||||
options: valueItemHonorList,
|
||||
selectionType: SelectionType.multi,
|
||||
chipConfig: const ChipConfig(wrapType: WrapType.wrap),
|
||||
dropdownHeight: 300,
|
||||
optionTextStyle: const TextStyle(fontSize: 16),
|
||||
selectedOptionIcon: const Icon(Icons.check_circle),
|
||||
SizedBox(
|
||||
child: graduated
|
||||
////GRADUATED YEAR
|
||||
? FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
yearGraduated.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
name: "year_graduated",
|
||||
controller: yearGraduated,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Year Graduated *", "Year Graduated *"),
|
||||
)
|
||||
//// HIGHEST UNITS EARNED
|
||||
: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
name: "units_earned",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Highest Level/Units Earned *",
|
||||
"Highest Level/Units Earned *")),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
////sumit button
|
||||
|
||||
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
]),
|
||||
),
|
||||
SizedBox(
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// HONORS
|
||||
MultiSelectDropDown(
|
||||
onOptionSelected: (List<ValueItem> selectedOptions) {
|
||||
selectedValueItem = selectedOptions;
|
||||
},
|
||||
borderColor: Colors.grey,
|
||||
borderWidth: 1,
|
||||
borderRadius: 5,
|
||||
hint: "Honors",
|
||||
padding: const EdgeInsets.all(8),
|
||||
options: valueItemHonorList,
|
||||
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: 25,
|
||||
),
|
||||
////sumit button
|
||||
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
|
@ -520,9 +510,8 @@ class _AddEducationScreenState extends State<AddEducationScreen> {
|
|||
child: const Text(submit)),
|
||||
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -115,403 +115,398 @@ class _EditEducationScreenState extends State<EditEducationScreen> {
|
|||
key: formKey,
|
||||
child: SizedBox(
|
||||
height: blockSizeVertical * 85,
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(children: [
|
||||
|
||||
//// LEVEL
|
||||
child: ListView(children: [
|
||||
|
||||
//// LEVEL
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderDropdown(
|
||||
initialValue: selectedLevel,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("level*", "level"),
|
||||
name: "education_level",
|
||||
onChanged: (EducationLevel? level) {
|
||||
setState(() {
|
||||
selectedLevel = level;
|
||||
});
|
||||
},
|
||||
items: educationLevel
|
||||
.map<DropdownMenuItem<EducationLevel>>(
|
||||
(EducationLevel level) {
|
||||
return level.type == "label"
|
||||
? DropdownMenuItem(
|
||||
enabled: false,
|
||||
value: level,
|
||||
child: Text(level.value.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: Colors.black38)))
|
||||
: DropdownMenuItem(
|
||||
value: level,
|
||||
enabled: true,
|
||||
child: Text(
|
||||
" ${level.value.toUpperCase()}"));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////school
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderDropdown(
|
||||
initialValue: selectedLevel,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("level*", "level"),
|
||||
name: "education_level",
|
||||
onChanged: (EducationLevel? level) {
|
||||
setState(() {
|
||||
selectedLevel = level;
|
||||
});
|
||||
},
|
||||
items: educationLevel
|
||||
.map<DropdownMenuItem<EducationLevel>>(
|
||||
(EducationLevel level) {
|
||||
return level.type == "label"
|
||||
? DropdownMenuItem(
|
||||
enabled: false,
|
||||
value: level,
|
||||
child: Text(level.value.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: Colors.black38)))
|
||||
: DropdownMenuItem(
|
||||
value: level,
|
||||
enabled: true,
|
||||
child: Text(
|
||||
" ${level.value.toUpperCase()}"));
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////school
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return SearchField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
|
||||
suggestionAction: SuggestionAction.next,
|
||||
onSubmit: (p0) {
|
||||
schoolFocusNode.unfocus();
|
||||
},
|
||||
controller: currentSchoolController,
|
||||
itemHeight: 70,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.schools
|
||||
.map((School school) =>
|
||||
SearchFieldListItem(school.name!,
|
||||
item: school,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10),
|
||||
child: ListTile(
|
||||
title: Text(school.name!,overflow: TextOverflow.visible,)),
|
||||
)))
|
||||
.toList(),
|
||||
validator: (agency) {
|
||||
if (agency!.isEmpty) {
|
||||
return "This field is required";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
focusNode: schoolFocusNode,
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle("School *", "").copyWith(
|
||||
suffixIcon: GestureDetector(
|
||||
child: const Icon(Icons.arrow_drop_down),
|
||||
onTap: () {
|
||||
schoolFocusNode.unfocus();
|
||||
},
|
||||
)),
|
||||
onSuggestionTap: (school) {
|
||||
setState(() {
|
||||
selectedSchool = school.item;
|
||||
schoolFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
emptyWidget: EmptyWidget(
|
||||
title: "Add School",
|
||||
controller: addSchoolController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
School newSchool = School(
|
||||
id: null,
|
||||
name: addSchoolController.text
|
||||
.toUpperCase());
|
||||
state.schools.insert(0, newSchool);
|
||||
addSchoolController.text = "";
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}),
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
||||
////Programs
|
||||
|
||||
Container(
|
||||
child: selectedLevel != null &&
|
||||
selectedLevel!.group != 1
|
||||
? SearchField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
suggestionAction:
|
||||
SuggestionAction.unfocus,
|
||||
controller: currentProgramController,
|
||||
itemHeight: 70,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.programs
|
||||
.map((Course program) =>
|
||||
SearchFieldListItem(
|
||||
program.program!,
|
||||
item: program,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets
|
||||
.symmetric(
|
||||
horizontal: 10),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
program.program!,overflow: TextOverflow.visible,)),
|
||||
)))
|
||||
.toList(),
|
||||
validator: (agency) {
|
||||
if (agency!.isEmpty) {
|
||||
return "This field is required";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
focusNode: programFocusNode,
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle(
|
||||
"Course/Programs *", "")
|
||||
.copyWith(
|
||||
suffixIcon: IconButton(
|
||||
icon:const Icon(
|
||||
Icons.arrow_drop_down), onPressed: () { programFocusNode.unfocus(); },),),
|
||||
onSuggestionTap: (position) {
|
||||
setState(() {
|
||||
selectedProgram = position.item;
|
||||
programFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
emptyWidget: EmptyWidget(
|
||||
title: "Add Program",
|
||||
controller: addProgramController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
Course newProgram = Course(
|
||||
id: null,
|
||||
program: addProgramController
|
||||
.text
|
||||
.toUpperCase());
|
||||
state.programs
|
||||
.insert(0, newProgram);
|
||||
addProgramController.text = "";
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}),
|
||||
)
|
||||
: Container()),
|
||||
SizedBox(height: selectedLevel != null &&
|
||||
selectedLevel!.group != 1?12:0,),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
//// GRADUATED SWITCH
|
||||
FormBuilderSwitch(
|
||||
initialValue: graduated,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
return SearchField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
|
||||
suggestionAction: SuggestionAction.next,
|
||||
onSubmit: (p0) {
|
||||
schoolFocusNode.unfocus();
|
||||
},
|
||||
controller: currentSchoolController,
|
||||
itemHeight: 70,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.schools
|
||||
.map((School school) =>
|
||||
SearchFieldListItem(school.name!,
|
||||
item: school,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10),
|
||||
child: ListTile(
|
||||
title: Text(school.name!,overflow: TextOverflow.visible,)),
|
||||
)))
|
||||
.toList(),
|
||||
validator: (agency) {
|
||||
if (agency!.isEmpty) {
|
||||
return "This field is required";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
focusNode: schoolFocusNode,
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle("School *", "").copyWith(
|
||||
suffixIcon: GestureDetector(
|
||||
child: const Icon(Icons.arrow_drop_down),
|
||||
onTap: () {
|
||||
schoolFocusNode.unfocus();
|
||||
},
|
||||
)),
|
||||
onSuggestionTap: (school) {
|
||||
setState(() {
|
||||
selectedSchool = school.item;
|
||||
schoolFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
emptyWidget: EmptyWidget(
|
||||
title: "Add School",
|
||||
controller: addSchoolController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
graduated = value!;
|
||||
if (graduated) {
|
||||
unitsController.text = "";
|
||||
} else {
|
||||
yearGraduated.text = "";
|
||||
}
|
||||
School newSchool = School(
|
||||
id: null,
|
||||
name: addSchoolController.text
|
||||
.toUpperCase());
|
||||
state.schools.insert(0, newSchool);
|
||||
addSchoolController.text = "";
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Graduated?", 'Graduated?'),
|
||||
name: 'graudated',
|
||||
title: Text(graduated ? "YES" : "NO"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////FROM
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("from *", "from"),
|
||||
name: "",
|
||||
controller: fromController,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
fromController.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////UNTIL
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"until *", "until"),
|
||||
name: "",
|
||||
controller: untilController,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
untilController.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
), const SizedBox(height: 20,),
|
||||
SizedBox(
|
||||
|
||||
child: graduated
|
||||
////GRADUATED YEAR
|
||||
? FormBuilderTextField(
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This fied is required"),
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year -
|
||||
100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year +
|
||||
100,
|
||||
1),
|
||||
initialDate:
|
||||
DateTime.now(),
|
||||
selectedDate:
|
||||
DateTime.now(),
|
||||
onChanged:
|
||||
(DateTime dateTime) {
|
||||
yearGraduated.text =
|
||||
dateTime.year
|
||||
.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
name: "year_graduated",
|
||||
controller: yearGraduated,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Year Graduated *",
|
||||
"Year Graduated *"),
|
||||
)
|
||||
//// HIGHEST UNITS EARNED
|
||||
: FormBuilderTextField(
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This fied is required"),
|
||||
controller: unitsController,
|
||||
name: "units_earned",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Highest Level/Units Earned *",
|
||||
"Highest Level/Units Earned *")),
|
||||
)
|
||||
|
||||
],
|
||||
}),
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// HONORS
|
||||
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return MultiSelectDropDown(
|
||||
onOptionSelected: (List<ValueItem> selectedOptions) {
|
||||
selectedValueItem = selectedOptions;
|
||||
},
|
||||
borderColor: Colors.grey,
|
||||
borderWidth: 1,
|
||||
borderRadius: 5,
|
||||
hint: "Honors",
|
||||
padding: const EdgeInsets.all(8),
|
||||
options: valueItemHonorList,
|
||||
selectionType: SelectionType.multi,
|
||||
chipConfig: const ChipConfig(wrapType: WrapType.wrap),
|
||||
dropdownHeight: 300,
|
||||
optionTextStyle: const TextStyle(fontSize: 16),
|
||||
selectedOptionIcon: const Icon(Icons.check_circle),
|
||||
selectedOptions:
|
||||
(state.educationalBackground.honors!.isNotEmpty &&
|
||||
state.educationalBackground.honors != null)
|
||||
? selectedValueItem = state
|
||||
.educationalBackground.honors!
|
||||
.map((Honor honor) => ValueItem(
|
||||
label: honor.name!, value: honor.name))
|
||||
.toList()
|
||||
: [],
|
||||
);
|
||||
}),
|
||||
|
||||
]),
|
||||
),
|
||||
////sumit button
|
||||
|
||||
////Programs
|
||||
|
||||
Container(
|
||||
child: selectedLevel != null &&
|
||||
selectedLevel!.group != 1
|
||||
? SearchField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
suggestionAction:
|
||||
SuggestionAction.unfocus,
|
||||
controller: currentProgramController,
|
||||
itemHeight: 70,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.programs
|
||||
.map((Course program) =>
|
||||
SearchFieldListItem(
|
||||
program.program!,
|
||||
item: program,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets
|
||||
.symmetric(
|
||||
horizontal: 10),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
program.program!,overflow: TextOverflow.visible,)),
|
||||
)))
|
||||
.toList(),
|
||||
validator: (agency) {
|
||||
if (agency!.isEmpty) {
|
||||
return "This field is required";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
focusNode: programFocusNode,
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle(
|
||||
"Course/Programs *", "")
|
||||
.copyWith(
|
||||
suffixIcon: IconButton(
|
||||
icon:const Icon(
|
||||
Icons.arrow_drop_down), onPressed: () { programFocusNode.unfocus(); },),),
|
||||
onSuggestionTap: (position) {
|
||||
setState(() {
|
||||
selectedProgram = position.item;
|
||||
programFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
emptyWidget: EmptyWidget(
|
||||
title: "Add Program",
|
||||
controller: addProgramController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
Course newProgram = Course(
|
||||
id: null,
|
||||
program: addProgramController
|
||||
.text
|
||||
.toUpperCase());
|
||||
state.programs
|
||||
.insert(0, newProgram);
|
||||
addProgramController.text = "";
|
||||
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}),
|
||||
)
|
||||
: Container()),
|
||||
SizedBox(height: selectedLevel != null &&
|
||||
selectedLevel!.group != 1?12:0,),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
//// GRADUATED SWITCH
|
||||
FormBuilderSwitch(
|
||||
initialValue: graduated,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
graduated = value!;
|
||||
if (graduated) {
|
||||
unitsController.text = "";
|
||||
} else {
|
||||
yearGraduated.text = "";
|
||||
}
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Graduated?", 'Graduated?'),
|
||||
name: 'graudated',
|
||||
title: Text(graduated ? "YES" : "NO"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////FROM
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
decoration:
|
||||
normalTextFieldStyle("from *", "from"),
|
||||
name: "",
|
||||
controller: fromController,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
fromController.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////UNTIL
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This fied is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"until *", "until"),
|
||||
name: "",
|
||||
controller: untilController,
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year - 100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year + 100,
|
||||
1),
|
||||
initialDate: DateTime.now(),
|
||||
selectedDate: DateTime.now(),
|
||||
onChanged: (DateTime dateTime) {
|
||||
untilController.text =
|
||||
dateTime.year.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
), const SizedBox(height: 20,),
|
||||
SizedBox(
|
||||
|
||||
child: graduated
|
||||
////GRADUATED YEAR
|
||||
? FormBuilderTextField(
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This fied is required"),
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: YearPicker(
|
||||
firstDate: DateTime(
|
||||
DateTime.now().year -
|
||||
100,
|
||||
1),
|
||||
lastDate: DateTime(
|
||||
DateTime.now().year +
|
||||
100,
|
||||
1),
|
||||
initialDate:
|
||||
DateTime.now(),
|
||||
selectedDate:
|
||||
DateTime.now(),
|
||||
onChanged:
|
||||
(DateTime dateTime) {
|
||||
yearGraduated.text =
|
||||
dateTime.year
|
||||
.toString();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
name: "year_graduated",
|
||||
controller: yearGraduated,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Year Graduated *",
|
||||
"Year Graduated *"),
|
||||
)
|
||||
//// HIGHEST UNITS EARNED
|
||||
: FormBuilderTextField(
|
||||
initialValue: state.educationalBackground.unitsEarned?.toString(),
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This fied is required"),
|
||||
|
||||
name: "units_earned",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Highest Level/Units Earned *",
|
||||
"Highest Level/Units Earned *")),
|
||||
)
|
||||
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// HONORS
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return MultiSelectDropDown(
|
||||
onOptionSelected: (List<ValueItem> selectedOptions) {
|
||||
selectedValueItem = selectedOptions;
|
||||
},
|
||||
borderColor: Colors.grey,
|
||||
borderWidth: 1,
|
||||
borderRadius: 5,
|
||||
hint: "Honors",
|
||||
padding: const EdgeInsets.all(8),
|
||||
options: valueItemHonorList,
|
||||
selectionType: SelectionType.multi,
|
||||
chipConfig: const ChipConfig(wrapType: WrapType.wrap),
|
||||
dropdownHeight: 300,
|
||||
optionTextStyle: const TextStyle(fontSize: 16),
|
||||
selectedOptionIcon: const Icon(Icons.check_circle),
|
||||
selectedOptions:
|
||||
(state.educationalBackground.honors!.isNotEmpty &&
|
||||
state.educationalBackground.honors != null)
|
||||
? selectedValueItem = state
|
||||
.educationalBackground.honors!
|
||||
.map((Honor honor) => ValueItem(
|
||||
label: honor.name!, value: honor.name))
|
||||
.toList()
|
||||
: [],
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 14,),
|
||||
////sumit button
|
||||
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
|
@ -558,7 +553,7 @@ class _EditEducationScreenState extends State<EditEducationScreen> {
|
|||
yearGraduated:
|
||||
graduated ? yearGraduated.text : null,
|
||||
unitsEarned: !graduated
|
||||
? int.tryParse(unitsController.text)
|
||||
? int.tryParse(formKey.currentState!.value['units_earned'])
|
||||
: null,
|
||||
attachments: null,
|
||||
);
|
||||
|
@ -573,9 +568,7 @@ class _EditEducationScreenState extends State<EditEducationScreen> {
|
|||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -3,13 +3,13 @@ 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:fluttertoast/fluttertoast.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
|
||||
import 'package:unit2/bloc/profile/education/education_bloc.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
|
||||
|
||||
import '../../../../utils/url_launcher_file_downloader.dart';
|
||||
|
||||
class EudcationViewAttachment extends StatefulWidget {
|
||||
const EudcationViewAttachment({super.key});
|
||||
|
||||
|
@ -26,7 +26,7 @@ class _EudcationViewAttachmentState extends State<EudcationViewAttachment> {
|
|||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
await _launchInBrowser(fileUrl!);
|
||||
await launchInBrowser(fileUrl!);
|
||||
},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
|
@ -103,19 +103,4 @@ class _EudcationViewAttachmentState extends State<EudcationViewAttachment> {
|
|||
),
|
||||
));
|
||||
}
|
||||
|
||||
Future<void> _launchInBrowser(String url) async {
|
||||
final UrlLauncherPlatform launcher = UrlLauncherPlatform.instance;
|
||||
if (!await launcher.launch(
|
||||
url,
|
||||
useSafariVC: false,
|
||||
useWebView: false,
|
||||
enableJavaScript: false,
|
||||
enableDomStorage: false,
|
||||
universalLinksOnly: false,
|
||||
headers: <String, String>{},
|
||||
)) {
|
||||
throw Exception('Could not launch $url');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import 'package:unit2/bloc/profile/profile_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';
|
||||
import 'package:unit2/screens/profile/shared/view_attachment.dart';
|
||||
import 'package:unit2/theme-data.dart/box_shadow.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/widgets/Leadings/add_leading.dart';
|
||||
|
@ -41,7 +40,7 @@ class EducationScreen extends StatelessWidget {
|
|||
int profileId;
|
||||
String? token;
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
title: context.watch<EducationBloc>().state is AddEducationState
|
||||
? const FittedBox(child: Text("Add Educational Background"))
|
||||
|
|
|
@ -71,343 +71,337 @@ class _AddEligibilityScreenState extends State<AddEligibilityScreen> {
|
|||
padding: const EdgeInsets.symmetric(vertical: 32, horizontal: 28),
|
||||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: SizedBox(
|
||||
height: screenHeight * 90,
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(children: [
|
||||
////ELIGIBILITIES DROPDOWN
|
||||
FormBuilderDropdown<Eligibility>(
|
||||
onChanged: (Eligibility? eligibility) {
|
||||
selectedEligibility = eligibility;
|
||||
},
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null ? 'required' : null,
|
||||
items: state.eligibilities
|
||||
.map<DropdownMenuItem<Eligibility>>(
|
||||
(Eligibility eligibility) {
|
||||
return DropdownMenuItem<Eligibility>(
|
||||
value: eligibility,
|
||||
child: Text(eligibility.title));
|
||||
}).toList(),
|
||||
name: "eligibility",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Eligibility", "Eligibility")),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
child: ListView(children: [
|
||||
////ELIGIBILITIES DROPDOWN
|
||||
FormBuilderDropdown<Eligibility>(
|
||||
onChanged: (Eligibility? eligibility) {
|
||||
selectedEligibility = eligibility;
|
||||
},
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null ? 'required' : null,
|
||||
items: state.eligibilities
|
||||
.map<DropdownMenuItem<Eligibility>>(
|
||||
(Eligibility eligibility) {
|
||||
return DropdownMenuItem<Eligibility>(
|
||||
value: eligibility,
|
||||
child: Text(eligibility.title));
|
||||
}).toList(),
|
||||
name: "eligibility",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Eligibility", "Eligibility")),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
////LICENSE NUMBER
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
onChanged: (value) {
|
||||
license = value;
|
||||
},
|
||||
name: 'license_number',
|
||||
decoration: normalTextFieldStyle(
|
||||
"license number", "license number"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////RATING
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.numeric(
|
||||
errorText: "Enter a number"),
|
||||
keyboardType:
|
||||
const TextInputType.numberWithOptions(),
|
||||
onChanged: (value) {
|
||||
rating = value;
|
||||
},
|
||||
name: 'rating',
|
||||
decoration: normalTextFieldStyle(
|
||||
'rating %', 'rating'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
////LICENSE NUMBER
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
onChanged: (value) {
|
||||
license = value;
|
||||
},
|
||||
name: 'license_number',
|
||||
decoration: normalTextFieldStyle(
|
||||
"license number", "license number"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////RATING
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.numeric(
|
||||
errorText: "Enter a number"),
|
||||
keyboardType:
|
||||
const TextInputType.numberWithOptions(),
|
||||
onChanged: (value) {
|
||||
rating = value;
|
||||
},
|
||||
name: 'rating',
|
||||
decoration: normalTextFieldStyle(
|
||||
'rating %', 'rating'),
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: StatefulBuilder(builder: (context, setState) {
|
||||
return Row(
|
||||
children: [
|
||||
////EXAM DATE
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
use24HourFormat: false,
|
||||
icon: const Icon(Icons.date_range),
|
||||
controller: examDateController,
|
||||
firstDate: DateTime(1990),
|
||||
lastDate: DateTime(2100),
|
||||
timeHintText:
|
||||
"Date of Examination/Conferment",
|
||||
decoration:
|
||||
normalTextFieldStyle("Exam date", "")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
initialDate: expireDate == null
|
||||
? DateTime.now()
|
||||
: expireDate!.subtract(
|
||||
const Duration(days: 1)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (expireDate != null &&
|
||||
expireDate!
|
||||
.microsecondsSinceEpoch <=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
examDate = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////VALIDITY DATE
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
controller: validityDateController,
|
||||
firstDate: DateTime(1970),
|
||||
lastDate: DateTime(2100),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Validity date", "Validity date")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (examDate != null &&
|
||||
examDate!.microsecondsSinceEpoch >=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
expireDate = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
initialDate: examDate == null
|
||||
? DateTime.now()
|
||||
: examDate!
|
||||
.add(const Duration(days: 1)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(
|
||||
"Placement of Examination/Conferment",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.displaySmall!
|
||||
.copyWith(fontSize: blockSizeVertical * 2),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
////OVERSEAS ADDRESS SWITCH
|
||||
Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: 'This field is required'),
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: StatefulBuilder(builder: (context, setState) {
|
||||
return Row(
|
||||
children: [
|
||||
////EXAM DATE
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
use24HourFormat: false,
|
||||
icon: const Icon(Icons.date_range),
|
||||
controller: examDateController,
|
||||
firstDate: DateTime(1990),
|
||||
lastDate: DateTime(2100),
|
||||
timeHintText:
|
||||
"Date of Examination/Conferment",
|
||||
decoration:
|
||||
normalTextFieldStyle("Exam date", "")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
initialDate: expireDate == null
|
||||
? DateTime.now()
|
||||
: expireDate!.subtract(
|
||||
const Duration(days: 1)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (expireDate != null &&
|
||||
expireDate!
|
||||
.microsecondsSinceEpoch <=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value;
|
||||
examDate = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'overseas',
|
||||
title: const Text("Overseas Address?"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
////COUNTRY DROPDOWN
|
||||
SizedBox(
|
||||
child: overseas == true
|
||||
? FormBuilderDropdown<Country>(
|
||||
initialValue: null,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
////REGION DROPDOWN
|
||||
FormBuilderDropdown<Region?>(
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
//// region onchange
|
||||
onChanged: (Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
getProvinces();
|
||||
}
|
||||
},
|
||||
initialValue: selectedRegion,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
name: 'region',
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
////PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged:
|
||||
(Province? province) {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
selectedProvince =
|
||||
province;
|
||||
getCities();
|
||||
}
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
|
||||
//// CityMunicipalities dropdown
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
selectedMunicipality = city;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
]),
|
||||
////VALIDITY DATE
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
controller: validityDateController,
|
||||
firstDate: DateTime(1970),
|
||||
lastDate: DateTime(2100),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Validity date", "Validity date")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (examDate != null &&
|
||||
examDate!.microsecondsSinceEpoch >=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
expireDate = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
initialDate: examDate == null
|
||||
? DateTime.now()
|
||||
: examDate!
|
||||
.add(const Duration(days: 1)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(
|
||||
"Placement of Examination/Conferment",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.displaySmall!
|
||||
.copyWith(fontSize: blockSizeVertical * 2),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
////OVERSEAS ADDRESS SWITCH
|
||||
Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: 'This field is required'),
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'overseas',
|
||||
title: const Text("Overseas Address?"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
////COUNTRY DROPDOWN
|
||||
SizedBox(
|
||||
child: overseas == true
|
||||
? FormBuilderDropdown<Country>(
|
||||
initialValue: null,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
////REGION DROPDOWN
|
||||
FormBuilderDropdown<Region?>(
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
//// region onchange
|
||||
onChanged: (Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
getProvinces();
|
||||
}
|
||||
},
|
||||
initialValue: selectedRegion,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
name: 'region',
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
////PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged:
|
||||
(Province? province) {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
selectedProvince =
|
||||
province;
|
||||
getCities();
|
||||
}
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
|
||||
//// CityMunicipalities dropdown
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
selectedMunicipality = city;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24,),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
|
@ -464,9 +458,7 @@ class _AddEligibilityScreenState extends State<AddEligibilityScreen> {
|
|||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -78,8 +78,8 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
|
|||
validityDateController.text = state.eligibityCert.validityDate == null
|
||||
? ''
|
||||
: state.eligibityCert.validityDate.toString();
|
||||
DateTime? examDate = DateTime.tryParse(examDateController.text) ;
|
||||
DateTime? expireDate = DateTime.tryParse(validityDateController.text);
|
||||
DateTime? examDate = DateTime.tryParse(examDateController.text);
|
||||
DateTime? expireDate = DateTime.tryParse(validityDateController.text);
|
||||
provinces = state.provinces;
|
||||
citymuns = state.cities;
|
||||
regions = state.regions;
|
||||
|
@ -96,461 +96,445 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
|
|||
padding: const EdgeInsets.symmetric(vertical: 25, horizontal: 28),
|
||||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
////ELIGIBILITIES DROPDOWN
|
||||
DropdownButtonFormField<Eligibility>(
|
||||
validator: (value) =>
|
||||
value == null ? 'required' : null,
|
||||
isExpanded: true,
|
||||
onChanged: (Eligibility? eligibility) {
|
||||
selectedEligibility = eligibility;
|
||||
},
|
||||
value: selectedEligibility,
|
||||
items: state.eligibilities
|
||||
.map<DropdownMenuItem<Eligibility>>(
|
||||
(Eligibility eligibility) {
|
||||
return DropdownMenuItem<Eligibility>(
|
||||
value: eligibility,
|
||||
child: Text(eligibility.title));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle("Eligibility", "")),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
child: ListView(children: [
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
////ELIGIBILITIES DROPDOWN
|
||||
DropdownButtonFormField<Eligibility>(
|
||||
validator: (value) => value == null ? 'required' : null,
|
||||
isExpanded: true,
|
||||
onChanged: (Eligibility? eligibility) {
|
||||
selectedEligibility = eligibility;
|
||||
},
|
||||
value: selectedEligibility,
|
||||
items: state.eligibilities
|
||||
.map<DropdownMenuItem<Eligibility>>(
|
||||
(Eligibility eligibility) {
|
||||
return DropdownMenuItem<Eligibility>(
|
||||
value: eligibility, child: Text(eligibility.title));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle("Eligibility", "")),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
////LICENSE NUMBER
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
onChanged: (value) {
|
||||
license = value;
|
||||
},
|
||||
name: 'license_number',
|
||||
initialValue: license,
|
||||
decoration: normalTextFieldStyle(
|
||||
"license number", "license number"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
// //RATING
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.numeric(
|
||||
errorText: "Enter a number"),
|
||||
keyboardType:
|
||||
const TextInputType.numberWithOptions(),
|
||||
onChanged: (value) {
|
||||
rating = value;
|
||||
},
|
||||
name: 'rating',
|
||||
initialValue:
|
||||
rating == null ? 'N/A' : rating.toString(),
|
||||
decoration:
|
||||
normalTextFieldStyle('rating', 'rating'),
|
||||
),
|
||||
),
|
||||
],
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
////LICENSE NUMBER
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
onChanged: (value) {
|
||||
license = value;
|
||||
},
|
||||
name: 'license_number',
|
||||
initialValue: license,
|
||||
decoration: normalTextFieldStyle(
|
||||
"license number", "license number"),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: StatefulBuilder(builder: (context, setState) {
|
||||
return Row(
|
||||
children: [
|
||||
// //EXAM DATE
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
use24HourFormat: false,
|
||||
controller: examDateController,
|
||||
firstDate: DateTime(1990),
|
||||
lastDate: DateTime(2100),
|
||||
decoration:
|
||||
normalTextFieldStyle("Exam date", "")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
initialDate: expireDate == null
|
||||
? DateTime.now()
|
||||
: expireDate!
|
||||
.subtract(const Duration(days: 1)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (expireDate != null &&
|
||||
expireDate!.microsecondsSinceEpoch <=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
examDate = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
// //RATING
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
validator: FormBuilderValidators.numeric(
|
||||
errorText: "Enter a number"),
|
||||
keyboardType:
|
||||
const TextInputType.numberWithOptions(),
|
||||
onChanged: (value) {
|
||||
rating = value;
|
||||
},
|
||||
name: 'rating',
|
||||
initialValue:
|
||||
rating == null ? 'N/A' : rating.toString(),
|
||||
decoration:
|
||||
normalTextFieldStyle('rating', 'rating'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: StatefulBuilder(builder: (context, setState) {
|
||||
return Row(
|
||||
children: [
|
||||
// //EXAM DATE
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
use24HourFormat: false,
|
||||
controller: examDateController,
|
||||
firstDate: DateTime(1990),
|
||||
lastDate: DateTime(2100),
|
||||
decoration:
|
||||
normalTextFieldStyle("Exam date", "")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
initialDate: expireDate == null
|
||||
? DateTime.now()
|
||||
: expireDate!
|
||||
.subtract(const Duration(days: 1)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (expireDate != null &&
|
||||
expireDate!.microsecondsSinceEpoch <=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
examDate = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
)),
|
||||
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
////VALIDITY DATE
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
use24HourFormat: false,
|
||||
controller: validityDateController,
|
||||
firstDate: DateTime(1970),
|
||||
lastDate: DateTime(2100),
|
||||
decoration:
|
||||
normalTextFieldStyle("validity date", "")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (examDate != null &&
|
||||
examDate!.microsecondsSinceEpoch >=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
expireDate = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
initialDate: examDate == null
|
||||
? DateTime.now()
|
||||
: examDate!.add(const Duration(days: 1)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"Placement of Examination/Confinement",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.displaySmall!
|
||||
.copyWith(fontSize: blockSizeVertical * 2),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//OVERSEAS ADDRESS SWITCH
|
||||
StatefulBuilder(builder: (context, StateSetter setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
////VALIDITY DATE
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: DateTimePicker(
|
||||
use24HourFormat: false,
|
||||
controller: validityDateController,
|
||||
firstDate: DateTime(1970),
|
||||
lastDate: DateTime(2100),
|
||||
decoration:
|
||||
normalTextFieldStyle("validity date", "")
|
||||
.copyWith(
|
||||
prefixIcon: const Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (examDate != null &&
|
||||
examDate!.microsecondsSinceEpoch >=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value;
|
||||
expireDate = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'overseas',
|
||||
title: const Text("Overseas Address?"),
|
||||
initialDate: examDate == null
|
||||
? DateTime.now()
|
||||
: examDate!.add(const Duration(days: 1)),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//COUNTRY DROPDOWN
|
||||
SizedBox(
|
||||
child: overseas == true
|
||||
? FormBuilderDropdown<Country>(
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"Placement of Examination/Confinement",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.displaySmall!
|
||||
.copyWith(fontSize: blockSizeVertical * 2),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//OVERSEAS ADDRESS SWITCH
|
||||
StatefulBuilder(builder: (context, StateSetter setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'overseas',
|
||||
title: const Text("Overseas Address?"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//COUNTRY DROPDOWN
|
||||
SizedBox(
|
||||
child: overseas == true
|
||||
? FormBuilderDropdown<Country>(
|
||||
validator: (value) =>
|
||||
value == null ? 'required' : null,
|
||||
initialValue: selectedCountry!.id == 175
|
||||
? null
|
||||
: selectedCountry,
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
validator: (value) =>
|
||||
value == null ? 'required' : null,
|
||||
initialValue: selectedCountry!.id == 175
|
||||
? null
|
||||
: selectedCountry,
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
isExpanded: true,
|
||||
onChanged: (Region? region) async {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
try {
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode: selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
} catch (e) {
|
||||
context
|
||||
.read<EligibilityBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedProvince = provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey.currentContext
|
||||
?.read<EligibilityBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality = citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
});
|
||||
},
|
||||
)
|
||||
: Column(
|
||||
children: [
|
||||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
value: selectedRegion,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: regions == null
|
||||
? []
|
||||
: regions!
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged:
|
||||
(Province? province) async {
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
selectedProvince = province;
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code:
|
||||
selectedProvince!
|
||||
.code
|
||||
.toString());
|
||||
} catch (e) {
|
||||
context
|
||||
.read<EligibilityBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
});
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Province*", "Province")),
|
||||
),
|
||||
),
|
||||
|
||||
//// City municipality
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: (value) => value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
onChanged: (Region? region) async {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
try{
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!.code
|
||||
.toString());
|
||||
}catch(e){
|
||||
context.read<EligibilityBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedProvince = provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<EligibilityBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
});
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
selectedMunicipality = city;
|
||||
},
|
||||
value: selectedRegion,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: regions == null
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: regions!.map<
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<
|
||||
Region>(
|
||||
value: region,
|
||||
child: Text(region
|
||||
.description!));
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(
|
||||
c.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged: (Province?
|
||||
province) async {
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
selectedProvince = province;
|
||||
try{
|
||||
|
||||
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code:
|
||||
selectedProvince!
|
||||
.code
|
||||
.toString());
|
||||
}catch(e){
|
||||
context.read<EligibilityBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
});
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
|
||||
//// City municipality
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
selectedMunicipality = city;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
const Expanded(
|
||||
child: SizedBox(),
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
style: mainBtnStyle(
|
||||
primary, Colors.transparent, second),
|
||||
onPressed: () {
|
||||
ExamAddress examAddress;
|
||||
////rating
|
||||
double? rate =
|
||||
rating == null ? null : double.parse(rating!);
|
||||
////license
|
||||
String? newLicense = license;
|
||||
////city municipality
|
||||
CityMunicipality? cityMunicipality =
|
||||
selectedMunicipality;
|
||||
////exam date
|
||||
DateTime? examDate =
|
||||
examDateController.text.isEmpty
|
||||
? null
|
||||
: DateTime.parse(examDateController.text);
|
||||
// // validity date
|
||||
DateTime? validityDate = validityDateController
|
||||
.text.isEmpty
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 18,
|
||||
),
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
style:
|
||||
mainBtnStyle(primary, Colors.transparent, second),
|
||||
onPressed: () {
|
||||
ExamAddress examAddress;
|
||||
////rating
|
||||
double? rate =
|
||||
rating == null ? null : double.parse(rating!);
|
||||
////license
|
||||
String? newLicense = license;
|
||||
////city municipality
|
||||
CityMunicipality? cityMunicipality =
|
||||
selectedMunicipality;
|
||||
////exam date
|
||||
DateTime? examDate = examDateController.text.isEmpty
|
||||
? null
|
||||
: DateTime.parse(examDateController.text);
|
||||
// // validity date
|
||||
DateTime? validityDate =
|
||||
validityDateController.text.isEmpty
|
||||
? null
|
||||
: DateTime.parse(validityDateController.text);
|
||||
//// exam address
|
||||
if (overseas!) {
|
||||
examAddress = ExamAddress(
|
||||
barangay: null,
|
||||
id: state.eligibityCert.examAddress?.id,
|
||||
addressCategory: state.eligibityCert
|
||||
.examAddress?.addressCategory,
|
||||
examAddressClass: state.eligibityCert
|
||||
.examAddress?.examAddressClass,
|
||||
country: selectedCountry,
|
||||
cityMunicipality: null);
|
||||
} else {
|
||||
examAddress = ExamAddress(
|
||||
barangay: state
|
||||
.eligibityCert.examAddress?.barangay,
|
||||
id: state.eligibityCert.examAddress?.id,
|
||||
addressCategory: state.eligibityCert
|
||||
.examAddress?.addressCategory,
|
||||
examAddressClass: state.eligibityCert
|
||||
.examAddress?.examAddressClass,
|
||||
country: Country(
|
||||
id: 175,
|
||||
name: 'Philippines',
|
||||
code: 'PH'),
|
||||
cityMunicipality: cityMunicipality);
|
||||
}
|
||||
//// exam address
|
||||
if (overseas!) {
|
||||
examAddress = ExamAddress(
|
||||
barangay: null,
|
||||
id: state.eligibityCert.examAddress?.id,
|
||||
addressCategory: state
|
||||
.eligibityCert.examAddress?.addressCategory,
|
||||
examAddressClass: state.eligibityCert
|
||||
.examAddress?.examAddressClass,
|
||||
country: selectedCountry,
|
||||
cityMunicipality: null);
|
||||
} else {
|
||||
examAddress = ExamAddress(
|
||||
barangay:
|
||||
state.eligibityCert.examAddress?.barangay,
|
||||
id: state.eligibityCert.examAddress?.id,
|
||||
addressCategory: state
|
||||
.eligibityCert.examAddress?.addressCategory,
|
||||
examAddressClass: state.eligibityCert
|
||||
.examAddress?.examAddressClass,
|
||||
country: Country(
|
||||
id: 175, name: 'Philippines', code: 'PH'),
|
||||
cityMunicipality: cityMunicipality);
|
||||
}
|
||||
|
||||
EligibityCert eligibityCert = EligibityCert(
|
||||
id: state.eligibityCert.id,
|
||||
rating: rate,
|
||||
examDate: examDate,
|
||||
attachments: null,
|
||||
eligibility: selectedEligibility,
|
||||
examAddress: examAddress,
|
||||
validityDate: validityDate,
|
||||
licenseNumber: newLicense,
|
||||
overseas: overseas);
|
||||
if (formKey.currentState!.saveAndValidate()) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Loading...");
|
||||
context.read<EligibilityBloc>().add(
|
||||
UpdateEligibility(
|
||||
eligibityCert: eligibityCert,
|
||||
oldEligibility:
|
||||
state.eligibityCert.eligibility!.id,
|
||||
profileId: widget.profileId.toString(),
|
||||
token: widget.token));
|
||||
}
|
||||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
]),
|
||||
EligibityCert eligibityCert = EligibityCert(
|
||||
id: state.eligibityCert.id,
|
||||
rating: rate,
|
||||
examDate: examDate,
|
||||
attachments: null,
|
||||
eligibility: selectedEligibility,
|
||||
examAddress: examAddress,
|
||||
validityDate: validityDate,
|
||||
licenseNumber: newLicense,
|
||||
overseas: overseas);
|
||||
if (formKey.currentState!.saveAndValidate()) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Loading...");
|
||||
context.read<EligibilityBloc>().add(
|
||||
UpdateEligibility(
|
||||
eligibityCert: eligibityCert,
|
||||
oldEligibility:
|
||||
state.eligibityCert.eligibility!.id,
|
||||
profileId: widget.profileId.toString(),
|
||||
token: widget.token));
|
||||
}
|
||||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,73 +1,113 @@
|
|||
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';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
|
||||
import 'package:unit2/bloc/profile/education/education_bloc.dart';
|
||||
import 'package:unit2/bloc/profile/eligibility/eligibility_bloc.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/url_launcher_file_downloader.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../../../utils/urls.dart';
|
||||
class EligibilityViewAttachment extends StatefulWidget {
|
||||
|
||||
class EligibilityViewAttachment extends StatefulWidget {
|
||||
const EligibilityViewAttachment({super.key});
|
||||
|
||||
@override
|
||||
State<EligibilityViewAttachment> createState() => _EligibilityViewAttachmentState();
|
||||
State<EligibilityViewAttachment> createState() =>
|
||||
_EligibilityViewAttachmentState();
|
||||
}
|
||||
|
||||
class _EligibilityViewAttachmentState extends State<EligibilityViewAttachment> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String? filename;
|
||||
String? fileUrl;
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: ()async {
|
||||
await launchUrl(Uri.parse(fileUrl!));
|
||||
},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text("Attachment"),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(onPressed: () {}, icon: const Icon(Icons.share)),
|
||||
],
|
||||
),
|
||||
body: BlocConsumer<EligibilityBloc, EligibilityState>(builder: (context,state){
|
||||
if(state is EligibilityAttachmentViewState){
|
||||
fileUrl = state.fileUrl;
|
||||
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f' ? true : false;
|
||||
return SizedBox(
|
||||
child: isPDF?SfPdfViewer.network(
|
||||
state.fileUrl,onDocumentLoadFailed: (details) {
|
||||
Center(child: Text(details.description),);
|
||||
},): Center(
|
||||
child: CachedNetworkImage(
|
||||
progressIndicatorBuilder: (context, url, progress) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: CircularProgressIndicator(color: primary,));
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
await launchInBrowser(fileUrl!);
|
||||
},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text("Attachment"),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
context.read<EligibilityBloc>().add(
|
||||
ShareAttachment(fileName: filename!, source: fileUrl!));
|
||||
},
|
||||
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider, fit: BoxFit.fill)),
|
||||
),
|
||||
imageUrl:
|
||||
state.fileUrl,
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},listener: (context, state) {
|
||||
|
||||
},)
|
||||
);
|
||||
icon: const Icon(Icons.share)),
|
||||
],
|
||||
),
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<EligibilityBloc, EligibilityState>(
|
||||
builder: (context, state) {
|
||||
if (state is EligibilityAttachmentViewState) {
|
||||
fileUrl = state.fileUrl;
|
||||
filename = state.fileName;
|
||||
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f'
|
||||
? true
|
||||
: false;
|
||||
return SizedBox(
|
||||
child: isPDF
|
||||
? SfPdfViewer.network(
|
||||
state.fileUrl,
|
||||
onDocumentLoadFailed: (details) {
|
||||
Center(
|
||||
child: Text(details.description),
|
||||
);
|
||||
},
|
||||
)
|
||||
: Center(
|
||||
child: CachedNetworkImage(
|
||||
progressIndicatorBuilder: (context, url, progress) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: CircularProgressIndicator(
|
||||
color: primary,
|
||||
));
|
||||
},
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider, fit: BoxFit.fill)),
|
||||
),
|
||||
imageUrl: state.fileUrl,
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (state is EligibilityErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: state.message,
|
||||
onpressed: () {
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
listener: (context, state) {
|
||||
if (state is EligibilityLoadingState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is EligibilityAttachmentViewState ||
|
||||
state is EligibilityErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.dismiss();
|
||||
}
|
||||
},
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ import '../../../bloc/profile/eligibility/eligibility_bloc.dart';
|
|||
import '../../../utils/alerts.dart';
|
||||
import '../shared/multiple_attachment.dart';
|
||||
import '../shared/single_attachment.dart';
|
||||
import '../shared/view_attachment.dart';
|
||||
import 'eligibility/eligibility_view_attachment.dart';
|
||||
|
||||
class EligibiltyScreen extends StatelessWidget {
|
||||
|
@ -48,7 +47,7 @@ class EligibiltyScreen extends StatelessWidget {
|
|||
return true;
|
||||
},
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
title: context.watch<EligibilityBloc>().state is AddEligibilityState
|
||||
? const Text("Add Eligiblity")
|
||||
|
@ -637,7 +636,7 @@ class EligibiltyScreen extends StatelessWidget {
|
|||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) => BlocProvider.value(
|
||||
value: EligibilityBloc()..add(EligibiltyViewAttachmentEvent(source: state.eligibilities[index].attachments!.first.source!)),
|
||||
value: EligibilityBloc()..add(EligibiltyViewAttachmentEvent(source: state.eligibilities[index].attachments!.first.source!,filename: state.eligibilities[index].attachments!.first.filename!)),
|
||||
child: const EligibilityViewAttachment(),
|
||||
))));
|
||||
|
||||
|
@ -678,7 +677,7 @@ class EligibiltyScreen extends StatelessWidget {
|
|||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) => BlocProvider.value(
|
||||
value: EligibilityBloc()..add(EligibiltyViewAttachmentEvent(source: source)),
|
||||
value: EligibilityBloc()..add(EligibiltyViewAttachmentEvent(source: source,filename: filename)),
|
||||
child: const EligibilityViewAttachment(),
|
||||
))));
|
||||
},
|
||||
|
|
|
@ -510,8 +510,8 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
)
|
||||
: SizedBox(
|
||||
width: screenWidth,
|
||||
child: const Text(
|
||||
"Provide your father's primary information.",
|
||||
child: Text(
|
||||
"Provide your father's primary information.",style:Theme.of(context).textTheme.bodySmall,
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
),
|
||||
|
@ -808,8 +808,8 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
)
|
||||
: SizedBox(
|
||||
width: screenWidth,
|
||||
child: const Text(
|
||||
"Provide your mother's primary information",
|
||||
child: Text(
|
||||
"Provide your mother's primary information",style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
),
|
||||
|
@ -1238,13 +1238,13 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
)
|
||||
: SizedBox(
|
||||
width: screenWidth,
|
||||
child: const Padding(
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
const EdgeInsets.symmetric(
|
||||
vertical: 8,
|
||||
horizontal: 0),
|
||||
child: Text(
|
||||
"Provide your spouse's primary and employment information. Leave empty if not applicable.",
|
||||
"Provide your spouse's primary and employment information. Leave empty if not applicable.",style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
),
|
||||
|
@ -1540,13 +1540,13 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
}).toList())
|
||||
: SizedBox(
|
||||
width: screenWidth,
|
||||
child: const Padding(
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
const EdgeInsets.symmetric(
|
||||
vertical: 8,
|
||||
horizontal: 0),
|
||||
child: Text(
|
||||
"Provide your child/children's primary information. Leave empty if not applicable..",
|
||||
"Provide your child/children's primary information. Leave empty if not applicable.",style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
),
|
||||
|
@ -1854,13 +1854,13 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
}).toList())
|
||||
: SizedBox(
|
||||
width: screenWidth,
|
||||
child: const Padding(
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
const EdgeInsets.symmetric(
|
||||
vertical: 8,
|
||||
horizontal: 0),
|
||||
child: Text(
|
||||
"Provide the other related person's primary information. Leave empty if not applicable.",
|
||||
"Provide the other related person's primary information. Leave empty if not applicable.",style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
),
|
||||
|
|
|
@ -28,7 +28,6 @@ import '../../../utils/alerts.dart';
|
|||
import '../../../widgets/Leadings/close_leading.dart';
|
||||
import '../shared/multiple_attachment.dart';
|
||||
import '../shared/single_attachment.dart';
|
||||
import '../shared/view_attachment.dart';
|
||||
import 'learning_development/add_modal.dart';
|
||||
|
||||
class LearningAndDevelopmentScreen extends StatelessWidget {
|
||||
|
@ -46,6 +45,7 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
AttachmentCategory? selectedAttachmentCategory;
|
||||
List<AttachmentCategory> attachmentCategories = [];
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
title: context.watch<LearningDevelopmentBloc>().state
|
||||
is LearningDevelopmentAddingState
|
||||
|
@ -680,7 +680,7 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) => BlocProvider.value(
|
||||
value: LearningDevelopmentBloc()..add(LearningDevelopmentViewAttachmentEvent(source: state.learningsAndDevelopment[index].attachments!.first.source!)),
|
||||
value: LearningDevelopmentBloc()..add(LearningDevelopmentViewAttachmentEvent(source: state.learningsAndDevelopment[index].attachments!.first.source!,filename: state.learningsAndDevelopment[index].attachments!.first.filename!)),
|
||||
child: const LearningDevelopmentViewAttachment(),
|
||||
))));
|
||||
},
|
||||
|
@ -721,7 +721,7 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
MaterialPageRoute(
|
||||
builder: ((context) =>
|
||||
BlocProvider.value(
|
||||
value: LearningDevelopmentBloc()..add(LearningDevelopmentViewAttachmentEvent(source: source)),
|
||||
value: LearningDevelopmentBloc()..add(LearningDevelopmentViewAttachmentEvent(source: source,filename: filename)),
|
||||
child: const LearningDevelopmentViewAttachment(),
|
||||
))));
|
||||
},
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,71 +1,107 @@
|
|||
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';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
|
||||
import 'package:unit2/bloc/profile/learningDevelopment/learning_development_bloc.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/url_launcher_file_downloader.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
class LearningDevelopmentViewAttachment extends StatefulWidget {
|
||||
|
||||
class LearningDevelopmentViewAttachment extends StatefulWidget {
|
||||
const LearningDevelopmentViewAttachment({super.key});
|
||||
|
||||
@override
|
||||
State<LearningDevelopmentViewAttachment> createState() => _LearningDevelopmentViewAttachmentState();
|
||||
State<LearningDevelopmentViewAttachment> createState() =>
|
||||
_LearningDevelopmentViewAttachmentState();
|
||||
}
|
||||
|
||||
class _LearningDevelopmentViewAttachmentState extends State<LearningDevelopmentViewAttachment> {
|
||||
class _LearningDevelopmentViewAttachmentState
|
||||
extends State<LearningDevelopmentViewAttachment> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String? fileUrl;
|
||||
String? filename;
|
||||
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: ()async {
|
||||
await launchUrl(Uri.parse(fileUrl!));
|
||||
},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text("Attachment"),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(onPressed: () {}, icon: const Icon(Icons.share)),
|
||||
],
|
||||
),
|
||||
body: BlocConsumer<LearningDevelopmentBloc, LearningDevelopmentState>(builder: (context,state){
|
||||
if(state is LearningAndDevelopmentAttachmentViewState){
|
||||
fileUrl = state.fileUrl;
|
||||
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f' ? true : false;
|
||||
return SizedBox(
|
||||
child: isPDF?SfPdfViewer.network(
|
||||
state.fileUrl,onDocumentLoadFailed: (details) {
|
||||
Center(child: Text(details.description),);
|
||||
},): Center(
|
||||
child: CachedNetworkImage(
|
||||
progressIndicatorBuilder: (context, url, progress) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: CircularProgressIndicator(color: primary,));
|
||||
},
|
||||
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider, fit: BoxFit.fill)),
|
||||
),
|
||||
imageUrl:
|
||||
state.fileUrl,
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},listener: (context, state) {
|
||||
|
||||
},)
|
||||
);
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
await launchInBrowser(fileUrl!);
|
||||
},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text("Attachment"),
|
||||
centerTitle: true,
|
||||
actions: context.watch<LearningDevelopmentBloc>().state is LearningAndDevelopmentAttachmentViewState ? [
|
||||
IconButton(onPressed: () {
|
||||
context.read<LearningDevelopmentBloc>().add(ShareAttachment(fileName: filename!, source: fileUrl!));
|
||||
}, icon: const Icon(Icons.share)),
|
||||
]:[]
|
||||
),
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child:
|
||||
BlocConsumer<LearningDevelopmentBloc, LearningDevelopmentState>(
|
||||
builder: (context, state) {
|
||||
if (state is LearningAndDevelopmentAttachmentViewState) {
|
||||
fileUrl = state.fileUrl;
|
||||
filename = state.filename;
|
||||
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f'
|
||||
? true
|
||||
: false;
|
||||
return SizedBox(
|
||||
child: isPDF
|
||||
? SfPdfViewer.network(
|
||||
|
||||
state.fileUrl,
|
||||
onDocumentLoadFailed: (details) {
|
||||
Center(
|
||||
child: Text(details.description),
|
||||
);
|
||||
},
|
||||
)
|
||||
: Center(
|
||||
child: CachedNetworkImage(
|
||||
progressIndicatorBuilder: (context, url, progress) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: CircularProgressIndicator(
|
||||
color: primary,
|
||||
));
|
||||
},
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider, fit: BoxFit.fill)),
|
||||
),
|
||||
imageUrl: state.fileUrl,
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
listener: (context, state) {
|
||||
|
||||
if (state is LearningDevelopmentLoadingState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is LearningAndDevelopmentAttachmentViewState ||
|
||||
state is LearningDevelopmentErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.dismiss();
|
||||
}
|
||||
},
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,6 +83,7 @@ class _EditNonAcademicRecognitionScreenState
|
|||
child: Column(
|
||||
children: [
|
||||
FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
name: 'title',
|
||||
initialValue:
|
||||
state.nonAcademicRecognition.title,
|
||||
|
@ -205,6 +206,7 @@ class _EditNonAcademicRecognitionScreenState
|
|||
Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
controller:
|
||||
addAgencyController,
|
||||
decoration:
|
||||
|
|
|
@ -53,316 +53,303 @@ class _AddReferenceScreenState extends State<AddReferenceScreen> {
|
|||
return BlocBuilder<ReferencesBloc, ReferencesState>(
|
||||
builder: (context, state) {
|
||||
if (state is AddReferenceState) {
|
||||
return SingleChildScrollView(
|
||||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: SizedBox(
|
||||
height: screenHeight * .90,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(28),
|
||||
child: Column(
|
||||
|
||||
return FormBuilder(
|
||||
key: formKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(28),
|
||||
child: ListView(
|
||||
children: [
|
||||
|
||||
Row(
|
||||
children: [
|
||||
const SizedBox(height: 15,),
|
||||
////LAST NAME
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
|
||||
Row(
|
||||
children: [
|
||||
////LAST NAME
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
decoration: normalTextFieldStyle(
|
||||
"Last name *", "Last name *"),
|
||||
name: "lastname",
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////FIRST NAME
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
decoration: normalTextFieldStyle(
|
||||
"First name *", "First name *"),
|
||||
name: "firstname",
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
decoration: normalTextFieldStyle(
|
||||
"Middle name ", ""),
|
||||
name: "middlename",
|
||||
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////Mobile
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [mobileFormatter],
|
||||
name: "mobile",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Mobile *",
|
||||
"+63 (9xx) xxx - xxxx"),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderDropdown<AddressCategory>(
|
||||
name: 'category',
|
||||
validator:
|
||||
FormBuilderValidators.required(errorText: "This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Category", "Address Category"),
|
||||
items: state.categories
|
||||
.map<DropdownMenuItem<AddressCategory>>(
|
||||
(AddressCategory cat) {
|
||||
return DropdownMenuItem<AddressCategory>(
|
||||
value: cat,
|
||||
child: Text(cat.name!),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
selectedCategory = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////OVERSEAS ADDRESS
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'overseas',
|
||||
title: const Text("Overseas Address?"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
FormBuilderDropdown<Region?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged: (Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
getProvinces();
|
||||
}
|
||||
},
|
||||
initialValue: null,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
name: 'region',
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'This field is required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged: (Province? province) {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
selectedProvince = province;
|
||||
getCities();
|
||||
}
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Province*", "Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
if (selectedMunicipality !=
|
||||
city) {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality = city;
|
||||
getBarangays();
|
||||
}
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(
|
||||
c.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
//// BARANGAY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child:
|
||||
DropdownButtonFormField<Barangay>(
|
||||
isExpanded: true,
|
||||
onChanged: (Barangay? baragay) {
|
||||
selectedBarangay = baragay;
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Barangay*", "Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: FormBuilderDropdown<Country>(
|
||||
initialValue: null,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
|
||||
],
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
decoration: normalTextFieldStyle(
|
||||
"Last name *", "Last name *"),
|
||||
name: "lastname",
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////FIRST NAME
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
decoration: normalTextFieldStyle(
|
||||
"First name *", "First name *"),
|
||||
name: "firstname",
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
decoration: normalTextFieldStyle(
|
||||
"Middle name ", ""),
|
||||
name: "middlename",
|
||||
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////Mobile
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [mobileFormatter],
|
||||
name: "mobile",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Mobile *",
|
||||
"+63 (9xx) xxx - xxxx"),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderDropdown<AddressCategory>(
|
||||
name: 'category',
|
||||
validator:
|
||||
FormBuilderValidators.required(errorText: "This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Category", "Address Category"),
|
||||
items: state.categories
|
||||
.map<DropdownMenuItem<AddressCategory>>(
|
||||
(AddressCategory cat) {
|
||||
return DropdownMenuItem<AddressCategory>(
|
||||
value: cat,
|
||||
child: Text(cat.name!),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
selectedCategory = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////OVERSEAS ADDRESS
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'overseas',
|
||||
title: const Text("Overseas Address?"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
FormBuilderDropdown<Region?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged: (Region? region) async {
|
||||
if (selectedRegion != region) {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
getProvinces();
|
||||
}
|
||||
},
|
||||
initialValue: null,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
name: 'region',
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
value: region,
|
||||
child: Text(region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'This field is required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
value: selectedProvince,
|
||||
onChanged: (Province? province) {
|
||||
if (selectedProvince !=
|
||||
province) {
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
selectedProvince = province;
|
||||
getCities();
|
||||
}
|
||||
},
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Province*", "Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality? city) {
|
||||
if (selectedMunicipality !=
|
||||
city) {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality = city;
|
||||
getBarangays();
|
||||
}
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(
|
||||
c.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
//// BARANGAY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child:
|
||||
DropdownButtonFormField<Barangay>(
|
||||
isExpanded: true,
|
||||
onChanged: (Barangay? baragay) {
|
||||
selectedBarangay = baragay;
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Barangay*", "Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: FormBuilderDropdown<Country>(
|
||||
initialValue: null,
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(country.name!)));
|
||||
}).toList(),
|
||||
name: 'country',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16,),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
|
@ -438,13 +425,12 @@ class _AddReferenceScreenState extends State<AddReferenceScreen> {
|
|||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
|
|
|
@ -72,473 +72,461 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
|
||||
return FormBuilder(
|
||||
key: formKey,
|
||||
child: SizedBox(
|
||||
height: screenHeight * .90,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(28),
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 25),
|
||||
Row(
|
||||
children: [
|
||||
////LAST NAME
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter(),mobileFormatter],
|
||||
initialValue: state.ref.lastName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Last name *", "Last name *"),
|
||||
name: "lastname",
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////FIRST NAME
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
initialValue: state.ref.firstName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"First name *", "First name *"),
|
||||
name: "firstname",
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
initialValue: state.ref.middleName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Middle name *", "Midlle name *"),
|
||||
name: "middlename",
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////CATEGORY
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
initialValue: state.ref.contactNo,
|
||||
name: "mobile",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Tel./Mobile *", "Tel./Mobile"),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderDropdown<AddressCategory>(
|
||||
name: 'category',
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Category", "Address Category"),
|
||||
items: state.categories
|
||||
.map<DropdownMenuItem<AddressCategory>>(
|
||||
(AddressCategory cat) {
|
||||
return DropdownMenuItem<AddressCategory>(
|
||||
value: cat,
|
||||
child: Text(cat.name!),
|
||||
);
|
||||
}).toList(),
|
||||
initialValue: selectedCategory,
|
||||
onChanged: (value) {
|
||||
selectedCategory = value;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////OVERSEAS ADDRESS
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'overseas',
|
||||
title: const Text("Overseas Address?"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
isExpanded: true,
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged:
|
||||
(Region? region) async {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(28),
|
||||
child: ListView(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
////LAST NAME
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter(),mobileFormatter],
|
||||
initialValue: state.ref.lastName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Last name *", "Last name *"),
|
||||
name: "lastname",
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////FIRST NAME
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
initialValue: state.ref.firstName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"First name *", "First name *"),
|
||||
name: "firstname",
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
initialValue: state.ref.middleName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Middle name *", "Midlle name *"),
|
||||
name: "middlename",
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
////CATEGORY
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
initialValue: state.ref.contactNo,
|
||||
name: "mobile",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Tel./Mobile *", "Tel./Mobile"),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderDropdown<AddressCategory>(
|
||||
name: 'category',
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Category", "Address Category"),
|
||||
items: state.categories
|
||||
.map<DropdownMenuItem<AddressCategory>>(
|
||||
(AddressCategory cat) {
|
||||
return DropdownMenuItem<AddressCategory>(
|
||||
value: cat,
|
||||
child: Text(cat.name!),
|
||||
);
|
||||
}).toList(),
|
||||
initialValue: selectedCategory,
|
||||
onChanged: (value) {
|
||||
selectedCategory = value;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////OVERSEAS ADDRESS
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
FormBuilderSwitch(
|
||||
initialValue: overseas,
|
||||
activeColor: second,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
overseas = value!;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle("", ''),
|
||||
name: 'overseas',
|
||||
title: const Text("Overseas Address?"),
|
||||
),
|
||||
SizedBox(
|
||||
height: overseas == true ? 12 : 0,
|
||||
),
|
||||
SizedBox(
|
||||
child: overseas == false
|
||||
? Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
isExpanded: true,
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged:
|
||||
(Region? region) async {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
|
||||
selectedRegion = region;
|
||||
});
|
||||
//// GET PROVINCES
|
||||
try {
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
} catch (e) {
|
||||
context
|
||||
.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
////GET CITY MUNICIPALITY
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code:
|
||||
selectedProvince!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAYS
|
||||
try {
|
||||
barangays = await LocationUtils
|
||||
selectedRegion = region;
|
||||
});
|
||||
//// GET PROVINCES
|
||||
try {
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
} catch (e) {
|
||||
context
|
||||
.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
////GET CITY MUNICIPALITY
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code:
|
||||
selectedProvince!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAYS
|
||||
try {
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
},
|
||||
value: selectedRegion,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: state.regions.map<
|
||||
DropdownMenuItem<
|
||||
Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<
|
||||
Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
onChanged: (Province?
|
||||
province) async {
|
||||
selectedProvince =
|
||||
province;
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
//// GET CITIES
|
||||
try {
|
||||
citymuns =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
try {
|
||||
barangays =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code: selectedMunicipality!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
},
|
||||
value: selectedProvince,
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province
|
||||
province) {
|
||||
return DropdownMenuItem(
|
||||
value:
|
||||
province,
|
||||
child:
|
||||
FittedBox(
|
||||
child: Text(
|
||||
province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child:
|
||||
DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality?
|
||||
city) async {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality =
|
||||
city;
|
||||
//// GET BARANGAYS
|
||||
try {
|
||||
barangays =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
},
|
||||
value: selectedRegion,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: state.regions.map<
|
||||
code: selectedMunicipality!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<
|
||||
Region>(
|
||||
value: region,
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// PROVINCE DROPDOWN
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.transparent,
|
||||
inAsyncCall: provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
onChanged: (Province?
|
||||
province) async {
|
||||
selectedProvince =
|
||||
province;
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
//// GET CITIES
|
||||
try {
|
||||
citymuns =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
try {
|
||||
barangays =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code: selectedMunicipality!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
},
|
||||
value: selectedProvince,
|
||||
items: provinces == null
|
||||
? []
|
||||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province
|
||||
province) {
|
||||
return DropdownMenuItem(
|
||||
value:
|
||||
province,
|
||||
child:
|
||||
FittedBox(
|
||||
child: Text(
|
||||
province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Province*",
|
||||
"Province")),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child:
|
||||
DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(CityMunicipality?
|
||||
city) async {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality =
|
||||
city;
|
||||
//// GET BARANGAYS
|
||||
try {
|
||||
barangays =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code: selectedMunicipality!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
items: citymuns == null
|
||||
? []
|
||||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality
|
||||
c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
//// BARANGAY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child:
|
||||
DropdownButtonFormField<
|
||||
Barangay>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(Barangay? baragay) {
|
||||
selectedBarangay =
|
||||
baragay;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Barangay*",
|
||||
"Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay
|
||||
barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: DropdownButtonFormField<
|
||||
Country>(
|
||||
isExpanded: true,
|
||||
value: selectedCountry?.id == 175
|
||||
? null
|
||||
: selectedCountry,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries.map<
|
||||
DropdownMenuItem<
|
||||
Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<
|
||||
Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
country.name!)));
|
||||
}).toList(),
|
||||
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
//// country dropdown
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
),
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality
|
||||
c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
//// BARANGAY
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child:
|
||||
DropdownButtonFormField<
|
||||
Barangay>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(Barangay? baragay) {
|
||||
selectedBarangay =
|
||||
baragay;
|
||||
},
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Barangay*",
|
||||
"Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay
|
||||
barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: DropdownButtonFormField<
|
||||
Country>(
|
||||
isExpanded: true,
|
||||
value: selectedCountry?.id == 175
|
||||
? null
|
||||
: selectedCountry,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries.map<
|
||||
DropdownMenuItem<
|
||||
Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<
|
||||
Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
country.name!)));
|
||||
}).toList(),
|
||||
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
decoration: normalTextFieldStyle(
|
||||
"Country*", "Country"),
|
||||
//// country dropdown
|
||||
onChanged: (Country? value) {
|
||||
selectedCountry = value;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 16,),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
|
@ -616,8 +604,7 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class ReferencesScreen extends StatelessWidget {
|
|||
int? profileId;
|
||||
String? token;
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
title: context.watch<ReferencesBloc>().state is AddReferenceState
|
||||
? const Text("Add Personal Reference")
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -156,6 +156,7 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
onSuggestionTap: (position) {
|
||||
setState(() {
|
||||
selectedPosition = position.item;
|
||||
print(selectedPosition!.title);
|
||||
positionFocusNode.unfocus();
|
||||
});
|
||||
},
|
||||
|
@ -193,6 +194,8 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
return Column(
|
||||
children: [
|
||||
SearchField(
|
||||
|
||||
enabled: false,
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
|
@ -222,6 +225,8 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
searchInputDecoration:
|
||||
normalTextFieldStyle("Agency *", "")
|
||||
.copyWith(
|
||||
filled: true,
|
||||
fillColor: Colors.grey.shade300,
|
||||
suffixIcon: GestureDetector(
|
||||
child: const Icon(
|
||||
Icons.arrow_drop_down,
|
||||
|
@ -267,7 +272,10 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
});
|
||||
},
|
||||
title: "Add Agency")),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text("You cannot change agency on update mode",style: Theme.of(context).textTheme.bodySmall,),
|
||||
),
|
||||
SizedBox(
|
||||
height: showAgency ? 12 : 0,
|
||||
),
|
||||
|
@ -424,15 +432,7 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
)),
|
||||
selectableDayPredicate:
|
||||
(date) {
|
||||
if (to != null &&
|
||||
to!.microsecondsSinceEpoch <=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
from = DateTime.parse(
|
||||
|
@ -475,15 +475,7 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
DateTime(1990),
|
||||
lastDate:
|
||||
DateTime(2100),
|
||||
selectableDayPredicate:
|
||||
(date) {
|
||||
if (from != null &&
|
||||
from!.microsecondsSinceEpoch >=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
to = DateTime.parse(
|
||||
|
@ -522,6 +514,7 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
],
|
||||
);
|
||||
}),
|
||||
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
|
|
@ -197,6 +197,7 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
////AGENCY
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SearchField(
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
|
@ -407,6 +408,7 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
SizedBox(
|
||||
child: showSalaryGradeAndSalaryStep
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
|
@ -481,20 +483,7 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// NAME OF OFFICE UNIT
|
||||
FormBuilderTextField(
|
||||
onChanged: (value){
|
||||
sOffice = value;
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: 'office',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Name of Office/Unit", "Name of Office/Unit"),
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
@ -518,7 +507,10 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
const Text("Immediate SuperVisor"),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text("Immediate SuperVisor",textAlign: TextAlign.start, style: Theme.of(context).textTheme.titleMedium,),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
@ -557,12 +549,26 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
decoration:
|
||||
normalTextFieldStyle("Last name", "Last Name"),
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// NAME OF OFFICE UNIT
|
||||
FormBuilderTextField(
|
||||
onChanged: (value){
|
||||
sOffice = value;
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: 'office',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Name of Office/Unit", "Name of Office/Unit"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
////CURRENTLY EMPLOYED
|
||||
FormBuilderSwitch(
|
||||
|
@ -690,12 +696,18 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
],
|
||||
);
|
||||
}),
|
||||
|
||||
const Text("Work Experience"),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text("Work Experience",style: Theme.of(context).textTheme.titleMedium,),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
maxLines: 3,
|
||||
onChanged: (value){
|
||||
accomplishment = value;
|
||||
},
|
||||
|
@ -709,6 +721,7 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
height: 12,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
maxLines: 3,
|
||||
onChanged: (value){
|
||||
duties = value;
|
||||
},
|
||||
|
@ -733,8 +746,7 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
style:
|
||||
mainBtnStyle(primary, Colors.transparent, second),
|
||||
onPressed: () {
|
||||
print(salaryGrade);
|
||||
print(salaryGradeStep);
|
||||
|
||||
|
||||
if (_formKey.currentState!.validate()) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
|
|
|
@ -48,6 +48,12 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
String? salary;
|
||||
String? salaryGrade;
|
||||
String? salaryGradeStep;
|
||||
String? accomplishments;
|
||||
String? duties;
|
||||
String? sFname;
|
||||
String? sMname;
|
||||
String? sLname;
|
||||
String? sOffice;
|
||||
//show agency category is a variable to show adding of agency category if you add agency manually
|
||||
bool showAgencyCategory = false;
|
||||
//showSalaryGadeAndSalaryStep is a variable that will show salary
|
||||
|
@ -91,6 +97,12 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
currentlyEmployed = state.workHistory.toDate == null ? true : false;
|
||||
from = state.workHistory.fromDate;
|
||||
to = state.workHistory.toDate;
|
||||
accomplishments = state.workHistory.accomplishment == null?null:state.workHistory.accomplishment!.first.accomplishment!;
|
||||
duties = state.workHistory.actualDuties == null? null:state.workHistory.actualDuties!.first.description;
|
||||
sFname = state.workHistory.supervisor?.firstname;
|
||||
sMname = state.workHistory.supervisor?.middlename;
|
||||
sLname = state.workHistory.supervisor?.lastname;
|
||||
sOffice = state.workHistory.supervisor?.stationName;
|
||||
return FormBuilder(
|
||||
key: _formKey,
|
||||
child: SizedBox(
|
||||
|
@ -146,10 +158,11 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
controller: addPositionController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
PositionTitle newAgencyPosition = PositionTitle(
|
||||
id: null,
|
||||
title: addPositionController.text
|
||||
.toUpperCase());
|
||||
PositionTitle newAgencyPosition =
|
||||
PositionTitle(
|
||||
id: null,
|
||||
title: addPositionController.text
|
||||
.toUpperCase());
|
||||
state.agencyPositions
|
||||
.insert(0, newAgencyPosition);
|
||||
selectedPosition = newAgencyPosition;
|
||||
|
@ -209,8 +222,10 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
////AGENCY
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SearchField(
|
||||
enabled: false,
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
controller: oldAgencyController,
|
||||
itemHeight: 100,
|
||||
|
@ -288,6 +303,7 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
});
|
||||
},
|
||||
title: "Add Agency")),
|
||||
Text("You cannot change agency on update mode",textAlign: TextAlign.start,style: Theme.of(context).textTheme.bodySmall,),
|
||||
|
||||
SizedBox(
|
||||
height: showAgencyCategory ? 12 : 0,
|
||||
|
@ -476,6 +492,7 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
],
|
||||
);
|
||||
}),
|
||||
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
@ -494,10 +511,71 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
normalTextFieldStyle("Monthly Salary *", "")
|
||||
.copyWith(prefix: const Text("₱ ")),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text("Immediate SuperVisor",style: Theme.of(context).textTheme.titleMedium,),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////IMMEDIATE SUPERVISOR
|
||||
FormBuilderTextField(
|
||||
initialValue: sFname,
|
||||
onChanged: (value) {
|
||||
sFname = value;
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: 'supervisor_firstname',
|
||||
decoration: normalTextFieldStyle(
|
||||
"First name", "First Name"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
initialValue: sMname,
|
||||
onChanged: (value) {
|
||||
sMname = value;
|
||||
},
|
||||
name: 'supervisor_middlename',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Middle name", "Middle Name"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
initialValue: sLname,
|
||||
onChanged: (value) {
|
||||
sLname = value;
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: 'supervisor_lastname',
|
||||
decoration:
|
||||
normalTextFieldStyle("Last name", "Last Name"),
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
//// NAME OF OFFICE UNIT
|
||||
FormBuilderTextField(
|
||||
initialValue:
|
||||
sOffice,
|
||||
onChanged: (value) {
|
||||
sOffice = value;
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: 'office',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Name of Office/Unit", "Name of Office/Unit"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
|
@ -640,12 +718,52 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text("Work Experience",textAlign: TextAlign.start, style: Theme.of(context).textTheme.titleMedium,),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
initialValue: accomplishments,
|
||||
maxLines: 3,
|
||||
onChanged: (value){
|
||||
accomplishments = value;
|
||||
},
|
||||
name: "accomplishment",
|
||||
decoration: normalTextFieldStyle(
|
||||
"List of Accomplishment and Contribution",
|
||||
"",
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
initialValue: duties,
|
||||
maxLines: 3,
|
||||
onChanged: (value){
|
||||
duties = value;
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: "summary",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Summary of Actual Duties",
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25,),
|
||||
////SUBMIT BUTTON
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
|
@ -654,50 +772,55 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
style:
|
||||
mainBtnStyle(primary, Colors.transparent, second),
|
||||
onPressed: () {
|
||||
// if (_formKey.currentState!.saveAndValidate()) {
|
||||
// final progress = ProgressHUD.of(context);
|
||||
// progress!.showWithText("Loading...");
|
||||
// salary = _formKey.currentState!.value['salary'];
|
||||
// selectedPosition ??= state.workHistory.position;
|
||||
// salaryGrade =
|
||||
// _formKey.currentState!.value['salary_grade'];
|
||||
// salaryGradeStep =
|
||||
// _formKey.currentState!.value['salary_step'];
|
||||
// selectedAgency ??= state.workHistory.agency;
|
||||
if (_formKey.currentState!.saveAndValidate()) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Loading...");
|
||||
salary = _formKey.currentState!.value['salary'];
|
||||
selectedPosition ??= state.workHistory.position;
|
||||
salaryGrade =
|
||||
_formKey.currentState!.value['salary_grade'];
|
||||
salaryGradeStep =
|
||||
_formKey.currentState!.value['salary_step'];
|
||||
selectedAgency ??= state.workHistory.agency;
|
||||
|
||||
// selectedStatus ??= AppoinemtStatus(
|
||||
// value: state.workHistory.statusAppointment!,
|
||||
// label: state.workHistory.statusAppointment!);
|
||||
// WorkHistory newWorkHistory = WorkHistory(
|
||||
// id: state.workHistory.id,
|
||||
// position: selectedPosition,
|
||||
// agency: selectedAgency,
|
||||
// fromDate: fromDateController.text.isEmpty
|
||||
// ? null
|
||||
// : DateTime.parse(fromDateController.text),
|
||||
// toDate: toDateController.text.isEmpty ||
|
||||
// toDateController.text.toUpperCase() ==
|
||||
// "PRESENT" ||
|
||||
// toDateController.text.toLowerCase() ==
|
||||
// 'null'
|
||||
// ? null
|
||||
// : DateTime.parse(toDateController.text),
|
||||
// monthlySalary: double.parse(salary!),
|
||||
// appointmentStatus: selectedStatus!.value,
|
||||
// salaryGrade: salaryGrade == null
|
||||
// ? null
|
||||
// : int.parse(salaryGrade!),
|
||||
// sgStep: salaryGradeStep == null
|
||||
// ? null
|
||||
// : int.parse(salaryGradeStep!),
|
||||
// );
|
||||
// context.read<WorkHistoryBloc>().add(
|
||||
// UpdateWorkHistory(
|
||||
// oldWorkHistory: state.workHistory,
|
||||
// profileId: widget.profileId.toString(),
|
||||
// token: widget.token,
|
||||
// workHistory: newWorkHistory));
|
||||
// }
|
||||
selectedStatus ??= AppoinemtStatus(
|
||||
value: state.workHistory.statusAppointment!,
|
||||
label: state.workHistory.statusAppointment!);
|
||||
WorkHistory newWorkHistory = WorkHistory(
|
||||
accomplishment: accomplishments == null?null: [Accomplishment(id: state.workHistory.accomplishment!.first.id, workExperienceId: state.workHistory.id, accomplishment: accomplishments)],
|
||||
actualDuties: duties == null? null: [ActualDuty(id: state.workHistory.actualDuties!.first.id, workExperienceId: state.workHistory.id, description: duties!)],
|
||||
agencydepid: state.workHistory.agency!.id,
|
||||
supervisor: Supervisor(agencyId: state.workHistory.agencydepid,id: state.workHistory.supervisor!.id,firstname: sFname,middlename: sMname,lastname: sLname,stationName: sOffice),
|
||||
id: state.workHistory.id,
|
||||
position: selectedPosition,
|
||||
agency: selectedAgency,
|
||||
fromDate: fromDateController.text.isEmpty
|
||||
? null
|
||||
: DateTime.parse(fromDateController.text),
|
||||
toDate: toDateController.text.isEmpty ||
|
||||
toDateController.text.toUpperCase() ==
|
||||
"PRESENT" ||
|
||||
toDateController.text.toLowerCase() ==
|
||||
'null'
|
||||
? null
|
||||
: DateTime.parse(toDateController.text),
|
||||
monthlysalary: double.parse(salary!),
|
||||
statusAppointment: selectedStatus!.value,
|
||||
salarygrade: salaryGrade == null
|
||||
? null
|
||||
: int.parse(salaryGrade!),
|
||||
sgstep: salaryGradeStep == null
|
||||
? null
|
||||
: int.parse(salaryGradeStep!),
|
||||
);
|
||||
context.read<WorkHistoryBloc>().add(
|
||||
UpdateWorkHistory(
|
||||
|
||||
isPrivate: state.workHistory.agency!.privateEntity!,
|
||||
profileId: widget.profileId,
|
||||
token: widget.token,
|
||||
workHistory: newWorkHistory));
|
||||
}
|
||||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
|
|
|
@ -322,20 +322,20 @@ class WorkHistoryScreen extends StatelessWidget {
|
|||
}
|
||||
if (value == 1) {
|
||||
////edit eligibilty-= = = = = = = = =>>
|
||||
final progress =
|
||||
ProgressHUD.of(
|
||||
context);
|
||||
progress!.showWithText(
|
||||
"Loading...");
|
||||
WorkHistory workHistory =
|
||||
state.workExperiences[
|
||||
index];
|
||||
context
|
||||
.read<
|
||||
WorkHistoryBloc>()
|
||||
.add(ShowEditWorkHistoryForm(
|
||||
workHistory:
|
||||
workHistory));
|
||||
// final progress =
|
||||
// ProgressHUD.of(
|
||||
// context);
|
||||
// progress!.showWithText(
|
||||
// "Loading...");
|
||||
// WorkHistory workHistory =
|
||||
// state.workExperiences[
|
||||
// index];
|
||||
// context
|
||||
// .read<
|
||||
// WorkHistoryBloc>()
|
||||
// .add(ShowEditWorkHistoryForm(
|
||||
// workHistory:
|
||||
// workHistory));
|
||||
}
|
||||
////Attachment
|
||||
if (value == 3) {
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
import '../../../utils/urls.dart';
|
||||
|
||||
class ImageAttachment extends StatefulWidget {
|
||||
final String imgUrl;
|
||||
const ImageAttachment({super.key, required this.imgUrl});
|
||||
|
||||
@override
|
||||
State<ImageAttachment> createState() => _ImageAttachmentState();
|
||||
}
|
||||
|
||||
class _ImageAttachmentState extends State<ImageAttachment> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool isPDF = widget.imgUrl[widget.imgUrl.length - 1] == 'f' ? true : false;
|
||||
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text("Attachment"),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(onPressed: () {}, icon: const Icon(Icons.share)),
|
||||
],
|
||||
),
|
||||
body: isPDF
|
||||
? SfPdfViewer.network(
|
||||
'${Url.instance.prefixHost()}://${Url.instance.host()}${widget.imgUrl}',onDocumentLoadFailed: (details) {
|
||||
Center(child: Text(details.description),);
|
||||
},)
|
||||
: Center(
|
||||
child: CachedNetworkImage(
|
||||
progressIndicatorBuilder: (context, url, progress) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: CircularProgressIndicator(color: primary,));
|
||||
},
|
||||
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider, fit: BoxFit.fill)),
|
||||
),
|
||||
imageUrl:
|
||||
'${Url.instance.prefixHost()}://${Url.instance.host()}${widget.imgUrl}',
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -68,7 +68,7 @@ class EducationService {
|
|||
try {
|
||||
http.Response response = await Request.instance
|
||||
.postRequest(path: path, param: {}, body: body, headers: headers);
|
||||
if (response.statusCode == 2011) {
|
||||
if (response.statusCode == 201) {
|
||||
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 == 2001) {
|
||||
if (response.statusCode == 200) {
|
||||
Map data = jsonDecode(response.body);
|
||||
success = data['success'];
|
||||
} else {
|
||||
|
|
|
@ -21,7 +21,7 @@ class ProfileOtherInfoServices{
|
|||
try {
|
||||
http.Response response = await Request.instance
|
||||
.getRequest(path: path, headers: headers, param: {});
|
||||
if (response.statusCode == 20012) {
|
||||
if (response.statusCode == 200) {
|
||||
Map data = jsonDecode(response.body);
|
||||
if (data['data'] != null) {
|
||||
data['data'].forEach((var e) {
|
||||
|
|
|
@ -40,7 +40,6 @@ class WorkHistoryService {
|
|||
return workExperiences;
|
||||
}
|
||||
|
||||
|
||||
////delete workhistory
|
||||
Future<bool> delete(
|
||||
{required int profileId,
|
||||
|
@ -69,10 +68,10 @@ class WorkHistoryService {
|
|||
http.Response response = await Request.instance.deleteRequest(
|
||||
path: path, headers: headers, body: body, param: params);
|
||||
|
||||
if(response.statusCode == 200){
|
||||
if (response.statusCode == 200) {
|
||||
Map data = jsonDecode(response.body);
|
||||
success = data['success'];
|
||||
}else{
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -81,7 +80,6 @@ class WorkHistoryService {
|
|||
return success!;
|
||||
}
|
||||
|
||||
|
||||
////edit work history
|
||||
// Future<Map<dynamic,dynamic>> update({required WorkHistory oldWorkHistory, required WorkHistory newWorkHistory, required String token, required String profileId})async{
|
||||
// Map<dynamic, dynamic>? statusResponse={};
|
||||
|
@ -108,8 +106,7 @@ class WorkHistoryService {
|
|||
// "oldPosId":oldWorkHistory.position!.id,
|
||||
// "_oldAgencyId":oldWorkHistory.agency!.id,
|
||||
// "oldFromDate":oldWorkHistory.fromDate?.toString(),
|
||||
// };
|
||||
|
||||
// };
|
||||
|
||||
// try{
|
||||
// http.Response response = await Request.instance.putRequest(path: path, headers: headers, body: body, param: {});
|
||||
|
@ -125,74 +122,129 @@ class WorkHistoryService {
|
|||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
////Add work history
|
||||
Future<Map<dynamic, dynamic>>add({required WorkHistory workHistory, required String token, required int profileId , required bool isPrivate,required String? accomplishment, required String? actualDuties})async{
|
||||
String authtoken = "Token $token";
|
||||
Future<Map<dynamic, dynamic>> add(
|
||||
{required WorkHistory workHistory,
|
||||
required String token,
|
||||
required int profileId,
|
||||
required bool isPrivate,
|
||||
required String? accomplishment,
|
||||
required String? actualDuties}) async {
|
||||
String authtoken = "Token $token";
|
||||
String path = '${Url.instance.workhistory()}$profileId/';
|
||||
Map<String, String> headers = {
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': authtoken
|
||||
};
|
||||
Map<String,String> body = {};
|
||||
Map<dynamic,dynamic> statusResponse = {};
|
||||
String fromDate = DateFormat('yyyy-MM-dd').format(workHistory.fromDate!);
|
||||
String? toDate;
|
||||
if(workHistory.toDate != null){
|
||||
toDate = DateFormat('yyyy-MM-dd').format(workHistory.toDate!);
|
||||
}
|
||||
if(workHistory.toDate == null){
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null? "":workHistory.agency!.category!.id.toString(),
|
||||
"a_name" : workHistory.agency?.name == null? "":workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null?"":workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment" : accomplishment??"",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id" : workHistory.agency?.id == null?"": workHistory.agency!.id.toString() ,
|
||||
"from_date" : fromDate,
|
||||
"monthly_salary" : workHistory.monthlysalary == null? "": workHistory.monthlysalary.toString(),
|
||||
"position_id" : workHistory.position?.id == null? "": workHistory.position!.id.toString(),
|
||||
"position_name" : workHistory.position?.title == null? "":workHistory.position!.title!,
|
||||
"s_fname" : workHistory.supervisor?.firstname == null?"":workHistory.supervisor!.firstname!,
|
||||
"s_lname" : workHistory.supervisor?.lastname == null? "":workHistory.supervisor!.lastname!,
|
||||
"s_mname" : workHistory.supervisor?.middlename == null?"":workHistory.supervisor!.middlename!,
|
||||
"s_office" : workHistory.supervisor?.stationName == null?"":workHistory.supervisor!.stationName!,
|
||||
"salary_grade" : workHistory.salarygrade == null? "":workHistory.salarygrade.toString(),
|
||||
"sg_step" : workHistory.sgstep == null?"":workHistory.sgstep.toString() ,
|
||||
'status_appointment' : workHistory.statusAppointment??"",
|
||||
};
|
||||
}else{
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null? "":workHistory.agency!.category!.id.toString(),
|
||||
"a_name" : workHistory.agency?.name == null? "":workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null?"":workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment" : accomplishment??"",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id" : workHistory.agency?.id == null?"": workHistory.agency!.id.toString() ,
|
||||
"from_date" : workHistory.fromDate == null? "2018-10-04":"2018-06-04",
|
||||
"monthly_salary" : workHistory.monthlysalary == null? "": workHistory.monthlysalary.toString(),
|
||||
"position_id" : workHistory.position?.id == null? "": workHistory.position!.id.toString(),
|
||||
"position_name" : workHistory.position?.title == null? "":workHistory.position!.title!,
|
||||
"s_fname" : workHistory.supervisor?.firstname == null?"":workHistory.supervisor!.firstname!,
|
||||
"s_lname" : workHistory.supervisor?.lastname == null? "":workHistory.supervisor!.lastname!,
|
||||
"s_mname" : workHistory.supervisor?.middlename == null?"":workHistory.supervisor!.middlename!,
|
||||
"s_office" : workHistory.supervisor?.stationName == null?"":workHistory.supervisor!.stationName!,
|
||||
"salary_grade" : workHistory.salarygrade == null? "":workHistory.salarygrade.toString(),
|
||||
"sg_step" : workHistory.sgstep == null?"":workHistory.sgstep.toString() ,
|
||||
'status_appointment' : workHistory.statusAppointment??"",
|
||||
"to_date" : toDate!,
|
||||
};
|
||||
Map<String, String> body = {};
|
||||
Map<dynamic, dynamic> statusResponse = {};
|
||||
String fromDate = DateFormat('yyyy-MM-dd').format(workHistory.fromDate!);
|
||||
String? toDate = workHistory.toDate == null
|
||||
? null
|
||||
: DateFormat('yyyy-MM-dd').format(workHistory.toDate!);
|
||||
|
||||
if (workHistory.toDate == null) {
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null
|
||||
? ""
|
||||
: workHistory.agency!.category!.id.toString(),
|
||||
"a_name":
|
||||
workHistory.agency?.name == null ? "" : workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null
|
||||
? ""
|
||||
: workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment": accomplishment ?? "",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id": workHistory.agency?.id == null
|
||||
? ""
|
||||
: workHistory.agency!.id.toString(),
|
||||
"from_date": fromDate,
|
||||
"monthly_salary": workHistory.monthlysalary == null
|
||||
? ""
|
||||
: workHistory.monthlysalary.toString(),
|
||||
"position_id": workHistory.position?.id == null
|
||||
? ""
|
||||
: workHistory.position!.id.toString(),
|
||||
"position_name": workHistory.position?.title == null
|
||||
? ""
|
||||
: workHistory.position!.title!,
|
||||
"s_fname": workHistory.supervisor?.firstname == null
|
||||
? ""
|
||||
: workHistory.supervisor!.firstname!,
|
||||
"s_lname": workHistory.supervisor?.lastname == null
|
||||
? ""
|
||||
: workHistory.supervisor!.lastname!,
|
||||
"s_mname": workHistory.supervisor?.middlename == null
|
||||
? ""
|
||||
: workHistory.supervisor!.middlename!,
|
||||
"s_office": workHistory.supervisor?.stationName == null
|
||||
? ""
|
||||
: workHistory.supervisor!.stationName!,
|
||||
"salary_grade": workHistory.salarygrade == null
|
||||
? ""
|
||||
: workHistory.salarygrade.toString(),
|
||||
"sg_step":
|
||||
workHistory.sgstep == null ? "" : workHistory.sgstep.toString(),
|
||||
'status_appointment': workHistory.statusAppointment ?? "",
|
||||
};
|
||||
} else {
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null
|
||||
? ""
|
||||
: workHistory.agency!.category!.id.toString(),
|
||||
"a_name":
|
||||
workHistory.agency?.name == null ? "" : workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null
|
||||
? ""
|
||||
: workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment": accomplishment ?? "",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id": workHistory.agency?.id == null
|
||||
? ""
|
||||
: workHistory.agency!.id.toString(),
|
||||
"from_date": fromDate,
|
||||
"monthly_salary": workHistory.monthlysalary == null
|
||||
? ""
|
||||
: workHistory.monthlysalary.toString(),
|
||||
"position_id": workHistory.position?.id == null
|
||||
? ""
|
||||
: workHistory.position!.id.toString(),
|
||||
"position_name": workHistory.position?.title == null
|
||||
? ""
|
||||
: workHistory.position!.title!,
|
||||
"s_fname": workHistory.supervisor?.firstname == null
|
||||
? ""
|
||||
: workHistory.supervisor!.firstname!,
|
||||
"s_lname": workHistory.supervisor?.lastname == null
|
||||
? ""
|
||||
: workHistory.supervisor!.lastname!,
|
||||
"s_mname": workHistory.supervisor?.middlename == null
|
||||
? ""
|
||||
: workHistory.supervisor!.middlename!,
|
||||
"s_office": workHistory.supervisor?.stationName == null
|
||||
? ""
|
||||
: workHistory.supervisor!.stationName!,
|
||||
"salary_grade": workHistory.salarygrade == null
|
||||
? ""
|
||||
: workHistory.salarygrade.toString(),
|
||||
"sg_step":
|
||||
workHistory.sgstep == null ? "" : workHistory.sgstep.toString(),
|
||||
'status_appointment': workHistory.statusAppointment ?? "",
|
||||
"to_date": toDate!,
|
||||
};
|
||||
}
|
||||
|
||||
var request = http.MultipartRequest('POST',Uri.parse('${Url.instance.prefixHost()}://${Url.instance.host()}$path'));
|
||||
request.fields.addAll(body);
|
||||
request.headers.addAll(headers);
|
||||
|
||||
var request = http.MultipartRequest(
|
||||
'POST',
|
||||
Uri.parse(
|
||||
'${Url.instance.prefixHost()}://${Url.instance.host()}$path'));
|
||||
request.fields.addAll(body);
|
||||
request.headers.addAll(headers);
|
||||
try {
|
||||
http.StreamedResponse response = await request.send();
|
||||
final steamResponse = await response.stream.bytesToString();
|
||||
final steamResponse = await response.stream.bytesToString();
|
||||
Map data = jsonDecode(steamResponse);
|
||||
if (response.statusCode == 201) {
|
||||
if (response.statusCode == 201) {
|
||||
statusResponse = data;
|
||||
} else {
|
||||
String message = data['response']['details'];
|
||||
|
@ -204,91 +256,151 @@ class WorkHistoryService {
|
|||
} catch (e) {
|
||||
throw e.toString();
|
||||
}
|
||||
return statusResponse;
|
||||
return statusResponse;
|
||||
}
|
||||
|
||||
Future<Map<dynamic, dynamic>>update({required WorkHistory workHistory, required String token, required int profileId , required bool isPrivate,required String? accomplishment, required String? actualDuties})async{
|
||||
String authtoken = "Token $token";
|
||||
Future<Map<dynamic, dynamic>> update(
|
||||
{required WorkHistory workHistory,
|
||||
required String token,
|
||||
required int profileId,
|
||||
required bool isPrivate}) async {
|
||||
String authtoken = "Token $token";
|
||||
String path = '${Url.instance.workhistory()}$profileId/';
|
||||
Map<String, String> headers = {
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': authtoken
|
||||
};
|
||||
Map<String,String> body = {};
|
||||
Map<dynamic,dynamic> statusResponse = {};
|
||||
String fromDate = DateFormat('yyyy-MM-dd').format(workHistory.fromDate!);
|
||||
String? toDate;
|
||||
if(workHistory.toDate != null){
|
||||
toDate = DateFormat('yyyy-MM-dd').format(workHistory.toDate!);
|
||||
}
|
||||
if(workHistory.toDate == null){
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null? "":workHistory.agency!.category!.id.toString(),
|
||||
"a_name" : workHistory.agency?.name == null? "":workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null?"":workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment" : accomplishment??"",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id" : workHistory.agency?.id == null?"": workHistory.agency!.id.toString() ,
|
||||
"from_date" : fromDate,
|
||||
"monthly_salary" : workHistory.monthlysalary == null? "": workHistory.monthlysalary.toString(),
|
||||
"position_id" : workHistory.position?.id == null? "": workHistory.position!.id.toString(),
|
||||
"position_name" : workHistory.position?.title == null? "":workHistory.position!.title!,
|
||||
"s_fname" : workHistory.supervisor?.firstname == null?"":workHistory.supervisor!.firstname!,
|
||||
"s_lname" : workHistory.supervisor?.lastname == null? "":workHistory.supervisor!.lastname!,
|
||||
"s_mname" : workHistory.supervisor?.middlename == null?"":workHistory.supervisor!.middlename!,
|
||||
"s_office" : workHistory.supervisor?.stationName == null?"":workHistory.supervisor!.stationName!,
|
||||
"salary_grade" : workHistory.salarygrade == null? "":workHistory.salarygrade.toString(),
|
||||
"sg_step" : workHistory.sgstep == null?"":workHistory.sgstep.toString() ,
|
||||
'status_appointment' : workHistory.statusAppointment??"",
|
||||
};
|
||||
}else{
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null? "":workHistory.agency!.category!.id.toString(),
|
||||
"a_name" : workHistory.agency?.name == null? "":workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null?"":workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment" : accomplishment??"",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id" : workHistory.agency?.id == null?"": workHistory.agency!.id.toString() ,
|
||||
"from_date" : workHistory.fromDate == null? "2018-10-04":"2018-06-04",
|
||||
"monthly_salary" : workHistory.monthlysalary == null? "": workHistory.monthlysalary.toString(),
|
||||
"position_id" : workHistory.position?.id == null? "": workHistory.position!.id.toString(),
|
||||
"position_name" : workHistory.position?.title == null? "":workHistory.position!.title!,
|
||||
"s_fname" : workHistory.supervisor?.firstname == null?"":workHistory.supervisor!.firstname!,
|
||||
"s_lname" : workHistory.supervisor?.lastname == null? "":workHistory.supervisor!.lastname!,
|
||||
"s_mname" : workHistory.supervisor?.middlename == null?"":workHistory.supervisor!.middlename!,
|
||||
"s_office" : workHistory.supervisor?.stationName == null?"":workHistory.supervisor!.stationName!,
|
||||
"salary_grade" : workHistory.salarygrade == null? "":workHistory.salarygrade.toString(),
|
||||
"sg_step" : workHistory.sgstep == null?"":workHistory.sgstep.toString() ,
|
||||
'status_appointment' : workHistory.statusAppointment??"",
|
||||
"to_date" : toDate!,
|
||||
};
|
||||
|
||||
Map<String, String> body = {};
|
||||
Map<dynamic, dynamic> statusResponse = {};
|
||||
String fromDate = DateFormat('yyyy-MM-dd').format(workHistory.fromDate!);
|
||||
String? toDate = workHistory.toDate == null
|
||||
? null
|
||||
: DateFormat('yyyy-MM-dd').format(workHistory.toDate!);
|
||||
if (workHistory.toDate == null) {
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null
|
||||
? ""
|
||||
: workHistory.agency!.category!.id.toString(),
|
||||
"a_name":
|
||||
workHistory.agency?.name == null ? "" : workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null
|
||||
? ""
|
||||
: workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment": workHistory.accomplishment == null
|
||||
? ""
|
||||
: workHistory.accomplishment!.first.accomplishment!,
|
||||
"actual_duties ": workHistory.actualDuties == null
|
||||
? ""
|
||||
: workHistory.actualDuties!.first.description,
|
||||
"agency_id": workHistory.agency?.id == null
|
||||
? ""
|
||||
: workHistory.agency!.id.toString(),
|
||||
"from_date": fromDate,
|
||||
"monthly_salary": workHistory.monthlysalary == null
|
||||
? ""
|
||||
: workHistory.monthlysalary.toString(),
|
||||
"position_id": workHistory.position?.id == null
|
||||
? ""
|
||||
: workHistory.position!.id.toString(),
|
||||
"position_name": workHistory.position?.title == null
|
||||
? ""
|
||||
: workHistory.position!.title!,
|
||||
"s_fname": workHistory.supervisor?.firstname == null
|
||||
? ""
|
||||
: workHistory.supervisor!.firstname!,
|
||||
"s_lname": workHistory.supervisor?.lastname == null
|
||||
? ""
|
||||
: workHistory.supervisor!.lastname!,
|
||||
"s_mname": workHistory.supervisor?.middlename == null
|
||||
? ""
|
||||
: workHistory.supervisor!.middlename!,
|
||||
"s_office": workHistory.supervisor?.stationName == null
|
||||
? ""
|
||||
: workHistory.supervisor!.stationName!,
|
||||
"salary_grade": workHistory.salarygrade == null
|
||||
? ""
|
||||
: workHistory.salarygrade.toString(),
|
||||
"sg_step":
|
||||
workHistory.sgstep == null ? "" : workHistory.sgstep.toString(),
|
||||
'status_appointment': workHistory.statusAppointment ?? "",
|
||||
};
|
||||
} else {
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null
|
||||
? ""
|
||||
: workHistory.agency!.category!.id.toString(),
|
||||
"a_name":
|
||||
workHistory.agency?.name == null ? "" : workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null
|
||||
? ""
|
||||
: workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment": workHistory.accomplishment == null
|
||||
? ""
|
||||
: workHistory.accomplishment!.first.accomplishment!,
|
||||
"actual_duties ": workHistory.actualDuties == null
|
||||
? ""
|
||||
: workHistory.actualDuties!.first.description,
|
||||
"agency_id": workHistory.agency?.id == null
|
||||
? ""
|
||||
: workHistory.agency!.id.toString(),
|
||||
"from_date": fromDate,
|
||||
"monthly_salary": workHistory.monthlysalary == null
|
||||
? ""
|
||||
: workHistory.monthlysalary.toString(),
|
||||
"position_id": workHistory.position?.id == null
|
||||
? ""
|
||||
: workHistory.position!.id.toString(),
|
||||
"position_name": workHistory.position?.title == null
|
||||
? ""
|
||||
: workHistory.position!.title!,
|
||||
"s_fname": workHistory.supervisor?.firstname == null
|
||||
? ""
|
||||
: workHistory.supervisor!.firstname!,
|
||||
"s_lname": workHistory.supervisor?.lastname == null
|
||||
? ""
|
||||
: workHistory.supervisor!.lastname!,
|
||||
"s_mname": workHistory.supervisor?.middlename == null
|
||||
? ""
|
||||
: workHistory.supervisor!.middlename!,
|
||||
"s_office": workHistory.supervisor?.stationName == null
|
||||
? ""
|
||||
: workHistory.supervisor!.stationName!,
|
||||
"salary_grade": workHistory.salarygrade == null
|
||||
? ""
|
||||
: workHistory.salarygrade.toString(),
|
||||
"sg_step":
|
||||
workHistory.sgstep == null ? "" : workHistory.sgstep.toString(),
|
||||
'status_appointment': workHistory.statusAppointment ?? "",
|
||||
"to_date": toDate!,
|
||||
};
|
||||
}
|
||||
|
||||
var request = http.MultipartRequest('PUT',Uri.parse('${Url.instance.prefixHost()}://${Url.instance.host()}$path'));
|
||||
request.fields.addAll(body);
|
||||
request.headers.addAll(headers);
|
||||
try {
|
||||
http.StreamedResponse response = await request.send();
|
||||
final steamResponse = await response.stream.bytesToString();
|
||||
Map data = jsonDecode(steamResponse);
|
||||
if (response.statusCode == 201) {
|
||||
statusResponse = data;
|
||||
} else {
|
||||
String message = data['response']['details'];
|
||||
statusResponse.addAll({'message': message});
|
||||
statusResponse.addAll(
|
||||
{'success': false},
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
throw e.toString();
|
||||
|
||||
var request = http.MultipartRequest(
|
||||
'PUT',
|
||||
Uri.parse(
|
||||
'${Url.instance.prefixHost()}://${Url.instance.host()}$path'));
|
||||
request.fields.addAll(body);
|
||||
request.headers.addAll(headers);
|
||||
// try {
|
||||
http.StreamedResponse response = await request.send();
|
||||
final steamResponse = await response.stream.bytesToString();
|
||||
Map data = jsonDecode(steamResponse);
|
||||
if (response.statusCode == 201) {
|
||||
statusResponse = data;
|
||||
} else {
|
||||
String message = data['response']['details'];
|
||||
statusResponse.addAll({'message': message});
|
||||
statusResponse.addAll(
|
||||
{'success': false},
|
||||
);
|
||||
}
|
||||
return statusResponse;
|
||||
// } catch (e) {
|
||||
// throw e.toString();
|
||||
// }
|
||||
return statusResponse;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////get agency position
|
||||
Future<List<PositionTitle>> getAgencyPosition() async {
|
||||
List<PositionTitle> agencyPositions = [];
|
||||
|
@ -324,7 +436,7 @@ return statusResponse;
|
|||
AppoinemtStatus(value: "Coterminous", label: "Coterminous"),
|
||||
AppoinemtStatus(value: "Elected", label: "Elected"),
|
||||
AppoinemtStatus(value: "Job Order", label: "Job Order"),
|
||||
AppoinemtStatus(value: "Permanent", label: "Permanent"),
|
||||
AppoinemtStatus(value: "Permanent", label: "Permanent"),
|
||||
AppoinemtStatus(value: "Elected", label: "Elected"),
|
||||
];
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
|
||||
|
||||
Future<void> launchInBrowser(String url) async {
|
||||
final UrlLauncherPlatform launcher = UrlLauncherPlatform.instance;
|
||||
if (!await launcher.launch(
|
||||
url,
|
||||
useSafariVC: false,
|
||||
useWebView: false,
|
||||
enableJavaScript: false,
|
||||
enableDomStorage: false,
|
||||
universalLinksOnly: false,
|
||||
headers: <String, String>{},
|
||||
)) {
|
||||
throw Exception('Could not launch $url');
|
||||
}
|
||||
}
|
|
@ -5,6 +5,8 @@ PODS:
|
|||
- FlutterMacOS
|
||||
- audioplayers_darwin (0.0.1):
|
||||
- FlutterMacOS
|
||||
- device_info_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- FlutterMacOS (1.0.0)
|
||||
- FMDB (2.7.5):
|
||||
- FMDB/standard (= 2.7.5)
|
||||
|
@ -24,17 +26,24 @@ PODS:
|
|||
- FlutterMacOS
|
||||
- rive_common (0.0.1):
|
||||
- FlutterMacOS
|
||||
- share_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqflite (0.0.2):
|
||||
- FlutterMacOS
|
||||
- FMDB (>= 2.7.5)
|
||||
- syncfusion_pdfviewer_macos (0.0.1):
|
||||
- FlutterMacOS
|
||||
- url_launcher_macos (0.0.1):
|
||||
- FlutterMacOS
|
||||
|
||||
DEPENDENCIES:
|
||||
- assets_audio_player (from `Flutter/ephemeral/.symlinks/plugins/assets_audio_player/macos`)
|
||||
- assets_audio_player_web (from `Flutter/ephemeral/.symlinks/plugins/assets_audio_player_web/macos`)
|
||||
- audioplayers_darwin (from `Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos`)
|
||||
- device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
|
||||
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||
- location (from `Flutter/ephemeral/.symlinks/plugins/location/macos`)
|
||||
- modal_progress_hud_nsn (from `Flutter/ephemeral/.symlinks/plugins/modal_progress_hud_nsn/macos`)
|
||||
|
@ -43,8 +52,11 @@ DEPENDENCIES:
|
|||
- platform_device_id (from `Flutter/ephemeral/.symlinks/plugins/platform_device_id/macos`)
|
||||
- platform_device_id_macos (from `Flutter/ephemeral/.symlinks/plugins/platform_device_id_macos/macos`)
|
||||
- rive_common (from `Flutter/ephemeral/.symlinks/plugins/rive_common/macos`)
|
||||
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
|
||||
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos`)
|
||||
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`)
|
||||
- syncfusion_pdfviewer_macos (from `Flutter/ephemeral/.symlinks/plugins/syncfusion_pdfviewer_macos/macos`)
|
||||
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
|
@ -57,6 +69,8 @@ EXTERNAL SOURCES:
|
|||
:path: Flutter/ephemeral/.symlinks/plugins/assets_audio_player_web/macos
|
||||
audioplayers_darwin:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos
|
||||
device_info_plus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos
|
||||
FlutterMacOS:
|
||||
:path: Flutter/ephemeral
|
||||
location:
|
||||
|
@ -73,15 +87,22 @@ EXTERNAL SOURCES:
|
|||
:path: Flutter/ephemeral/.symlinks/plugins/platform_device_id_macos/macos
|
||||
rive_common:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/rive_common/macos
|
||||
share_plus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
|
||||
shared_preferences_foundation:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos
|
||||
sqflite:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos
|
||||
syncfusion_pdfviewer_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/syncfusion_pdfviewer_macos/macos
|
||||
url_launcher_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
assets_audio_player: be2578e6f11dd4d183412e97143673c3c4cb2e8a
|
||||
assets_audio_player_web: 917101123b6db8f73156835c0fa266c11340ff15
|
||||
audioplayers_darwin: dcad41de4fbd0099cb3749f7ab3b0cb8f70b810c
|
||||
device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f
|
||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
location: 7cdb0665bd6577d382b0a343acdadbcb7f964775
|
||||
|
@ -91,8 +112,11 @@ SPEC CHECKSUMS:
|
|||
platform_device_id: 3e414428f45df149bbbfb623e2c0ca27c545b763
|
||||
platform_device_id_macos: f763bb55f088be804d61b96eb4710b8ab6598e94
|
||||
rive_common: fab8476ce8352bf54152a913f393a8696d3dc98c
|
||||
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7
|
||||
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
|
||||
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea
|
||||
syncfusion_pdfviewer_macos: e9194851581cad04b28b53913d0636d39a4ed4b2
|
||||
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
|
||||
|
||||
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
|
||||
|
||||
|
|
Loading…
Reference in New Issue