fix bugs for profile and final test in live

feature/passo/PASSO-#1-Sync-data-from-device-to-postgre-and-vice-versa
PGAN-MIS 2023-08-30 09:55:03 +08:00
parent e7d6cb8133
commit 4a5d6afcbc
56 changed files with 8515 additions and 8279 deletions

View File

@ -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));
}

View File

@ -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()));
}
});
}
}

View File

@ -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});
}

View File

@ -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,});
}

View File

@ -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()));
}
});
}

View File

@ -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});
}

View File

@ -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,});
}

View File

@ -46,7 +46,7 @@ class ContactBloc extends Bloc<ContactEvent, ContactState> {
ServiceType serviceType;
List<CommService> commServiceProvivers;
CommService serviceProvider;
try{
try {
if (serviceTypes.isEmpty) {
serviceTypes = await ProfileUtilities.instance.getServiceType();
}
@ -55,7 +55,8 @@ class ContactBloc extends Bloc<ContactEvent, ContactState> {
});
commServiceProvivers = await ContactService.instance
.getServiceProvider(serviceTypeId: serviceType.id!);
serviceProvider = commServiceProvivers.firstWhere((CommService element) =>
serviceProvider = commServiceProvivers.firstWhere(
(CommService element) =>
element.id == event.contactInfo.commService!.id);
emit(ContactEditingState(
serviceTypes: serviceTypes,
@ -63,7 +64,7 @@ class ContactBloc extends Bloc<ContactEvent, ContactState> {
commServiceProviders: commServiceProvivers,
selectedProvider: serviceProvider,
contactInfo: event.contactInfo));
}catch(e){
} 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()));

View File

@ -8,7 +8,7 @@ abstract class ContactEvent extends Equatable {
}
////get contacts
class GetContacts extends ContactEvent{
class GetContacts extends ContactEvent {
final List<ContactInfo> contactInformations;
const GetContacts({required this.contactInformations});
@override
@ -16,55 +16,63 @@ class GetContacts extends ContactEvent{
}
//// load contacts
class LoadContacts extends ContactEvent{
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
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});
const AddContactInformation(
{required this.contactInfo,
required this.profileId,
required this.token});
@override
List<Object> get props => [profileId,token,contactInfo];
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});
const EditContactInformation(
{required this.contactInfo,
required this.profileId,
required this.token});
@override
List<Object> get props => [profileId,token,contactInfo];
List<Object> get props => [profileId, token, contactInfo];
}
//// delete event
class DeleteContactInformation extends ContactEvent{
class DeleteContactInformation extends ContactEvent {
final int profileId;
final String token;
final ContactInfo contactInfo;
const DeleteContactInformation({required this.contactInfo, required this.profileId, required this.token});
const DeleteContactInformation(
{required this.contactInfo,
required this.profileId,
required this.token});
@override
List<Object> get props => [profileId,token,contactInfo];
List<Object> get props => [profileId, token, contactInfo];
}

View File

@ -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 {

View File

@ -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,];
}

View File

@ -77,12 +77,8 @@ class _AddAddressScreenState extends State<AddAddressScreen> {
const EdgeInsets.symmetric(vertical: 32, horizontal: 24),
child: SizedBox(
height: screenHeight * 88,
child: Column(
children: [
Flexible(
child: ListView(
children: [
//// category
FormBuilderDropdown(
validator: FormBuilderValidators.required(
errorText: "This field is required"),
@ -414,10 +410,7 @@ class _AddAddressScreenState extends State<AddAddressScreen> {
],
);
}),
////sumit button
],
),
),
const SizedBox(height: 24,),
SizedBox(
width: double.infinity,
height: 60,
@ -464,12 +457,13 @@ class _AddAddressScreenState extends State<AddAddressScreen> {
},
child: const Text(submit)),
),
],
),
),
));
}
return Placeholder();
return const Placeholder();
},
);
}

View File

@ -106,9 +106,6 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
vertical: 32, horizontal: 24),
child: SizedBox(
height: screenHeight * 88,
child: Column(
children: [
Flexible(
child: ListView(
children: [
//// category
@ -583,11 +580,7 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
],
);
}),
],
),
),
const SizedBox(height: 8,),
SizedBox(
width: double.infinity,
height: 60,
@ -651,7 +644,7 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
),
));
}
return Placeholder();
return const Placeholder();
},
);
}

View File

@ -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,

View File

@ -50,18 +50,12 @@ 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(
return ListView(
children: [
Flexible(
child: ListView(
children: [
////Service Type
FormBuilderDropdown<ServiceType>(
validator: FormBuilderValidators.required(
@ -83,10 +77,17 @@ class _AddContactInformationScreenState
numberMailController.text = "";
});
try {
commServiceProviders = await ContactService
.instance
.getServiceProvider(
serviceTypeId: selectedServiceType!.id!);
serviceTypeId:
selectedServiceType!.id!);
} catch (e) {
context
.read<ContactBloc>()
.add(CallErrorEvent(message: e.toString()));
}
setState(() {
setState(() {
callServiceType = false;
@ -215,11 +216,8 @@ class _AddContactInformationScreenState
name: 'overseas',
title: Text(active ? "YES" : "NO"),
),
],
),
const SizedBox(
height: 24,
),
SizedBox(
height: 60,
@ -251,9 +249,7 @@ class _AddContactInformationScreenState
child: const Text(submit),
),
),
],
),
);
})),
);

View File

@ -35,7 +35,6 @@ class _EditContactInformationScreenState
bool? primaryaContact;
bool? active;
var mobileFormatter = MaskTextInputFormatter(
mask: "+63 (###) ###-####",
filter: {"#": RegExp(r"^[1-9][0-9]*$")},
@ -54,6 +53,7 @@ class _EditContactInformationScreenState
numberMailController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BlocBuilder<ContactBloc, ContactState>(
@ -69,9 +69,6 @@ class _EditContactInformationScreenState
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 24),
child: FormBuilder(
key: formKey,
child: Column(
children: [
Flexible(
child: ListView(
children: [
StatefulBuilder(builder: (context, setState) {
@ -99,11 +96,16 @@ class _EditContactInformationScreenState
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(() {
@ -149,7 +151,6 @@ class _EditContactInformationScreenState
? FormBuilderTextField(
controller: numberMailController,
name: 'number-mail',
inputFormatters: [landLineFormatter],
validator: FormBuilderValidators.required(
errorText: "This field is required"),
@ -164,7 +165,6 @@ class _EditContactInformationScreenState
controller: numberMailController,
name: 'number-mail',
inputFormatters: [mobileFormatter],
validator:
FormBuilderValidators.required(
errorText:
@ -178,7 +178,6 @@ class _EditContactInformationScreenState
? FormBuilderTextField(
controller: numberMailController,
name: 'number-mail',
validator:
FormBuilderValidators.required(
errorText:
@ -189,9 +188,9 @@ class _EditContactInformationScreenState
: selectedServiceType!.id == 3
////Email Address
? FormBuilderTextField(
controller: numberMailController,
controller:
numberMailController,
name: 'number-mail',
validator: FormBuilderValidators
.compose([
FormBuilderValidators.email(
@ -245,10 +244,8 @@ class _EditContactInformationScreenState
title: const Text("Active ?"),
);
}),
],
),
const SizedBox(
height: 24,
),
SizedBox(
height: 60,

View File

@ -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")

View File

@ -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),
),

View File

@ -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),
),

View File

@ -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),
),

View File

@ -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),
),

View File

@ -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),
),

View File

@ -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),
),

View File

@ -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),
),

View File

@ -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),
),

View File

@ -146,9 +146,6 @@ class _AddIdentificationScreenState extends State<AddIdentificationScreen> {
key: formKey,
child: SizedBox(
height: screenHeight * 90,
child: Column(
children: [
Flexible(
child: ListView(
children: [
StatefulBuilder(builder: (context, setState) {
@ -826,9 +823,7 @@ class _AddIdentificationScreenState extends State<AddIdentificationScreen> {
],
);
}),
],
),
),
const SizedBox(height: 8,),
SizedBox(
width: double.infinity,
height: 60,
@ -895,9 +890,8 @@ class _AddIdentificationScreenState extends State<AddIdentificationScreen> {
},
child: const Text(submit)),
),
const SizedBox(
height: 24,
),
],
),
)),

View File

@ -87,9 +87,6 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
key: formKey,
child: SizedBox(
height: screenHeight * 90,
child: Column(
children: [
Flexible(
child: ListView(
children: [
FormBuilderTextField(
@ -457,10 +454,7 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
);
}),
],
),
),
const SizedBox(height: 8,),
SizedBox(
width: double.infinity,
height: 60,
@ -522,7 +516,6 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
},
child: const Text(submit)),
),
const SizedBox(height: 24,),
],
),
)),

View File

@ -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"),

View File

@ -88,10 +88,6 @@ class _AddEducationScreenState extends State<AddEducationScreen> {
child: FormBuilder(
key: formKey,
child: SizedBox(
height: blockSizeVertical * 85,
child: Column(
children: [
Flexible(
child: ListView(children: [
//// LEVEL
StatefulBuilder(builder: (context, setState) {
@ -454,12 +450,6 @@ class _AddEducationScreenState extends State<AddEducationScreen> {
),
////sumit button
const SizedBox(
height: 20,
),
]),
),
SizedBox(
width: double.infinity,
height: 60,
@ -521,8 +511,7 @@ class _AddEducationScreenState extends State<AddEducationScreen> {
),
],
),
]),
),
),
);

View File

@ -115,9 +115,6 @@ class _EditEducationScreenState extends State<EditEducationScreen> {
key: formKey,
child: SizedBox(
height: blockSizeVertical * 85,
child: Column(
children: [
Flexible(
child: ListView(children: [
//// LEVEL
@ -462,11 +459,12 @@ class _EditEducationScreenState extends State<EditEducationScreen> {
)
//// HIGHEST UNITS EARNED
: FormBuilderTextField(
initialValue: state.educationalBackground.unitsEarned?.toString(),
validator:
FormBuilderValidators.required(
errorText:
"This fied is required"),
controller: unitsController,
name: "units_earned",
decoration: normalTextFieldStyle(
"Highest Level/Units Earned *",
@ -480,7 +478,6 @@ class _EditEducationScreenState extends State<EditEducationScreen> {
height: 12,
),
//// HONORS
StatefulBuilder(builder: (context, setState) {
return MultiSelectDropDown(
onOptionSelected: (List<ValueItem> selectedOptions) {
@ -508,9 +505,7 @@ class _EditEducationScreenState extends State<EditEducationScreen> {
: [],
);
}),
]),
),
const SizedBox(height: 14,),
////sumit button
SizedBox(
@ -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)),
),
],
),
]),
),
),
);

View File

@ -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');
}
}
}

View File

@ -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"))

View File

@ -71,11 +71,6 @@ 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>(
@ -405,8 +400,7 @@ class _AddEligibilityScreenState extends State<AddEligibilityScreen> {
)),
],
),
]),
),
const SizedBox(height: 24,),
SizedBox(
width: screenWidth,
height: 60,
@ -464,9 +458,7 @@ class _AddEligibilityScreenState extends State<AddEligibilityScreen> {
},
child: const Text(submit)),
),
],
),
),
]),
),
);
}

View File

@ -78,7 +78,7 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
validityDateController.text = state.eligibityCert.validityDate == null
? ''
: state.eligibityCert.validityDate.toString();
DateTime? examDate = DateTime.tryParse(examDateController.text) ;
DateTime? examDate = DateTime.tryParse(examDateController.text);
DateTime? expireDate = DateTime.tryParse(validityDateController.text);
provinces = state.provinces;
citymuns = state.cities;
@ -96,17 +96,13 @@ 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: [
child: ListView(children: [
const SizedBox(
height: 24,
),
////ELIGIBILITIES DROPDOWN
DropdownButtonFormField<Eligibility>(
validator: (value) =>
value == null ? 'required' : null,
validator: (value) => value == null ? 'required' : null,
isExpanded: true,
onChanged: (Eligibility? eligibility) {
selectedEligibility = eligibility;
@ -116,8 +112,7 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
.map<DropdownMenuItem<Eligibility>>(
(Eligibility eligibility) {
return DropdownMenuItem<Eligibility>(
value: eligibility,
child: Text(eligibility.title));
value: eligibility, child: Text(eligibility.title));
}).toList(),
decoration: normalTextFieldStyle("Eligibility", "")),
const SizedBox(
@ -307,41 +302,44 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
children: [
////REGION DROPDOWN
DropdownButtonFormField<Region?>(
validator: (value) => value == null
? 'required'
: null,
validator: (value) =>
value == null ? 'required' : null,
isExpanded: true,
onChanged: (Region? region) async {
setState(() {
provinceCall = true;
});
selectedRegion = region;
try{
try {
provinces = await LocationUtils
.instance
.getProvinces(
regionCode:
selectedRegion!.code
regionCode: selectedRegion!
.code
.toString());
}catch(e){
context.read<EligibilityBloc>().add(CallErrorState());
} catch (e) {
context
.read<EligibilityBloc>()
.add(CallErrorState());
}
selectedProvince = provinces![0];
setState(() {
provinceCall = false;
cityCall = true;
});
try{
try {
citymuns = await LocationUtils
.instance
.getCities(
code: selectedProvince!
.code!);
}catch(e){
NavigationService.navigatorKey.currentContext?.read<EligibilityBloc>().add(CallErrorState());
} catch (e) {
NavigationService
.navigatorKey.currentContext
?.read<EligibilityBloc>()
.add(CallErrorState());
}
selectedMunicipality =
citymuns![0];
selectedMunicipality = citymuns![0];
setState(() {
cityCall = false;
});
@ -351,15 +349,13 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
"Region*", "Region"),
items: regions == null
? []
: regions!.map<
DropdownMenuItem<
Region>>(
: regions!
.map<DropdownMenuItem<Region>>(
(Region region) {
return DropdownMenuItem<
Region>(
return DropdownMenuItem<Region>(
value: region,
child: Text(region
.description!));
child: Text(
region.description!));
}).toList(),
),
const SizedBox(
@ -379,15 +375,13 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
: null,
isExpanded: true,
value: selectedProvince,
onChanged: (Province?
province) async {
onChanged:
(Province? province) async {
setState(() {
cityCall = true;
});
selectedProvince = province;
try{
try {
citymuns = await LocationUtils
.instance
.getCities(
@ -395,8 +389,10 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
selectedProvince!
.code
.toString());
}catch(e){
context.read<EligibilityBloc>().add(CallErrorState());
} catch (e) {
context
.read<EligibilityBloc>()
.add(CallErrorState());
}
selectedMunicipality =
citymuns![0];
@ -417,10 +413,8 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
.description!),
));
}).toList(),
decoration:
normalTextFieldStyle(
"Province*",
"Province")),
decoration: normalTextFieldStyle(
"Province*", "Province")),
),
),
@ -432,8 +426,7 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
inAsyncCall: cityCall,
child: DropdownButtonFormField<
CityMunicipality>(
validator: (value) =>
value == null
validator: (value) => value == null
? 'required'
: null,
isExpanded: true,
@ -441,8 +434,7 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
(CityMunicipality? city) {
selectedMunicipality = city;
},
decoration:
normalTextFieldStyle(
decoration: normalTextFieldStyle(
"Municipality*",
"Municipality"),
value: selectedMunicipality,
@ -454,31 +446,26 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
(CityMunicipality c) {
return DropdownMenuItem(
value: c,
child: Text(c
.description!));
child: Text(
c.description!));
}).toList(),
),
),
),
const SizedBox(
height: 20,
),
],
)),
],
);
}),
const Expanded(
child: SizedBox(),
const SizedBox(
height: 18,
),
SizedBox(
width: screenWidth,
height: 60,
child: ElevatedButton(
style: mainBtnStyle(
primary, Colors.transparent, second),
style:
mainBtnStyle(primary, Colors.transparent, second),
onPressed: () {
ExamAddress examAddress;
////rating
@ -490,13 +477,12 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
CityMunicipality? cityMunicipality =
selectedMunicipality;
////exam date
DateTime? examDate =
examDateController.text.isEmpty
DateTime? examDate = examDateController.text.isEmpty
? null
: DateTime.parse(examDateController.text);
// // validity date
DateTime? validityDate = validityDateController
.text.isEmpty
DateTime? validityDate =
validityDateController.text.isEmpty
? null
: DateTime.parse(validityDateController.text);
//// exam address
@ -504,25 +490,23 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
examAddress = ExamAddress(
barangay: null,
id: state.eligibityCert.examAddress?.id,
addressCategory: state.eligibityCert
.examAddress?.addressCategory,
addressCategory: state
.eligibityCert.examAddress?.addressCategory,
examAddressClass: state.eligibityCert
.examAddress?.examAddressClass,
country: selectedCountry,
cityMunicipality: null);
} else {
examAddress = ExamAddress(
barangay: state
.eligibityCert.examAddress?.barangay,
barangay:
state.eligibityCert.examAddress?.barangay,
id: state.eligibityCert.examAddress?.id,
addressCategory: state.eligibityCert
.examAddress?.addressCategory,
addressCategory: state
.eligibityCert.examAddress?.addressCategory,
examAddressClass: state.eligibityCert
.examAddress?.examAddressClass,
country: Country(
id: 175,
name: 'Philippines',
code: 'PH'),
id: 175, name: 'Philippines', code: 'PH'),
cityMunicipality: cityMunicipality);
}

View File

@ -1,28 +1,32 @@
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!));
onPressed: () async {
await launchInBrowser(fileUrl!);
},
child: const Icon(Icons.file_download),
),
@ -30,33 +34,52 @@ class _EligibilityViewAttachmentState extends State<EligibilityViewAttachment> {
title: const Text("Attachment"),
centerTitle: true,
actions: [
IconButton(onPressed: () {}, icon: const Icon(Icons.share)),
IconButton(
onPressed: () {
context.read<EligibilityBloc>().add(
ShareAttachment(fileName: filename!, source: fileUrl!));
},
icon: const Icon(Icons.share)),
],
),
body: BlocConsumer<EligibilityBloc, EligibilityState>(builder: (context,state){
if(state is EligibilityAttachmentViewState){
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;
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f' ? true : false;
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: 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,));
child: CircularProgressIndicator(
color: primary,
));
},
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider, fit: BoxFit.fill)),
),
imageUrl:
state.fileUrl,
imageUrl: state.fileUrl,
width: double.infinity,
height: 220,
fit: BoxFit.cover,
@ -64,10 +87,27 @@ class _EligibilityViewAttachmentState extends State<EligibilityViewAttachment> {
),
);
}
if (state is EligibilityErrorState) {
return SomethingWentWrong(
message: state.message,
onpressed: () {
Navigator.pop(context);
});
}
return Container();
},listener: (context, state) {
},)
);
},
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();
}
},
),
));
}
}

View File

@ -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(),
))));
},

View File

@ -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,
),

View File

@ -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(),
))));
},

View File

@ -109,15 +109,15 @@ class _AddLearningAndDevelopmentScreenState
DateTime? to;
@override
void dispose() {
fromDateController.dispose();
toDateController.dispose();
addTrainingController.dispose();
addTopicController.dispose();
topicFocusNode.dispose();
// fromDateController.dispose();
// toDateController.dispose();
// addTrainingController.dispose();
// addTopicController.dispose();
// topicFocusNode.dispose();
addSponsorAgencyController.dispose();
sponsorByFocusNode.dispose();
sponsorAgencyCategoryFocusNode.dispose();
// addSponsorAgencyController.dispose();
// sponsorByFocusNode.dispose();
// sponsorAgencyCategoryFocusNode.dispose();
super.dispose();
}
@ -128,15 +128,10 @@ class _AddLearningAndDevelopmentScreenState
if (state is LearningDevelopmentAddingState) {
return FormBuilder(
key: formKey,
child: SizedBox(
height: screenHeight * 90,
child: Padding(
padding: const EdgeInsets.all(24),
child: StatefulBuilder(builder: (context, setState) {
return Column(
children: [
Flexible(
child: ListView(
return ListView(
children: [
////Training SearchField
SizedBox(
@ -490,15 +485,7 @@ class _AddLearningAndDevelopmentScreenState
DateTime(1990),
lastDate:
DateTime(2100),
selectableDayPredicate:
(date) {
if (to != null &&
to!.microsecondsSinceEpoch <=
date.microsecondsSinceEpoch) {
return false;
}
return true;
},
onChanged: (value) {
setState(() {
from = DateTime
@ -543,15 +530,7 @@ class _AddLearningAndDevelopmentScreenState
toDateController,
firstDate:
DateTime(1990),
selectableDayPredicate:
(date) {
if (from != null &&
from!.microsecondsSinceEpoch >=
date.microsecondsSinceEpoch) {
return false;
}
return true;
},
onChanged: (value) {
setState(() {
to = DateTime
@ -1448,9 +1427,7 @@ class _AddLearningAndDevelopmentScreenState
"Total Hours Attended *",
"Total Hours Attended *"),
),
],
),
),
const SizedBox(height: 16,),
SizedBox(
width: double.infinity,
height: 60,
@ -1535,7 +1512,6 @@ class _AddLearningAndDevelopmentScreenState
],
);
}),
),
));
}
return const Center(

View File

@ -185,13 +185,8 @@ class _EditLearningAndDevelopmentScreenState
to = state.learningDevelopement.conductedTraining?.toDate;
return FormBuilder(
key: formKey,
child: SizedBox(
height: screenHeight * 90,
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
children: [
Flexible(
child: ListView(
children: [
StatefulBuilder(builder: (context, setState) {
@ -1562,9 +1557,7 @@ class _EditLearningAndDevelopmentScreenState
],
);
}),
],
),
),
const SizedBox(height: 16,),
SizedBox(
height: 60,
width: double.infinity,
@ -1644,7 +1637,6 @@ class _EditLearningAndDevelopmentScreenState
)
],
),
),
));
}
return const Center(

View File

@ -1,60 +1,85 @@
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!));
onPressed: () async {
await launchInBrowser(fileUrl!);
},
child: const Icon(Icons.file_download),
),
appBar: AppBar(
title: const Text("Attachment"),
centerTitle: true,
actions: [
IconButton(onPressed: () {}, icon: const Icon(Icons.share)),
],
actions: context.watch<LearningDevelopmentBloc>().state is LearningAndDevelopmentAttachmentViewState ? [
IconButton(onPressed: () {
context.read<LearningDevelopmentBloc>().add(ShareAttachment(fileName: filename!, source: fileUrl!));
}, icon: const Icon(Icons.share)),
]:[]
),
body: BlocConsumer<LearningDevelopmentBloc, LearningDevelopmentState>(builder: (context,state){
if(state is LearningAndDevelopmentAttachmentViewState){
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;
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f' ? true : false;
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: 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,));
child: CircularProgressIndicator(
color: primary,
));
},
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider, fit: BoxFit.fill)),
),
imageUrl:
state.fileUrl,
imageUrl: state.fileUrl,
width: double.infinity,
height: 220,
fit: BoxFit.cover,
@ -63,9 +88,20 @@ class _LearningDevelopmentViewAttachmentState extends State<LearningDevelopmentV
);
}
return Container();
},listener: (context, state) {
},
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();
}
},
),
));
}
}

View File

@ -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:

View File

@ -53,18 +53,10 @@ class _AddReferenceScreenState extends State<AddReferenceScreen> {
return BlocBuilder<ReferencesBloc, ReferencesState>(
builder: (context, state) {
if (state is AddReferenceState) {
return SingleChildScrollView(
child: FormBuilder(
return FormBuilder(
key: formKey,
child: SizedBox(
height: screenHeight * .90,
child: Padding(
padding: const EdgeInsets.all(28),
child: Column(
children: [
const SizedBox(height: 15,),
Flexible(
child: ListView(
children: [
@ -356,12 +348,7 @@ class _AddReferenceScreenState extends State<AddReferenceScreen> {
),
),
),
],
),
),
const SizedBox(height: 16,),
SizedBox(
width: double.infinity,
height: 60,
@ -440,11 +427,10 @@ class _AddReferenceScreenState extends State<AddReferenceScreen> {
),
),
],
),
),
)),
);
));
}
return Container();
},

View File

@ -72,16 +72,10 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
return FormBuilder(
key: formKey,
child: SizedBox(
height: screenHeight * .90,
child: Padding(
padding: const EdgeInsets.all(28),
child: Column(
child: ListView(
children: [
Flexible(
child: Column(
children: [
const SizedBox(height: 25),
Row(
children: [
////LAST NAME
@ -531,13 +525,7 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
],
);
}),
const SizedBox(
height: 20,
),
],
),
),
const SizedBox(height: 16,),
SizedBox(
width: double.infinity,
height: 60,
@ -618,7 +606,6 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
),
],
),
),
));
}
return Container();

View File

@ -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")

View File

@ -85,9 +85,6 @@ class _AddVoluntaryWorkScreenState extends State<AddVoluntaryWorkScreen> {
padding: const EdgeInsets.symmetric(vertical: 32, horizontal: 28),
child: FormBuilder(
key: formKey,
child: Column(
children: [
Flexible(
child: ListView(
children: [
////POSITIONS
@ -373,15 +370,15 @@ class _AddVoluntaryWorkScreenState extends State<AddVoluntaryWorkScreen> {
fromDateController,
firstDate: DateTime(1990),
lastDate: DateTime(2100),
selectableDayPredicate:
(date) {
if (to != null &&
to!.microsecondsSinceEpoch <=
date.microsecondsSinceEpoch) {
return false;
}
return true;
},
// selectableDayPredicate:
// (date) {
// if (to != null &&
// to!.microsecondsSinceEpoch >=
// date.microsecondsSinceEpoch) {
// return false;
// }
// return true;
// },
onChanged: (value) {
setState(() {
from = DateTime.parse(
@ -433,15 +430,15 @@ class _AddVoluntaryWorkScreenState extends State<AddVoluntaryWorkScreen> {
"This field is required"),
controller:
toDateController,
selectableDayPredicate:
(date) {
if (from != null &&
from!.microsecondsSinceEpoch >=
date.microsecondsSinceEpoch) {
return false;
}
return true;
},
// selectableDayPredicate:
// (date) {
// if (from != null &&
// from!.microsecondsSinceEpoch >
// date.microsecondsSinceEpoch) {
// return false;
// }
// return true;
// },
onChanged: (value) {
setState(() {
to = DateTime.parse(
@ -672,9 +669,7 @@ class _AddVoluntaryWorkScreenState extends State<AddVoluntaryWorkScreen> {
],
);
}),
],
),
),
const SizedBox(height: 16,),
SizedBox(
width: double.infinity,
height: 60,

View File

@ -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,
),

View File

@ -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);

View File

@ -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,7 +158,8 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
controller: addPositionController,
onpressed: () {
setState(() {
PositionTitle newAgencyPosition = PositionTitle(
PositionTitle newAgencyPosition =
PositionTitle(
id: null,
title: addPositionController.text
.toUpperCase());
@ -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: [
@ -639,6 +717,45 @@ 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",
"",
),
),
],
);
@ -646,6 +763,7 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
],
),
),
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)),
),

View File

@ -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) {

View File

@ -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,
),
),
);
}
}

View File

@ -68,7 +68,7 @@ class EducationService {
try {
http.Response response = await Request.instance
.postRequest(path: path, param: {}, body: body, headers: headers);
if (response.statusCode == 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 {

View File

@ -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) {

View File

@ -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={};
@ -110,7 +108,6 @@ class WorkHistoryService {
// "oldFromDate":oldWorkHistory.fromDate?.toString(),
// };
// try{
// http.Response response = await Request.instance.putRequest(path: path, headers: headers, body: body, param: {});
// if(response.statusCode == 200 ){
@ -125,67 +122,122 @@ 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{
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 = {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': authtoken
};
Map<String,String> body = {};
Map<dynamic,dynamic> statusResponse = {};
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){
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??"",
"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??"",
"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{
} 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??"",
"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!,
"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'));
var request = http.MultipartRequest(
'POST',
Uri.parse(
'${Url.instance.prefixHost()}://${Url.instance.host()}$path'));
request.fields.addAll(body);
request.headers.addAll(headers);
try {
@ -204,70 +256,133 @@ 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{
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 = {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': authtoken
};
Map<String,String> body = {};
Map<dynamic,dynamic> statusResponse = {};
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){
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??"",
"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{
} 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!,
"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'));
var request = http.MultipartRequest(
'PUT',
Uri.parse(
'${Url.instance.prefixHost()}://${Url.instance.host()}$path'));
request.fields.addAll(body);
request.headers.addAll(headers);
try {
// try {
http.StreamedResponse response = await request.send();
final steamResponse = await response.stream.bytesToString();
Map data = jsonDecode(steamResponse);
@ -280,14 +395,11 @@ Future<Map<dynamic, dynamic>>update({required WorkHistory workHistory, required
{'success': false},
);
}
} catch (e) {
throw e.toString();
// } catch (e) {
// throw e.toString();
// }
return statusResponse;
}
return statusResponse;
}
////get agency position
Future<List<PositionTitle>> getAgencyPosition() async {

View File

@ -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');
}
}

View File

@ -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