share attachment implemented
|
@ -10,7 +10,7 @@
|
|||
<application
|
||||
android:label="uniT App"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
android:icon="@mipmap/unit">
|
||||
<provider
|
||||
android:authorities = "${applicationId}.fileprovider"
|
||||
android:exported = "false"
|
||||
|
|
Before Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 721 B |
After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
|
@ -1,5 +1,5 @@
|
|||
buildscript {
|
||||
ext.kotlin_version = '1.6.10'
|
||||
ext.kotlin_version = '1.8.0'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
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/profile/educational_background.dart';
|
||||
import 'package:unit2/sevices/profile/education_services.dart';
|
||||
import 'package:unit2/utils/request_permission.dart';
|
||||
|
||||
import '../../../model/profile/attachment.dart';
|
||||
import '../../../utils/attachment_services.dart';
|
||||
import '../../../utils/urls.dart';
|
||||
|
||||
part 'education_event.dart';
|
||||
part 'education_state.dart';
|
||||
|
@ -14,9 +22,13 @@ class EducationBloc extends Bloc<EducationEvent, EducationState> {
|
|||
List<School> schools = [];
|
||||
List<Course> programs = [];
|
||||
List<Honor> honors = [];
|
||||
int? profileId;
|
||||
String? token;
|
||||
List<AttachmentCategory> attachmentCategories = [];
|
||||
EducationBloc() : super(EducationInitial()) {
|
||||
on<GetEducationalBackground>((event, emit) async {
|
||||
profileId = event.profileId;
|
||||
token = event.token;
|
||||
emit(EducationalBackgroundLoadingState());
|
||||
try {
|
||||
if (attachmentCategories.isEmpty) {
|
||||
|
@ -206,5 +218,44 @@ class EducationBloc extends Bloc<EducationEvent, EducationState> {
|
|||
emit(EducationalBackgroundErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<EducationViewAttachment>((event, emit) {
|
||||
String fileUrl =
|
||||
'${Url.instance.prefixHost()}://${Url.instance.host()}${event.source}';
|
||||
emit(EducationAttachmentViewState(
|
||||
fileUrl: fileUrl, fileName: event.fileName));
|
||||
});
|
||||
on<ShareAttachment>((event, emit) async {
|
||||
emit(EducationalBackgroundLoadingState());
|
||||
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 successfully");
|
||||
emit(EducationAttachmentViewState(
|
||||
fileUrl: event.source, fileName: event.fileName));
|
||||
} else {
|
||||
Fluttertoast.showToast(msg: "Attachment shared unsuccessfully");
|
||||
emit(EducationAttachmentViewState(
|
||||
fileUrl: event.source, fileName: event.fileName));
|
||||
}
|
||||
} else {
|
||||
emit(EducationAttachmentViewState(
|
||||
fileUrl: event.source, fileName: event.fileName));
|
||||
}
|
||||
}catch(e){
|
||||
emit(EducationalBackgroundErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,3 +83,15 @@ class DeleteEducationAttachment extends EducationEvent{
|
|||
final int profileId;
|
||||
const DeleteEducationAttachment({required this.attachment, required this.moduleId, required this.profileId, required this.token});
|
||||
}
|
||||
|
||||
class EducationViewAttachment extends EducationEvent{
|
||||
final String fileName;
|
||||
final String source;
|
||||
const EducationViewAttachment({required this.source,required this.fileName});
|
||||
}
|
||||
|
||||
class ShareAttachment extends EducationEvent{
|
||||
final String fileName;
|
||||
final String source;
|
||||
const ShareAttachment({required this.fileName, required this.source});
|
||||
}
|
||||
|
|
|
@ -60,7 +60,6 @@ class EducationAddedState extends EducationState {
|
|||
List<Object> get props => [response];
|
||||
}
|
||||
|
||||
|
||||
//// Edited State
|
||||
class EditedEducationState extends EducationState {
|
||||
final Map<dynamic, dynamic> response;
|
||||
|
@ -90,3 +89,14 @@ class EducationAttachmentDeletedState extends EducationState {
|
|||
@override
|
||||
List<Object> get props => [success];
|
||||
}
|
||||
|
||||
class EducationAttachmentViewState extends EducationState {
|
||||
final String fileUrl;
|
||||
final String fileName;
|
||||
const EducationAttachmentViewState({required this.fileUrl, required this.fileName});
|
||||
}
|
||||
|
||||
class EducationAttachmentShareState extends EducationState{
|
||||
final bool success;
|
||||
const EducationAttachmentShareState({required this.success,});
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import '../../../model/utils/eligibility.dart';
|
|||
import '../../../sevices/profile/eligibility_services.dart';
|
||||
import '../../../utils/location_utilities.dart';
|
||||
import '../../../utils/profile_utilities.dart';
|
||||
import '../../../utils/urls.dart';
|
||||
part 'eligibility_event.dart';
|
||||
part 'eligibility_state.dart';
|
||||
|
||||
|
@ -52,6 +53,7 @@ class EligibilityBloc extends Bloc<EligibilityEvent, EligibilityState> {
|
|||
|
||||
//// GET ELIGIBILITY
|
||||
on<GetEligibilities>((event, emit) async {
|
||||
emit(EligibilityLoadingState());
|
||||
try {
|
||||
if (attachmentCategories.isEmpty) {
|
||||
attachmentCategories =
|
||||
|
@ -257,7 +259,7 @@ class EligibilityBloc extends Bloc<EligibilityEvent, EligibilityState> {
|
|||
|
||||
on<DeleteEligibyAttachment>((event, emit) async {
|
||||
emit(EligibilityLoadingState());
|
||||
// try {
|
||||
try {
|
||||
final bool success = await AttachmentServices.instance.deleteAttachment(
|
||||
attachment: event.attachment,
|
||||
moduleId: int.parse(event.moduleId),
|
||||
|
@ -275,9 +277,13 @@ class EligibilityBloc extends Bloc<EligibilityEvent, EligibilityState> {
|
|||
} else {
|
||||
emit(EligibilitytAttachmentDeletedState(success: success));
|
||||
}
|
||||
// } catch (e) {
|
||||
// emit(EligibilityErrorState(message: e.toString()));
|
||||
// }
|
||||
} catch (e) {
|
||||
emit(EligibilityErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<EligibiltyViewAttachmentEvent>((event,emit){
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}${event.source}';
|
||||
emit(EligibilityAttachmentViewState(fileUrl: fileUrl));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,7 @@ abstract class EligibilityEvent extends Equatable {
|
|||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class ShowAddEligibilityForm extends EligibilityEvent {
|
||||
|
||||
}
|
||||
class ShowAddEligibilityForm extends EligibilityEvent {}
|
||||
|
||||
class GetEligibilities extends EligibilityEvent {
|
||||
final int profileId;
|
||||
|
@ -23,22 +21,30 @@ class AddEligibility extends EligibilityEvent{
|
|||
final EligibityCert eligibityCert;
|
||||
final String profileId;
|
||||
final String token;
|
||||
const AddEligibility({required this.eligibityCert, required this.profileId, required this.token});
|
||||
const AddEligibility(
|
||||
{required this.eligibityCert,
|
||||
required this.profileId,
|
||||
required this.token});
|
||||
@override
|
||||
List<Object> get props => [eligibityCert, profileId, token];
|
||||
}
|
||||
|
||||
class UpdateEligibility extends EligibilityEvent {
|
||||
final EligibityCert eligibityCert;
|
||||
final String profileId;
|
||||
final String token;
|
||||
final int oldEligibility;
|
||||
const UpdateEligibility({required this.eligibityCert, required this.oldEligibility,required this.profileId, required this.token});
|
||||
const UpdateEligibility(
|
||||
{required this.eligibityCert,
|
||||
required this.oldEligibility,
|
||||
required this.profileId,
|
||||
required this.token});
|
||||
|
||||
@override
|
||||
List<Object> get props => [eligibityCert, profileId, token, oldEligibility];
|
||||
}
|
||||
class LoadEligibility extends EligibilityEvent {
|
||||
|
||||
class LoadEligibility extends EligibilityEvent {
|
||||
const LoadEligibility();
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
|
@ -57,17 +63,15 @@ class DeleteEligibility extends EligibilityEvent {
|
|||
final String token;
|
||||
|
||||
const DeleteEligibility(
|
||||
{
|
||||
required this.eligibilityId,
|
||||
{required this.eligibilityId,
|
||||
required this.profileId,
|
||||
required this.token});
|
||||
@override
|
||||
List<Object> get props => [profileId, eligibilityId, token];
|
||||
}
|
||||
|
||||
class CallErrorState extends EligibilityEvent{
|
||||
class CallErrorState extends EligibilityEvent {}
|
||||
|
||||
}
|
||||
////Add Attachment
|
||||
class AddEligibiltyAttachment extends EligibilityEvent {
|
||||
final String categoryId;
|
||||
|
@ -75,9 +79,15 @@ class AddEligibiltyAttachment extends EligibilityEvent{
|
|||
final List<String> filePaths;
|
||||
final String token;
|
||||
final String profileId;
|
||||
const AddEligibiltyAttachment({required this.attachmentModule, required this.filePaths, required this.categoryId, required this.profileId, required this.token});
|
||||
const AddEligibiltyAttachment(
|
||||
{required this.attachmentModule,
|
||||
required this.filePaths,
|
||||
required this.categoryId,
|
||||
required this.profileId,
|
||||
required this.token});
|
||||
@override
|
||||
List<Object> get props => [categoryId,attachmentModule,filePaths, token,profileId];
|
||||
List<Object> get props =>
|
||||
[categoryId, attachmentModule, filePaths, token, profileId];
|
||||
}
|
||||
|
||||
////Delete Attachment
|
||||
|
@ -86,14 +96,20 @@ class DeleteEligibyAttachment extends EligibilityEvent{
|
|||
final String token;
|
||||
final Attachment attachment;
|
||||
final String moduleId;
|
||||
const DeleteEligibyAttachment({required this.attachment,required this.moduleId, required this.profileId, required this.token});
|
||||
const DeleteEligibyAttachment(
|
||||
{required this.attachment,
|
||||
required this.moduleId,
|
||||
required this.profileId,
|
||||
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});
|
||||
}
|
||||
|
||||
|
|
|
@ -107,3 +107,8 @@ class EligibilitytAttachmentDeletedState extends EligibilityState {
|
|||
@override
|
||||
List<Object> get props => [success];
|
||||
}
|
||||
|
||||
class EligibilityAttachmentViewState extends EligibilityState {
|
||||
final String fileUrl;
|
||||
const EligibilityAttachmentViewState({required this.fileUrl});
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import '../../../model/utils/category.dart';
|
|||
import '../../../utils/attachment_services.dart';
|
||||
import '../../../utils/location_utilities.dart';
|
||||
import '../../../utils/profile_utilities.dart';
|
||||
import '../../../utils/urls.dart';
|
||||
part 'learning_development_event.dart';
|
||||
part 'learning_development_state.dart';
|
||||
|
||||
|
@ -325,5 +326,10 @@ class LearningDevelopmentBloc
|
|||
emit(LearningDevelopmentErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<LearningDevelopmentViewAttachmentEvent>((event,emit){
|
||||
String fileUrl = '${Url.instance.prefixHost()}://${Url.instance.host()}${event.source}';
|
||||
emit(LearningAndDevelopmentAttachmentViewState(fileUrl: fileUrl));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,3 +88,9 @@ class DeleteLearningDevAttachment extends LearningDevelopmentEvent{
|
|||
const DeleteLearningDevAttachment({required this.attachment, required this.moduleId, required this.profileId, required this.token});
|
||||
}
|
||||
|
||||
class LearningDevelopmentViewAttachmentEvent extends LearningDevelopmentEvent{
|
||||
final String source;
|
||||
const LearningDevelopmentViewAttachmentEvent({required this.source});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -133,3 +133,9 @@ class LearningDevAttachmentDeletedState extends LearningDevelopmentState {
|
|||
@override
|
||||
List<Object> get props => [success];
|
||||
}
|
||||
|
||||
|
||||
class LearningAndDevelopmentAttachmentViewState extends LearningDevelopmentState {
|
||||
final String fileUrl;
|
||||
const LearningAndDevelopmentAttachmentViewState({required this.fileUrl});
|
||||
}
|
|
@ -7,6 +7,7 @@ import 'package:unit2/model/utils/position.dart';
|
|||
import 'package:unit2/sevices/profile/work_history_services.dart';
|
||||
import 'package:unit2/utils/profile_utilities.dart';
|
||||
import '../../../model/profile/attachment.dart';
|
||||
|
||||
import '../../../model/utils/category.dart';
|
||||
import '../../../utils/attachment_services.dart';
|
||||
part 'workHistory_event.dart';
|
||||
|
@ -67,8 +68,10 @@ 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,
|
||||
isPrivate: event.isPrivate,
|
||||
workHistory: event.workHistory,
|
||||
token: event.token,
|
||||
|
@ -80,35 +83,35 @@ class WorkHistoryBloc extends Bloc<WorkHistorytEvent, WorkHistoryState> {
|
|||
} else {
|
||||
emit(WorkHistoryAddedState(response: status));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(WorkHistoryErrorState(message: e.toString()));
|
||||
}
|
||||
// } 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()));
|
||||
}
|
||||
});
|
||||
// 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 {
|
||||
|
@ -209,12 +212,12 @@ class WorkHistoryBloc extends Bloc<WorkHistorytEvent, WorkHistoryState> {
|
|||
Attachment newAttachment = Attachment.fromJson(element);
|
||||
attachments.add(newAttachment);
|
||||
});
|
||||
workHistory.attachments == null
|
||||
? workHistory.attachments = attachments
|
||||
: workHistory.attachments = [
|
||||
...workHistory.attachments!,
|
||||
...attachments
|
||||
];
|
||||
// workHistory.attachments == null
|
||||
// ? workHistory.attachments = attachments
|
||||
// : workHistory.attachments = [
|
||||
// ...workHistory.attachments!,
|
||||
// ...attachments
|
||||
// ];
|
||||
emit(WorkHistoryDevAttachmentAddedState(response: status));
|
||||
} else {
|
||||
emit(WorkHistoryDevAttachmentAddedState(response: status));
|
||||
|
@ -223,31 +226,31 @@ class WorkHistoryBloc extends Bloc<WorkHistorytEvent, WorkHistoryState> {
|
|||
emit(WorkHistoryErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
////Delete Attachment
|
||||
on<DeleteWorkHistoryAttachment>((event, emit) async {
|
||||
emit(WorkHistoryLoadingState());
|
||||
try {
|
||||
final bool success = await AttachmentServices.instance.deleteAttachment(
|
||||
attachment: event.attachment,
|
||||
moduleId: event.moduleId,
|
||||
profileId: event.profileId.toString(),
|
||||
token: event.token);
|
||||
if (success) {
|
||||
final WorkHistory workHistory =
|
||||
workExperiences
|
||||
.firstWhere((element) => element.id == event.moduleId);
|
||||
workHistory.attachments
|
||||
?.removeWhere((element) => element.id == event.attachment.id);
|
||||
workExperiences
|
||||
.removeWhere((element) => element.id == event.moduleId);
|
||||
workExperiences.add(workHistory);
|
||||
emit(WorkHistoryDevAttachmentDeletedState(success: success));
|
||||
} else {
|
||||
emit(WorkHistoryDevAttachmentDeletedState(success: success));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(WorkHistoryErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
// ////Delete Attachment
|
||||
// on<DeleteWorkHistoryAttachment>((event, emit) async {
|
||||
// emit(WorkHistoryLoadingState());
|
||||
// try {
|
||||
// final bool success = await AttachmentServices.instance.deleteAttachment(
|
||||
// attachment: event.attachment,
|
||||
// moduleId: event.moduleId,
|
||||
// profileId: event.profileId.toString(),
|
||||
// token: event.token);
|
||||
// if (success) {
|
||||
// final WorkHistory workHistory =
|
||||
// workExperiences
|
||||
// .firstWhere((element) => element.id == event.moduleId);
|
||||
// workHistory.attachments
|
||||
// ?.removeWhere((element) => element.id == event.attachment.id);
|
||||
// workExperiences
|
||||
// .removeWhere((element) => element.id == event.moduleId);
|
||||
// workExperiences.add(workHistory);
|
||||
// emit(WorkHistoryDevAttachmentDeletedState(success: success));
|
||||
// } else {
|
||||
// emit(WorkHistoryDevAttachmentDeletedState(success: success));
|
||||
// }
|
||||
// } catch (e) {
|
||||
// emit(WorkHistoryErrorState(message: e.toString()));
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,12 +43,14 @@ class DeleteWorkHistory extends WorkHistorytEvent{
|
|||
|
||||
class UpdateWorkHistory extends WorkHistorytEvent{
|
||||
final WorkHistory workHistory;
|
||||
final WorkHistory oldWorkHistory;
|
||||
final String profileId;
|
||||
final bool isPrivate;
|
||||
final int profileId;
|
||||
final String token;
|
||||
const UpdateWorkHistory({required this.oldWorkHistory, required this.profileId, required this.token, required this.workHistory});
|
||||
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});
|
||||
@override
|
||||
List<Object> get props => [profileId,token,workHistory,oldWorkHistory];
|
||||
List<Object> get props => [profileId,token,workHistory,];
|
||||
}
|
||||
|
||||
class AddWorkHostory extends WorkHistorytEvent{
|
||||
|
@ -56,7 +58,9 @@ class AddWorkHostory extends WorkHistorytEvent{
|
|||
final bool isPrivate;
|
||||
final int profileId;
|
||||
final String token;
|
||||
const AddWorkHostory({required this.workHistory, required this.isPrivate, required this.profileId, required this.token});
|
||||
final String? actualDuties;
|
||||
final String? accomplishment;
|
||||
const AddWorkHostory({required this.workHistory, required this.isPrivate, required this.profileId, required this.token, required this.accomplishment, required this.actualDuties});
|
||||
@override
|
||||
List<Object> get props => [workHistory,profileId,token,isPrivate];
|
||||
}
|
||||
|
|
|
@ -22,15 +22,15 @@ class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
|||
int? stationId;
|
||||
String? cpId;
|
||||
on<GetPassCheckAreas>((event, emit) async {
|
||||
// try {
|
||||
try {
|
||||
emit(PassCheckLoadingState());
|
||||
List<dynamic> response = await PassCheckServices.instance
|
||||
.getPassCheckArea(roleId: event.roleId, userId: event.userId);
|
||||
roleId = event.roleId;
|
||||
emit(AssignAreaLoaded(assignedArea: response, roleId: roleId!));
|
||||
// } catch (e) {
|
||||
// emit(PassCheckErrorState(message: e.toString()));
|
||||
// }
|
||||
} catch (e) {
|
||||
emit(PassCheckErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<SetScannerSettings>((event, emit) {
|
||||
otherInputs = event.includeOtherInputs;
|
||||
|
|
|
@ -1,75 +1,163 @@
|
|||
// To parse this JSON data, do
|
||||
//
|
||||
// final workHistory = workHistoryFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
import 'package:unit2/model/utils/industry_class.dart';
|
||||
|
||||
import '../utils/agency.dart';
|
||||
import '../utils/category.dart';
|
||||
import '../utils/industry_class.dart';
|
||||
import '../utils/position.dart';
|
||||
import 'attachment.dart';
|
||||
|
||||
WorkHistory workHistoryFromJson(String str) => WorkHistory.fromJson(json.decode(str));
|
||||
|
||||
String workHistoryToJson(WorkHistory data) => json.encode(data.toJson());
|
||||
|
||||
class WorkHistory {
|
||||
final PositionTitle? position;
|
||||
final Agency? agency;
|
||||
final Supervisor? supervisor;
|
||||
final int? id;
|
||||
final DateTime? fromDate;
|
||||
final DateTime? toDate;
|
||||
final int? agencydepid;
|
||||
final double? monthlysalary;
|
||||
final String? statusAppointment;
|
||||
final int? salarygrade;
|
||||
final int? sgstep;
|
||||
final List<Accomplishment>? accomplishment;
|
||||
final List<ActualDuty>? actualDuties;
|
||||
|
||||
WorkHistory({
|
||||
this.id,
|
||||
this.agency,
|
||||
this.sgStep,
|
||||
this.toDate,
|
||||
this.position,
|
||||
this.fromDate,
|
||||
this.attachments,
|
||||
this.salaryGrade,
|
||||
this.monthlySalary,
|
||||
this.appointmentStatus,
|
||||
required this.position,
|
||||
required this.agency,
|
||||
required this.supervisor,
|
||||
required this.id,
|
||||
required this.fromDate,
|
||||
required this.toDate,
|
||||
required this.agencydepid,
|
||||
required this.monthlysalary,
|
||||
required this.statusAppointment,
|
||||
required this.salarygrade,
|
||||
required this.sgstep,
|
||||
required this.accomplishment,
|
||||
required this.actualDuties,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final Agency? agency;
|
||||
final int? sgStep;
|
||||
final DateTime? toDate;
|
||||
final PositionTitle? position;
|
||||
final DateTime? fromDate;
|
||||
List<Attachment>? attachments;
|
||||
final int? salaryGrade;
|
||||
final double? monthlySalary;
|
||||
final String? appointmentStatus;
|
||||
|
||||
factory WorkHistory.fromJson(Map<String, dynamic> json) => WorkHistory(
|
||||
position: PositionTitle.fromJson(json["position"]),
|
||||
agency: json['agency'] == null?null: Agency.fromJson(json["agency"]),
|
||||
supervisor: json['supervisor'] == null?null: Supervisor.fromJson(json["supervisor"]),
|
||||
id: json["id"],
|
||||
agency: json["agency"] == null ? null : Agency.fromJson(json["agency"]),
|
||||
sgStep: json["sg_step"],
|
||||
toDate: json["to_date"] == null ? null : DateTime.parse(json["to_date"]),
|
||||
position: json["position"] == null ? null : PositionTitle.fromJson(json["position"]),
|
||||
fromDate: json["from_date"] == null ? null : DateTime.parse(json["from_date"]),
|
||||
attachments: json['attachments'] ==null?null: List<Attachment>.from(json["attachments"].map((x) => Attachment.fromJson(x))),
|
||||
salaryGrade: json["salary_grade"],
|
||||
monthlySalary: json["monthly_salary"],
|
||||
appointmentStatus: json["appointment_status"],
|
||||
fromDate: json['from_date'] == null?null: DateTime.tryParse(json["from_date"]),
|
||||
toDate: json['to_date'] == null?null: DateTime.tryParse(json["to_date"]),
|
||||
agencydepid: json["agencydepid"],
|
||||
monthlysalary: json["monthlysalary"],
|
||||
statusAppointment: json["status_appointment"],
|
||||
salarygrade: json["salarygrade"],
|
||||
sgstep: json["sgstep"],
|
||||
accomplishment:json['accomplishment'] == null?null: json['accomplishment'] == null?null: List<Accomplishment>.from(
|
||||
json["accomplishment"].map((x) => Accomplishment.fromJson(x))),
|
||||
actualDuties: json['actual_duties'] == null?null: List<ActualDuty>.from(
|
||||
json["actual_duties"].map((x) => ActualDuty.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"position": position?.toJson(),
|
||||
"agency": agency?.toJson(),
|
||||
"supervisor": supervisor?.toJson(),
|
||||
"id": id,
|
||||
"from_date":
|
||||
"${fromDate?.year.toString().padLeft(4, '0')}-${fromDate?.month.toString().padLeft(2, '0')}-${fromDate?.day.toString().padLeft(2, '0')}",
|
||||
"to_date": toDate,
|
||||
"agencydepid": agencydepid,
|
||||
"monthlysalary": monthlysalary,
|
||||
"status_appointment": statusAppointment,
|
||||
"salarygrade": salarygrade,
|
||||
"sgstep": sgstep,
|
||||
"accomplishment":
|
||||
List<dynamic>.from(accomplishment!.map((x) => x.toJson())),
|
||||
"actual_duties":
|
||||
List<dynamic>.from(actualDuties!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Accomplishment {
|
||||
final int? id;
|
||||
final int? workExperienceId;
|
||||
final String? accomplishment;
|
||||
|
||||
Accomplishment({
|
||||
required this.id,
|
||||
required this.workExperienceId,
|
||||
required this.accomplishment,
|
||||
});
|
||||
|
||||
factory Accomplishment.fromJson(Map<String, dynamic> json) => Accomplishment(
|
||||
id: json["id"],
|
||||
workExperienceId: json["work_experience_id"],
|
||||
accomplishment: json["accomplishment"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"agency": agency?.toJson(),
|
||||
"sg_step": sgStep,
|
||||
"to_date": "${toDate!.year.toString().padLeft(4, '0')}-${toDate!.month.toString().padLeft(2, '0')}-${toDate!.day.toString().padLeft(2, '0')}",
|
||||
"position": position?.toJson(),
|
||||
"from_date": "${fromDate!.year.toString().padLeft(4, '0')}-${fromDate!.month.toString().padLeft(2, '0')}-${fromDate!.day.toString().padLeft(2, '0')}",
|
||||
// "attachments": attachments,
|
||||
"salary_grade": salaryGrade,
|
||||
"monthly_salary": monthlySalary,
|
||||
"appointment_status": appointmentStatus,
|
||||
"work_experience_id": workExperienceId,
|
||||
"accomplishment": accomplishment,
|
||||
};
|
||||
}
|
||||
|
||||
class ActualDuty {
|
||||
final int? id;
|
||||
final int? workExperienceId;
|
||||
final String description;
|
||||
|
||||
ActualDuty({
|
||||
required this.id,
|
||||
required this.workExperienceId,
|
||||
required this.description,
|
||||
});
|
||||
|
||||
factory ActualDuty.fromJson(Map<String, dynamic> json) => ActualDuty(
|
||||
id: json["id"],
|
||||
workExperienceId: json["work_experience_id"],
|
||||
description: json["description"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"work_experience_id": workExperienceId,
|
||||
"description": description,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Supervisor {
|
||||
final int? id;
|
||||
final int? agencyId;
|
||||
final String? lastname;
|
||||
final String? firstname;
|
||||
final String? middlename;
|
||||
final String? stationName;
|
||||
|
||||
Supervisor({
|
||||
required this.id,
|
||||
required this.agencyId,
|
||||
required this.lastname,
|
||||
required this.firstname,
|
||||
required this.middlename,
|
||||
required this.stationName,
|
||||
});
|
||||
|
||||
factory Supervisor.fromJson(Map<String, dynamic> json) => Supervisor(
|
||||
id: json["id"],
|
||||
agencyId: json["agency_id"],
|
||||
lastname: json["lastname"],
|
||||
firstname: json["firstname"],
|
||||
middlename: json["middlename"],
|
||||
stationName: json["station_name"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"agency_id": agencyId,
|
||||
"lastname": lastname,
|
||||
"firstname": firstname,
|
||||
"middlename": middlename,
|
||||
"station_name": stationName,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
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: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';
|
||||
|
||||
class EudcationViewAttachment extends StatefulWidget {
|
||||
const EudcationViewAttachment({super.key});
|
||||
|
||||
@override
|
||||
State<EudcationViewAttachment> createState() =>
|
||||
_EudcationViewAttachmentState();
|
||||
}
|
||||
|
||||
class _EudcationViewAttachmentState extends State<EudcationViewAttachment> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String? fileUrl;
|
||||
String? filename;
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
await _launchInBrowser(fileUrl!);
|
||||
},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text("Attachment"),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
context.read<EducationBloc>().add(
|
||||
ShareAttachment(fileName: filename!, source: fileUrl!));
|
||||
},
|
||||
icon: const Icon(Icons.share)),
|
||||
],
|
||||
),
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<EducationBloc, EducationState>(
|
||||
builder: (context, state) {
|
||||
if (state is EducationAttachmentViewState) {
|
||||
fileUrl = state.fileUrl;
|
||||
filename = state.fileName;
|
||||
|
||||
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f'
|
||||
? true
|
||||
: false;
|
||||
return SizedBox(
|
||||
child: isPDF
|
||||
? SfPdfViewer.network(
|
||||
state.fileUrl,
|
||||
onDocumentLoadFailed: (details) {
|
||||
Center(
|
||||
child: Text(details.description),
|
||||
);
|
||||
},
|
||||
)
|
||||
: Center(
|
||||
child: CachedNetworkImage(
|
||||
progressIndicatorBuilder: (context, url, progress) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: CircularProgressIndicator(
|
||||
color: primary,
|
||||
));
|
||||
},
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider, fit: BoxFit.fill)),
|
||||
),
|
||||
imageUrl: state.fileUrl,
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
listener: (context, state) {
|
||||
if (state is EducationalBackgroundLoadingState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is EducationAttachmentViewState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.dismiss();
|
||||
}
|
||||
},
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Future<void> _launchInBrowser(String url) async {
|
||||
final UrlLauncherPlatform launcher = UrlLauncherPlatform.instance;
|
||||
if (!await launcher.launch(
|
||||
url,
|
||||
useSafariVC: false,
|
||||
useWebView: false,
|
||||
enableJavaScript: false,
|
||||
enableDomStorage: false,
|
||||
universalLinksOnly: false,
|
||||
headers: <String, String>{},
|
||||
)) {
|
||||
throw Exception('Could not launch $url');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ 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';
|
||||
|
@ -26,6 +27,7 @@ import '../../../widgets/Leadings/close_leading.dart';
|
|||
import '../shared/multiple_attachment.dart';
|
||||
import '../shared/single_attachment.dart';
|
||||
import 'education/edit_modal.dart';
|
||||
import 'education/education_view_attachment.dart';
|
||||
|
||||
class EducationScreen extends StatelessWidget {
|
||||
const EducationScreen({super.key});
|
||||
|
@ -696,6 +698,15 @@ class EducationScreen extends StatelessWidget {
|
|||
children: [
|
||||
const Divider(),
|
||||
SingleAttachment(
|
||||
view: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) => BlocProvider.value(
|
||||
value: EducationBloc()..add(EducationViewAttachment(source: state.educationalBackground[index].attachments!.first.source!,fileName: state.educationalBackground[index].attachments!.first.filename!)),
|
||||
child: const EudcationViewAttachment(),
|
||||
))));
|
||||
},
|
||||
onpressed:
|
||||
() {
|
||||
confirmAlert(
|
||||
|
@ -728,6 +739,17 @@ class EducationScreen extends StatelessWidget {
|
|||
)
|
||||
////Multiple Attachments View
|
||||
: MultipleAttachments(
|
||||
viewAttachment:
|
||||
(source,filname) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) =>
|
||||
BlocProvider.value(
|
||||
value: EducationBloc()..add(EducationViewAttachment(source: source,fileName: filname)),
|
||||
child: const EudcationViewAttachment(),
|
||||
))));
|
||||
},
|
||||
profileId:
|
||||
profileId,
|
||||
token: token!,
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.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:url_launcher/url_launcher.dart';
|
||||
import '../../../../utils/urls.dart';
|
||||
class EligibilityViewAttachment extends StatefulWidget {
|
||||
|
||||
const EligibilityViewAttachment({super.key});
|
||||
|
||||
@override
|
||||
State<EligibilityViewAttachment> createState() => _EligibilityViewAttachmentState();
|
||||
}
|
||||
|
||||
class _EligibilityViewAttachmentState extends State<EligibilityViewAttachment> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String? fileUrl;
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: ()async {
|
||||
await launchUrl(Uri.parse(fileUrl!));
|
||||
},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text("Attachment"),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(onPressed: () {}, icon: const Icon(Icons.share)),
|
||||
],
|
||||
),
|
||||
body: BlocConsumer<EligibilityBloc, EligibilityState>(builder: (context,state){
|
||||
if(state is EligibilityAttachmentViewState){
|
||||
fileUrl = state.fileUrl;
|
||||
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f' ? true : false;
|
||||
return SizedBox(
|
||||
child: isPDF?SfPdfViewer.network(
|
||||
state.fileUrl,onDocumentLoadFailed: (details) {
|
||||
Center(child: Text(details.description),);
|
||||
},): Center(
|
||||
child: CachedNetworkImage(
|
||||
progressIndicatorBuilder: (context, url, progress) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: CircularProgressIndicator(color: primary,));
|
||||
},
|
||||
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider, fit: BoxFit.fill)),
|
||||
),
|
||||
imageUrl:
|
||||
state.fileUrl,
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},listener: (context, state) {
|
||||
|
||||
},)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -28,6 +28,8 @@ 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 {
|
||||
const EligibiltyScreen({super.key});
|
||||
|
@ -629,6 +631,17 @@ class EligibiltyScreen extends StatelessWidget {
|
|||
?
|
||||
////Single Attachment view
|
||||
SingleAttachment(
|
||||
view: (){
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) => BlocProvider.value(
|
||||
value: EligibilityBloc()..add(EligibiltyViewAttachmentEvent(source: state.eligibilities[index].attachments!.first.source!)),
|
||||
child: const EligibilityViewAttachment(),
|
||||
))));
|
||||
|
||||
},
|
||||
onpressed:
|
||||
() {
|
||||
confirmAlert(
|
||||
|
@ -660,6 +673,15 @@ class EligibiltyScreen extends StatelessWidget {
|
|||
)
|
||||
////Multiple Attachments View
|
||||
: MultipleAttachments(
|
||||
viewAttachment: (source,filename) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) => BlocProvider.value(
|
||||
value: EligibilityBloc()..add(EligibiltyViewAttachmentEvent(source: source)),
|
||||
child: const EligibilityViewAttachment(),
|
||||
))));
|
||||
},
|
||||
profileId:
|
||||
profileId!,
|
||||
token: token!,
|
||||
|
|
|
@ -12,6 +12,7 @@ import 'package:intl/intl.dart';
|
|||
import 'package:unit2/bloc/profile/profile_bloc.dart';
|
||||
import 'package:unit2/bloc/user/user_bloc.dart';
|
||||
import 'package:unit2/screens/profile/components/learning_development/edit_modal.dart';
|
||||
import 'package:unit2/screens/profile/components/learning_development/learning_development_view_attachment.dart';
|
||||
import 'package:unit2/theme-data.dart/box_shadow.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
|
@ -27,6 +28,7 @@ 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 {
|
||||
|
@ -673,6 +675,15 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
?
|
||||
////Single Attachment view
|
||||
SingleAttachment(
|
||||
view: (){
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) => BlocProvider.value(
|
||||
value: LearningDevelopmentBloc()..add(LearningDevelopmentViewAttachmentEvent(source: state.learningsAndDevelopment[index].attachments!.first.source!)),
|
||||
child: const LearningDevelopmentViewAttachment(),
|
||||
))));
|
||||
},
|
||||
onpressed: () {
|
||||
confirmAlert(
|
||||
context,
|
||||
|
@ -703,6 +714,17 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
)
|
||||
////Multiple Attachments View
|
||||
: MultipleAttachments(
|
||||
viewAttachment:
|
||||
(source,filename) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: ((context) =>
|
||||
BlocProvider.value(
|
||||
value: LearningDevelopmentBloc()..add(LearningDevelopmentViewAttachmentEvent(source: source)),
|
||||
child: const LearningDevelopmentViewAttachment(),
|
||||
))));
|
||||
},
|
||||
profileId:
|
||||
profileId,
|
||||
token: token,
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.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:url_launcher/url_launcher.dart';
|
||||
class LearningDevelopmentViewAttachment extends StatefulWidget {
|
||||
|
||||
const LearningDevelopmentViewAttachment({super.key});
|
||||
|
||||
@override
|
||||
State<LearningDevelopmentViewAttachment> createState() => _LearningDevelopmentViewAttachmentState();
|
||||
}
|
||||
|
||||
class _LearningDevelopmentViewAttachmentState extends State<LearningDevelopmentViewAttachment> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String? fileUrl;
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: ()async {
|
||||
await launchUrl(Uri.parse(fileUrl!));
|
||||
},
|
||||
child: const Icon(Icons.file_download),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: const Text("Attachment"),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(onPressed: () {}, icon: const Icon(Icons.share)),
|
||||
],
|
||||
),
|
||||
body: BlocConsumer<LearningDevelopmentBloc, LearningDevelopmentState>(builder: (context,state){
|
||||
if(state is LearningAndDevelopmentAttachmentViewState){
|
||||
fileUrl = state.fileUrl;
|
||||
bool isPDF = state.fileUrl[state.fileUrl.length - 1] == 'f' ? true : false;
|
||||
return SizedBox(
|
||||
child: isPDF?SfPdfViewer.network(
|
||||
state.fileUrl,onDocumentLoadFailed: (details) {
|
||||
Center(child: Text(details.description),);
|
||||
},): Center(
|
||||
child: CachedNetworkImage(
|
||||
progressIndicatorBuilder: (context, url, progress) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: CircularProgressIndicator(color: primary,));
|
||||
},
|
||||
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider, fit: BoxFit.fill)),
|
||||
),
|
||||
imageUrl:
|
||||
state.fileUrl,
|
||||
width: double.infinity,
|
||||
height: 220,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},listener: (context, state) {
|
||||
|
||||
},)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -45,6 +45,12 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
String? salary;
|
||||
String? salaryGrade;
|
||||
String? salaryGradeStep;
|
||||
String? accomplishment;
|
||||
String? duties;
|
||||
String? sFname;
|
||||
String? sLname;
|
||||
String? sMname;
|
||||
String? sOffice;
|
||||
bool showAgency = false;
|
||||
bool showSalaryGradeAndSalaryStep = false;
|
||||
bool? isPrivate = false;
|
||||
|
@ -67,7 +73,9 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return BlocConsumer<WorkHistoryBloc, WorkHistoryState>(
|
||||
|
||||
listener: (context, state) {
|
||||
if (state is AddWorkHistoryState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
|
@ -77,15 +85,14 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
if (state is AddWorkHistoryState) {
|
||||
return FormBuilder(
|
||||
key: _formKey,
|
||||
child: SizedBox(
|
||||
height: blockSizeVertical * 90,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 32, horizontal: 28),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
|
||||
|
||||
////POSITIONS
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return SearchField(
|
||||
|
@ -93,8 +100,8 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
itemHeight: 70,
|
||||
suggestionsDecoration: box1(),
|
||||
suggestions: state.agencyPositions
|
||||
.map((PositionTitle position) => SearchFieldListItem(
|
||||
position.title!,
|
||||
.map((PositionTitle position) =>
|
||||
SearchFieldListItem(position.title!,
|
||||
item: position,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
@ -127,7 +134,8 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
controller: addPositionController,
|
||||
onpressed: () {
|
||||
setState(() {
|
||||
PositionTitle newAgencyPosition = PositionTitle(
|
||||
PositionTitle newAgencyPosition =
|
||||
PositionTitle(
|
||||
id: null,
|
||||
title: addPositionController.text
|
||||
.toUpperCase());
|
||||
|
@ -476,8 +484,24 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////MONTHLY SALARY
|
||||
//// 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,
|
||||
),
|
||||
|
||||
////MONTHLY SALARY
|
||||
StatefulBuilder(builder: (context, setState) {
|
||||
return FormBuilderTextField(
|
||||
keyboardType: TextInputType.number,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
|
@ -489,6 +513,49 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
decoration:
|
||||
normalTextFieldStyle("Monthly Salary *", "")
|
||||
.copyWith(prefix: const Text("₱ ")),
|
||||
);
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
const Text("Immediate SuperVisor"),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
////IMMEDIATE SUPERVISOR
|
||||
FormBuilderTextField(
|
||||
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(
|
||||
onChanged: (value){
|
||||
sMname = value;
|
||||
},
|
||||
name: 'supervisor_middlename',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Middle name", "Middle Name"),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
onChanged: (value){
|
||||
sLname = value;
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: 'supervisor_lastname',
|
||||
decoration:
|
||||
normalTextFieldStyle("Last name", "Last Name"),
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
|
@ -597,8 +664,7 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
to =
|
||||
DateTime.parse(value);
|
||||
to = DateTime.parse(value);
|
||||
});
|
||||
},
|
||||
initialDate: from == null
|
||||
|
@ -624,8 +690,40 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
|
||||
const Text("Work Experience"),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
onChanged: (value){
|
||||
accomplishment = value;
|
||||
},
|
||||
name: "accomplishment",
|
||||
decoration: normalTextFieldStyle(
|
||||
"List of Accomplishment and Contribution",
|
||||
"",
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
onChanged: (value){
|
||||
duties = value;
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
name: "summary",
|
||||
decoration: normalTextFieldStyle(
|
||||
"Summary of Actual Duties",
|
||||
"",
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
////SUBMIT BUTTON
|
||||
SizedBox(
|
||||
|
@ -635,11 +733,24 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
style:
|
||||
mainBtnStyle(primary, Colors.transparent, second),
|
||||
onPressed: () {
|
||||
print(selectedStatus?.value);
|
||||
print(salaryGrade);
|
||||
print(salaryGradeStep);
|
||||
|
||||
if (_formKey.currentState!.validate()) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Loading...");
|
||||
|
||||
WorkHistory workHistory = WorkHistory(
|
||||
accomplishment: null,
|
||||
actualDuties: null,
|
||||
agencydepid: null,
|
||||
supervisor: Supervisor(
|
||||
agencyId: selectedAgency?.id,
|
||||
id: null,
|
||||
lastname: sLname,
|
||||
firstname: sFname,
|
||||
middlename: sMname,
|
||||
stationName: sOffice),
|
||||
position: selectedPosition,
|
||||
id: null,
|
||||
agency: selectedAgency,
|
||||
|
@ -651,15 +762,17 @@ class _AddWorkHistoryScreenState extends State<AddWorkHistoryScreen> {
|
|||
"PRESENT"
|
||||
? null
|
||||
: DateTime.parse(toDateController.text),
|
||||
salaryGrade: salaryGrade == null
|
||||
salarygrade: salaryGrade == null
|
||||
? null
|
||||
: int.parse(salaryGrade!),
|
||||
sgStep: salaryGradeStep == null
|
||||
sgstep: salaryGradeStep == null
|
||||
? null
|
||||
: int.parse(salaryGradeStep!),
|
||||
monthlySalary: double.parse(salary!),
|
||||
appointmentStatus: selectedStatus!.value);
|
||||
monthlysalary: double.parse(salary!),
|
||||
statusAppointment: selectedStatus!.value);
|
||||
context.read<WorkHistoryBloc>().add(AddWorkHostory(
|
||||
accomplishment: accomplishment,
|
||||
actualDuties: duties,
|
||||
workHistory: workHistory,
|
||||
profileId: widget.profileId,
|
||||
token: widget.token,
|
||||
|
|
|
@ -81,7 +81,7 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
if (state is EditWorkHistoryState) {
|
||||
oldPositionController.text = state.workHistory.position!.title!;
|
||||
oldAppointmentStatusController.text =
|
||||
state.workHistory.appointmentStatus!;
|
||||
state.workHistory.statusAppointment!;
|
||||
oldAgencyController.text = state.workHistory.agency!.name!;
|
||||
currentlyEmployed = state.workHistory.toDate == null ? true : false;
|
||||
showSalaryGradeAndSalaryStep =
|
||||
|
@ -428,7 +428,7 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
child: FormBuilderTextField(
|
||||
initialValue: state
|
||||
.workHistory
|
||||
.salaryGrade
|
||||
.salarygrade
|
||||
?.toString(),
|
||||
name: 'salary_grade',
|
||||
keyboardType:
|
||||
|
@ -452,7 +452,7 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
initialValue: state
|
||||
.workHistory.sgStep
|
||||
.workHistory.sgstep
|
||||
?.toString(),
|
||||
name: 'salary_step',
|
||||
keyboardType:
|
||||
|
@ -482,7 +482,7 @@ class _EditWorkHistoryScreenState extends State<EditWorkHistoryScreen> {
|
|||
////MONTHLY SALARY
|
||||
FormBuilderTextField(
|
||||
initialValue:
|
||||
state.workHistory.monthlySalary.toString(),
|
||||
state.workHistory.monthlysalary.toString(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
salary = value;
|
||||
|
@ -654,50 +654,50 @@ 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.appointmentStatus!,
|
||||
label: state.workHistory.appointmentStatus!);
|
||||
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(
|
||||
// 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));
|
||||
// }
|
||||
},
|
||||
child: const Text(submit)),
|
||||
),
|
||||
|
|
|
@ -44,7 +44,7 @@ class WorkHistoryScreen extends StatelessWidget {
|
|||
AttachmentCategory? selectedAttachmentCategory;
|
||||
List<AttachmentCategory> attachmentCategories = [];
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
title: context.watch<WorkHistoryBloc>().state is AddWorkHistoryState
|
||||
? const FittedBox(child: Text("Add Work History"))
|
||||
|
@ -623,87 +623,87 @@ class WorkHistoryScreen extends StatelessWidget {
|
|||
]),
|
||||
const Divider(),
|
||||
////Show Attachments
|
||||
SizedBox(
|
||||
child: state
|
||||
.workExperiences[
|
||||
index]
|
||||
.attachments ==
|
||||
null ||
|
||||
state
|
||||
.workExperiences[
|
||||
index]
|
||||
.attachments!
|
||||
.isEmpty
|
||||
? const SizedBox()
|
||||
: state
|
||||
.workExperiences[
|
||||
index]
|
||||
.attachments !=
|
||||
null &&
|
||||
state
|
||||
.workExperiences[
|
||||
index]
|
||||
.attachments!
|
||||
.length ==
|
||||
1
|
||||
?
|
||||
////Single Attachment view
|
||||
SingleAttachment(
|
||||
onpressed: () {
|
||||
confirmAlert(
|
||||
context,
|
||||
() {
|
||||
parent.read<WorkHistoryBloc>().add(DeleteWorkHistoryAttachment(
|
||||
attachment: state
|
||||
.workExperiences[
|
||||
index]
|
||||
.attachments!
|
||||
.first,
|
||||
moduleId: state
|
||||
.workExperiences[
|
||||
index]
|
||||
.id!,
|
||||
profileId:
|
||||
profileId!,
|
||||
token:
|
||||
token!));
|
||||
}, "Delete?",
|
||||
"Confirm Delete?");
|
||||
},
|
||||
attachment: state
|
||||
.workExperiences[
|
||||
index]
|
||||
.attachments!
|
||||
.first,
|
||||
)
|
||||
////Multiple Attachments View
|
||||
: MultipleAttachments(
|
||||
profileId:
|
||||
profileId!,
|
||||
token: token!,
|
||||
moduleId: state
|
||||
.workExperiences[
|
||||
index]
|
||||
.id!,
|
||||
educationBloc:
|
||||
null,
|
||||
workHistoryBloc:
|
||||
BlocProvider.of<WorkHistoryBloc>(context),
|
||||
eligibilityBloc:
|
||||
null,
|
||||
learningDevelopmentBloc:
|
||||
null,
|
||||
blocId: 3,
|
||||
eligibilityName: state
|
||||
.workExperiences[
|
||||
index]
|
||||
.position!
|
||||
.title!,
|
||||
attachments: state
|
||||
.workExperiences[
|
||||
index]
|
||||
.attachments!,
|
||||
))
|
||||
// SizedBox(
|
||||
// child: state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .attachments ==
|
||||
// null ||
|
||||
// state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .attachments!
|
||||
// .isEmpty
|
||||
// ? const SizedBox()
|
||||
// : state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .attachments !=
|
||||
// null &&
|
||||
// state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .attachments!
|
||||
// .length ==
|
||||
// 1
|
||||
// ?
|
||||
// ////Single Attachment view
|
||||
// SingleAttachment(
|
||||
// onpressed: () {
|
||||
// confirmAlert(
|
||||
// context,
|
||||
// () {
|
||||
// parent.read<WorkHistoryBloc>().add(DeleteWorkHistoryAttachment(
|
||||
// attachment: state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .attachments!
|
||||
// .first,
|
||||
// moduleId: state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .id!,
|
||||
// profileId:
|
||||
// profileId!,
|
||||
// token:
|
||||
// token!));
|
||||
// }, "Delete?",
|
||||
// "Confirm Delete?");
|
||||
// },
|
||||
// attachment: state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .attachments!
|
||||
// .first,
|
||||
// )
|
||||
// ////Multiple Attachments View
|
||||
// : MultipleAttachments(
|
||||
// profileId:
|
||||
// profileId!,
|
||||
// token: token!,
|
||||
// moduleId: state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .id!,
|
||||
// educationBloc:
|
||||
// null,
|
||||
// workHistoryBloc:
|
||||
// BlocProvider.of<WorkHistoryBloc>(context),
|
||||
// eligibilityBloc:
|
||||
// null,
|
||||
// learningDevelopmentBloc:
|
||||
// null,
|
||||
// blocId: 3,
|
||||
// eligibilityName: state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .position!
|
||||
// .title!,
|
||||
// attachments: state
|
||||
// .workExperiences[
|
||||
// index]
|
||||
// .attachments!,
|
||||
// ))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:unit2/bloc/profile/education/education_bloc.dart';
|
|||
import 'package:unit2/bloc/profile/eligibility/eligibility_bloc.dart';
|
||||
import 'package:unit2/bloc/profile/learningDevelopment/learning_development_bloc.dart';
|
||||
import 'package:unit2/bloc/profile/workHistory/workHistory_bloc.dart';
|
||||
import 'package:unit2/screens/profile/shared/view_attachment.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
|
||||
import '../../../model/profile/attachment.dart';
|
||||
|
@ -16,6 +17,7 @@ import '../../../utils/alerts.dart';
|
|||
import '../../../utils/global.dart';
|
||||
|
||||
class MultipleAttachments extends StatelessWidget {
|
||||
final Function(String source, String fileName) viewAttachment;
|
||||
final List<Attachment> attachments;
|
||||
final String eligibilityName;
|
||||
final EducationBloc? educationBloc;
|
||||
|
@ -28,6 +30,7 @@ class MultipleAttachments extends StatelessWidget {
|
|||
final String token;
|
||||
const MultipleAttachments(
|
||||
{super.key,
|
||||
required this.viewAttachment,
|
||||
required this.blocId,
|
||||
required this.educationBloc,
|
||||
required this.eligibilityBloc,
|
||||
|
@ -128,9 +131,14 @@ class MultipleAttachments extends StatelessWidget {
|
|||
flex: 4,
|
||||
child: Tooltip(
|
||||
message: e.filename,
|
||||
child: GestureDetector(
|
||||
onTap: (){
|
||||
viewAttachment(e.source!,e.filename!);
|
||||
},
|
||||
child: Text(
|
||||
e.filename!,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)),
|
||||
),
|
||||
const SizedBox(
|
||||
|
|
|
@ -10,9 +10,11 @@ import '../../../utils/alerts.dart';
|
|||
class SingleAttachment extends StatelessWidget {
|
||||
final Function()? onpressed;
|
||||
final Attachment attachment;
|
||||
final Function()? view;
|
||||
const SingleAttachment({
|
||||
required this.attachment,
|
||||
required this.onpressed,
|
||||
required this.view,
|
||||
super.key,
|
||||
});
|
||||
|
||||
|
@ -32,12 +34,15 @@ class SingleAttachment extends StatelessWidget {
|
|||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
AutoSizeText(
|
||||
GestureDetector(
|
||||
onTap: view,
|
||||
child: AutoSizeText(
|
||||
attachment.filename!,
|
||||
wrapWords: false,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
8,
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
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,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -32,6 +32,7 @@ class RbacRoleAssignment extends StatelessWidget {
|
|||
List<ValueItem> selectedValueItemRoles = [];
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
title: const Text("User Roles Screenss"),
|
||||
|
|
|
@ -8,13 +8,10 @@ import 'package:unit2/screens/unit2/homepage.dart/components/dashboard/superadmi
|
|||
import 'package:unit2/screens/unit2/homepage.dart/module-screen.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import '../../../../../bloc/rbac/rbac_operations/agency/agency_bloc.dart';
|
||||
import '../../../../../bloc/role/pass_check/est_point_person/assign_area/assign_area_agency_bloc.dart';
|
||||
import '../../../../../bloc/role/pass_check/est_point_person/est_point_person_assignable/est_point_person_assinable_role_bloc.dart';
|
||||
import '../../../../../bloc/role/pass_check/est_point_person/est_point_person_role_assignment/est_role_assignment_bloc.dart';
|
||||
import '../../../../../bloc/role/pass_check/est_point_person/est_point_person_station/est_point_person_station_bloc.dart';
|
||||
import '../../../../../sevices/roles/est_point_person/est_point_person_role_assignment_services.dart';
|
||||
import '../../../../superadmin/agency/agency_screen.dart';
|
||||
import '../../../roles/establishment_point_person/est_point_person_agecies.dart';
|
||||
import '../../../roles/establishment_point_person/est_point_person_role_member_screen.dart';
|
||||
import '../../../roles/establishment_point_person/est_point_person_role_under_screen.dart';
|
||||
|
@ -71,7 +68,9 @@ class _DashBoardState extends State<DashBoard> {
|
|||
docSmsCards.add(e);
|
||||
}
|
||||
});
|
||||
|
||||
unit2Cards.forEach((element) {
|
||||
print("${element.moduleName} - ${element.object.name!} - ${element.roleName} " );
|
||||
});
|
||||
if (superadminCards.length > 3) {
|
||||
tempSuperAdminCards = superadminCards.sublist(0, 4);
|
||||
}
|
||||
|
@ -85,6 +84,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
child: ListView(
|
||||
children: [
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
////unit2 module operations
|
||||
|
@ -107,7 +107,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
),
|
||||
Container(
|
||||
child: unit2Cards.isEmpty
|
||||
? const SizedBox()
|
||||
? const SizedBox.shrink()
|
||||
: GridView.count(
|
||||
shrinkWrap: true,
|
||||
crossAxisCount: 4,
|
||||
|
@ -185,7 +185,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
child:
|
||||
FadeInAnimation(
|
||||
child: Container(
|
||||
child: (e.roleName == 'superadmin' || e.roleName == 'qr code scanner' || e.roleName == 'security guard' || e.roleName == 'establishment point-person' || e.roleName == 'registration in-charge') && e.moduleName == 'unit2'
|
||||
child: (e.roleName == 'qr code scanner' || e.roleName == 'security guard' || e.roleName == 'establishment point-person' || e.roleName == 'registration in-charge') && e.moduleName == 'unit2'
|
||||
? CardLabel(
|
||||
icon: iconGenerator(name: e.object.name!),
|
||||
title: e.object.name!.toLowerCase() == 'role based access control'
|
||||
|
@ -195,7 +195,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
: e.object.name!,
|
||||
ontap: () {
|
||||
if (e.object.name!.toLowerCase() == 'pass check') {
|
||||
PassCheckArguments passCheckArguments = PassCheckArguments(roleId: 10, userId: widget.userId);
|
||||
PassCheckArguments passCheckArguments = PassCheckArguments(roleId: e.roleId, userId: widget.userId);
|
||||
Navigator.pushNamed(context, '/pass-check', arguments: passCheckArguments);
|
||||
}
|
||||
if (e.object.name!.toLowerCase() == 'role based access control') {
|
||||
|
@ -213,16 +213,19 @@ class _DashBoardState extends State<DashBoard> {
|
|||
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) {
|
||||
return BlocProvider<EstRoleAssignmentBloc>(
|
||||
create: (context) => EstRoleAssignmentBloc()..add(GetEstPointPersonRolesUnder(userId: widget.userId)),
|
||||
child: EstPointPersonRoleAssignmentScreen(id: widget.userId,),
|
||||
child: EstPointPersonRoleAssignmentScreen(
|
||||
id: widget.userId,
|
||||
),
|
||||
);
|
||||
}));
|
||||
}
|
||||
if (e.object.name!.toLowerCase() == 'assignable role') {
|
||||
|
||||
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) {
|
||||
return BlocProvider<EstPointPersonAssinableRoleBloc>(
|
||||
create: (context) => EstPointPersonAssinableRoleBloc()..add(const GetEstPointPersonAssignableRoles(roleId: 16)),
|
||||
child: EstPointPersonRoleUnderScreen(id: widget.userId,),
|
||||
child: EstPointPersonRoleUnderScreen(
|
||||
id: widget.userId,
|
||||
),
|
||||
);
|
||||
}));
|
||||
}
|
||||
|
@ -421,11 +424,11 @@ class _DashBoardState extends State<DashBoard> {
|
|||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: unit2Cards.isEmpty ? 0 : 24,
|
||||
height: superadminCards.isEmpty ? 0 : 24,
|
||||
),
|
||||
Container(
|
||||
child: superadminCards.isEmpty
|
||||
? const SizedBox()
|
||||
? const SizedBox.shrink()
|
||||
: Text(
|
||||
"Superadmin module operations",
|
||||
style: Theme.of(context)
|
||||
|
@ -442,7 +445,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
),
|
||||
Container(
|
||||
child: superadminCards.isEmpty
|
||||
? const SizedBox()
|
||||
? const SizedBox.shrink()
|
||||
: GridView.count(
|
||||
shrinkWrap: true,
|
||||
crossAxisCount: 4,
|
||||
|
@ -602,12 +605,12 @@ class _DashBoardState extends State<DashBoard> {
|
|||
columnCount: 4,
|
||||
));
|
||||
}).toList())),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
SizedBox(
|
||||
height: rpassCards.isEmpty?0: 24,
|
||||
),
|
||||
Container(
|
||||
child: rpassCards.isEmpty
|
||||
? const SizedBox()
|
||||
? const SizedBox.shrink()
|
||||
: Text(
|
||||
"RPAss module operations",
|
||||
style: Theme.of(context)
|
||||
|
@ -624,7 +627,7 @@ class _DashBoardState extends State<DashBoard> {
|
|||
),
|
||||
Container(
|
||||
child: rpassCards.isEmpty
|
||||
? const SizedBox()
|
||||
? const SizedBox.shrink()
|
||||
: GridView.count(
|
||||
shrinkWrap: true,
|
||||
crossAxisCount: 4,
|
||||
|
@ -649,12 +652,12 @@ class _DashBoardState extends State<DashBoard> {
|
|||
}).toList(),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
SizedBox(
|
||||
height: docSmsCards.isEmpty?0: 24,
|
||||
),
|
||||
Container(
|
||||
child: docSmsCards.isEmpty
|
||||
? const SizedBox()
|
||||
? const SizedBox.shrink()
|
||||
: Text(
|
||||
"DocSMS module operations",
|
||||
style: Theme.of(context)
|
||||
|
|
|
@ -77,7 +77,9 @@ class SuperAdminMenu extends StatelessWidget {
|
|||
title:
|
||||
object.object.name!,
|
||||
ontap: () {
|
||||
|
||||
if (object.object.name == 'Role') {
|
||||
|
||||
Navigator.push(context, MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return BlocProvider(
|
||||
|
|
|
@ -43,6 +43,7 @@ class _MainScreenState extends State<MainScreen> {
|
|||
for (var module in role.modules!) {
|
||||
for (var object in module!.objects!) {
|
||||
DisplayCard newCard = DisplayCard(
|
||||
roleId: role.id!,
|
||||
moduleName: module.name!.toLowerCase(),
|
||||
object: object!,
|
||||
roleName: role.name!.toLowerCase());
|
||||
|
@ -91,8 +92,9 @@ class DisplayCard {
|
|||
final String roleName;
|
||||
final String moduleName;
|
||||
final ModuleObject object;
|
||||
final int roleId;
|
||||
const DisplayCard(
|
||||
{required this.moduleName, required this.object, required this.roleName});
|
||||
{required this.moduleName, required this.object, required this.roleName,required this.roleId});
|
||||
}
|
||||
|
||||
class Module {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:unit2/model/profile/work_history.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:unit2/model/utils/agency_position.dart';
|
||||
|
@ -48,17 +49,17 @@ class WorkHistoryService {
|
|||
bool? success;
|
||||
Map<String, dynamic> params = {"force_mode": "true"};
|
||||
String authToken = "Token $token";
|
||||
String path = "${Url.instance.workhistory()}$profileId/";
|
||||
String path = "${Url.instance.deleteWorkHistory()}$profileId/";
|
||||
Map body = {
|
||||
"id": work.id,
|
||||
"position_id": work.position!.id,
|
||||
"agency_id": work.agency!.id,
|
||||
"from_date": work.fromDate?.toString(),
|
||||
"to_date": work.toDate?.toString(),
|
||||
"monthly_salary": work.monthlySalary,
|
||||
"appointment_status": work.appointmentStatus,
|
||||
"salary_step": work.sgStep,
|
||||
"salary_grade": work.salaryGrade,
|
||||
// "monthly_salary": work.monthlysalary,
|
||||
// "appointment_status": work.statusAppointment,
|
||||
// "salary_step": work.sgstep,
|
||||
// "salary_grade": work.salarygrade,
|
||||
};
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
|
@ -82,85 +83,212 @@ class WorkHistoryService {
|
|||
|
||||
|
||||
////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={};
|
||||
String authtoken = "Token $token";
|
||||
String path = '${Url.instance.workhistory()}$profileId/';
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': authtoken
|
||||
};
|
||||
Map body = {
|
||||
"id":newWorkHistory.id,
|
||||
"position_id":newWorkHistory.position!.id,
|
||||
"agency_id":newWorkHistory.agency!.id,
|
||||
"from_date":newWorkHistory.fromDate?.toString(),
|
||||
"to_date":newWorkHistory.toDate?.toString(),
|
||||
"monthly_salary":newWorkHistory.monthlySalary,
|
||||
"appointment_status":newWorkHistory.appointmentStatus,
|
||||
"salary_grade":newWorkHistory.salaryGrade,
|
||||
"sg_step":newWorkHistory.sgStep,
|
||||
"_positionName":newWorkHistory.position!.title!,
|
||||
"_agencyName":newWorkHistory.agency!.name!,
|
||||
"_agencyCatId":newWorkHistory.agency!.category!.id!,
|
||||
"_privateEntity":newWorkHistory.agency!.privateEntity,
|
||||
"oldPosId":oldWorkHistory.position!.id,
|
||||
"_oldAgencyId":oldWorkHistory.agency!.id,
|
||||
"oldFromDate":oldWorkHistory.fromDate?.toString(),
|
||||
};
|
||||
try{
|
||||
http.Response response = await Request.instance.putRequest(path: path, headers: headers, body: body, param: {});
|
||||
if(response.statusCode == 200 ){
|
||||
Map data = jsonDecode(response.body);
|
||||
statusResponse = data;
|
||||
}else{
|
||||
statusResponse.addAll({'success':false});
|
||||
}
|
||||
return statusResponse;
|
||||
}catch(e){
|
||||
throw e.toString();
|
||||
}
|
||||
}
|
||||
// Future<Map<dynamic,dynamic>> update({required WorkHistory oldWorkHistory, required WorkHistory newWorkHistory, required String token, required String profileId})async{
|
||||
// Map<dynamic, dynamic>? statusResponse={};
|
||||
// String authtoken = "Token $token";
|
||||
// String path = '${Url.instance.workhistory()}$profileId/';
|
||||
// Map<String, String> headers = {
|
||||
// 'Content-Type': 'application/json; charset=UTF-8',
|
||||
// 'Authorization': authtoken
|
||||
// };
|
||||
// Map body = {
|
||||
// "id":newWorkHistory.id,
|
||||
// "position_id":newWorkHistory.position!.id,
|
||||
// "agency_id":newWorkHistory.agency!.id,
|
||||
// "from_date":newWorkHistory.fromDate?.toString(),
|
||||
// "to_date":newWorkHistory.toDate?.toString(),
|
||||
// "monthly_salary":newWorkHistory.monthlysalary,
|
||||
// "appointment_status":newWorkHistory.statusAppointment,
|
||||
// "salary_grade":newWorkHistory.salarygrade,
|
||||
// "sg_step":newWorkHistory.sgstep,
|
||||
// "_positionName":newWorkHistory.position!.title!,
|
||||
// "_agencyName":newWorkHistory.agency!.name!,
|
||||
// "_agencyCatId":newWorkHistory.agency!.category!.id!,
|
||||
// "_privateEntity":newWorkHistory.agency!.privateEntity,
|
||||
// "oldPosId":oldWorkHistory.position!.id,
|
||||
// "_oldAgencyId":oldWorkHistory.agency!.id,
|
||||
// "oldFromDate":oldWorkHistory.fromDate?.toString(),
|
||||
// };
|
||||
|
||||
|
||||
// try{
|
||||
// http.Response response = await Request.instance.putRequest(path: path, headers: headers, body: body, param: {});
|
||||
// if(response.statusCode == 200 ){
|
||||
// Map data = jsonDecode(response.body);
|
||||
// statusResponse = data;
|
||||
// }else{
|
||||
// statusResponse.addAll({'success':false});
|
||||
// }
|
||||
// return statusResponse;
|
||||
// }catch(e){
|
||||
// throw e.toString();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
////Add work history
|
||||
Future<Map<dynamic, dynamic>>add({required WorkHistory workHistory, required String token, required int profileId , required bool isPrivate})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 body = {
|
||||
'position_id':workHistory.position?.id,
|
||||
'agency_id': workHistory.agency?.id,
|
||||
'from_date': workHistory.fromDate?.toString(),
|
||||
'to_date': workHistory.toDate?.toString(),
|
||||
'monthly_salary': workHistory.monthlySalary,
|
||||
'appointment_status': workHistory.appointmentStatus,
|
||||
'salary_grade': workHistory.salaryGrade,
|
||||
'sg_step':workHistory.sgStep,
|
||||
'_positionName':workHistory.position?.title,
|
||||
'_agencyName':workHistory.agency?.name,
|
||||
'_agencyCatId':workHistory.agency?.category?.id,
|
||||
'_privateEntity':workHistory.agency?.privateEntity,
|
||||
};
|
||||
try{
|
||||
http.Response response = await Request.instance.postRequest(path: path,param: {},body: body,headers: headers);
|
||||
if(response.statusCode == 201){
|
||||
Map data = jsonDecode(response.body);
|
||||
statusResponse = data;
|
||||
|
||||
}else{
|
||||
statusResponse.addAll({'success':false});
|
||||
String fromDate = DateFormat('yyyy-MM-dd').format(workHistory.fromDate!);
|
||||
String? toDate;
|
||||
if(workHistory.toDate != null){
|
||||
toDate = DateFormat('yyyy-MM-dd').format(workHistory.toDate!);
|
||||
}
|
||||
if(workHistory.toDate == null){
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null? "":workHistory.agency!.category!.id.toString(),
|
||||
"a_name" : workHistory.agency?.name == null? "":workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null?"":workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment" : accomplishment??"",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id" : workHistory.agency?.id == null?"": workHistory.agency!.id.toString() ,
|
||||
"from_date" : fromDate,
|
||||
"monthly_salary" : workHistory.monthlysalary == null? "": workHistory.monthlysalary.toString(),
|
||||
"position_id" : workHistory.position?.id == null? "": workHistory.position!.id.toString(),
|
||||
"position_name" : workHistory.position?.title == null? "":workHistory.position!.title!,
|
||||
"s_fname" : workHistory.supervisor?.firstname == null?"":workHistory.supervisor!.firstname!,
|
||||
"s_lname" : workHistory.supervisor?.lastname == null? "":workHistory.supervisor!.lastname!,
|
||||
"s_mname" : workHistory.supervisor?.middlename == null?"":workHistory.supervisor!.middlename!,
|
||||
"s_office" : workHistory.supervisor?.stationName == null?"":workHistory.supervisor!.stationName!,
|
||||
"salary_grade" : workHistory.salarygrade == null? "":workHistory.salarygrade.toString(),
|
||||
"sg_step" : workHistory.sgstep == null?"":workHistory.sgstep.toString() ,
|
||||
'status_appointment' : workHistory.statusAppointment??"",
|
||||
};
|
||||
}else{
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null? "":workHistory.agency!.category!.id.toString(),
|
||||
"a_name" : workHistory.agency?.name == null? "":workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null?"":workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment" : accomplishment??"",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id" : workHistory.agency?.id == null?"": workHistory.agency!.id.toString() ,
|
||||
"from_date" : workHistory.fromDate == null? "2018-10-04":"2018-06-04",
|
||||
"monthly_salary" : workHistory.monthlysalary == null? "": workHistory.monthlysalary.toString(),
|
||||
"position_id" : workHistory.position?.id == null? "": workHistory.position!.id.toString(),
|
||||
"position_name" : workHistory.position?.title == null? "":workHistory.position!.title!,
|
||||
"s_fname" : workHistory.supervisor?.firstname == null?"":workHistory.supervisor!.firstname!,
|
||||
"s_lname" : workHistory.supervisor?.lastname == null? "":workHistory.supervisor!.lastname!,
|
||||
"s_mname" : workHistory.supervisor?.middlename == null?"":workHistory.supervisor!.middlename!,
|
||||
"s_office" : workHistory.supervisor?.stationName == null?"":workHistory.supervisor!.stationName!,
|
||||
"salary_grade" : workHistory.salarygrade == null? "":workHistory.salarygrade.toString(),
|
||||
"sg_step" : workHistory.sgstep == null?"":workHistory.sgstep.toString() ,
|
||||
'status_appointment' : workHistory.statusAppointment??"",
|
||||
"to_date" : toDate!,
|
||||
};
|
||||
}
|
||||
|
||||
var request = http.MultipartRequest('POST',Uri.parse('${Url.instance.prefixHost()}://${Url.instance.host()}$path'));
|
||||
request.fields.addAll(body);
|
||||
request.headers.addAll(headers);
|
||||
try {
|
||||
http.StreamedResponse response = await request.send();
|
||||
final steamResponse = await response.stream.bytesToString();
|
||||
Map data = jsonDecode(steamResponse);
|
||||
if (response.statusCode == 201) {
|
||||
statusResponse = data;
|
||||
} else {
|
||||
String message = data['response']['details'];
|
||||
statusResponse.addAll({'message': message});
|
||||
statusResponse.addAll(
|
||||
{'success': false},
|
||||
);
|
||||
}
|
||||
return statusResponse;
|
||||
} catch (e) {
|
||||
throw e.toString();
|
||||
}
|
||||
|
||||
return statusResponse;
|
||||
}
|
||||
|
||||
Future<Map<dynamic, dynamic>>update({required WorkHistory workHistory, required String token, required int profileId , required bool isPrivate,required String? accomplishment, required String? actualDuties})async{
|
||||
String authtoken = "Token $token";
|
||||
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 = {};
|
||||
String fromDate = DateFormat('yyyy-MM-dd').format(workHistory.fromDate!);
|
||||
String? toDate;
|
||||
if(workHistory.toDate != null){
|
||||
toDate = DateFormat('yyyy-MM-dd').format(workHistory.toDate!);
|
||||
}
|
||||
if(workHistory.toDate == null){
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null? "":workHistory.agency!.category!.id.toString(),
|
||||
"a_name" : workHistory.agency?.name == null? "":workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null?"":workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment" : accomplishment??"",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id" : workHistory.agency?.id == null?"": workHistory.agency!.id.toString() ,
|
||||
"from_date" : fromDate,
|
||||
"monthly_salary" : workHistory.monthlysalary == null? "": workHistory.monthlysalary.toString(),
|
||||
"position_id" : workHistory.position?.id == null? "": workHistory.position!.id.toString(),
|
||||
"position_name" : workHistory.position?.title == null? "":workHistory.position!.title!,
|
||||
"s_fname" : workHistory.supervisor?.firstname == null?"":workHistory.supervisor!.firstname!,
|
||||
"s_lname" : workHistory.supervisor?.lastname == null? "":workHistory.supervisor!.lastname!,
|
||||
"s_mname" : workHistory.supervisor?.middlename == null?"":workHistory.supervisor!.middlename!,
|
||||
"s_office" : workHistory.supervisor?.stationName == null?"":workHistory.supervisor!.stationName!,
|
||||
"salary_grade" : workHistory.salarygrade == null? "":workHistory.salarygrade.toString(),
|
||||
"sg_step" : workHistory.sgstep == null?"":workHistory.sgstep.toString() ,
|
||||
'status_appointment' : workHistory.statusAppointment??"",
|
||||
};
|
||||
}else{
|
||||
body = {
|
||||
"a_category_id ": workHistory.agency?.category?.id == null? "":workHistory.agency!.category!.id.toString(),
|
||||
"a_name" : workHistory.agency?.name == null? "":workHistory.agency!.name!,
|
||||
" a_private_entity ": workHistory.agency?.privateEntity == null?"":workHistory.agency!.privateEntity.toString(),
|
||||
"accomplishment" : accomplishment??"",
|
||||
"actual_duties ": actualDuties!,
|
||||
"agency_id" : workHistory.agency?.id == null?"": workHistory.agency!.id.toString() ,
|
||||
"from_date" : workHistory.fromDate == null? "2018-10-04":"2018-06-04",
|
||||
"monthly_salary" : workHistory.monthlysalary == null? "": workHistory.monthlysalary.toString(),
|
||||
"position_id" : workHistory.position?.id == null? "": workHistory.position!.id.toString(),
|
||||
"position_name" : workHistory.position?.title == null? "":workHistory.position!.title!,
|
||||
"s_fname" : workHistory.supervisor?.firstname == null?"":workHistory.supervisor!.firstname!,
|
||||
"s_lname" : workHistory.supervisor?.lastname == null? "":workHistory.supervisor!.lastname!,
|
||||
"s_mname" : workHistory.supervisor?.middlename == null?"":workHistory.supervisor!.middlename!,
|
||||
"s_office" : workHistory.supervisor?.stationName == null?"":workHistory.supervisor!.stationName!,
|
||||
"salary_grade" : workHistory.salarygrade == null? "":workHistory.salarygrade.toString(),
|
||||
"sg_step" : workHistory.sgstep == null?"":workHistory.sgstep.toString() ,
|
||||
'status_appointment' : workHistory.statusAppointment??"",
|
||||
"to_date" : toDate!,
|
||||
};
|
||||
}
|
||||
|
||||
var request = http.MultipartRequest('PUT',Uri.parse('${Url.instance.prefixHost()}://${Url.instance.host()}$path'));
|
||||
request.fields.addAll(body);
|
||||
request.headers.addAll(headers);
|
||||
try {
|
||||
http.StreamedResponse response = await request.send();
|
||||
final steamResponse = await response.stream.bytesToString();
|
||||
Map data = jsonDecode(steamResponse);
|
||||
if (response.statusCode == 201) {
|
||||
statusResponse = data;
|
||||
} else {
|
||||
String message = data['response']['details'];
|
||||
statusResponse.addAll({'message': message});
|
||||
statusResponse.addAll(
|
||||
{'success': false},
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
throw e.toString();
|
||||
}
|
||||
return statusResponse;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////get agency position
|
||||
Future<List<PositionTitle>> getAgencyPosition() async {
|
||||
List<PositionTitle> agencyPositions = [];
|
||||
|
|
|
@ -32,7 +32,7 @@ class PassCheckServices {
|
|||
'X-Client-Key': xClientKey,
|
||||
'X-Client-Secret': xClientSecret
|
||||
};
|
||||
// try {
|
||||
try {
|
||||
http.Response response = await Request.instance
|
||||
.getRequest(param: params, headers: headers, path: path);
|
||||
if (response.statusCode == 200) {
|
||||
|
@ -133,9 +133,9 @@ class PassCheckServices {
|
|||
statusResponse = assignedArea;
|
||||
}
|
||||
}
|
||||
// } catch (e) {
|
||||
// throw e.toString();
|
||||
// }
|
||||
} catch (e) {
|
||||
throw e.toString();
|
||||
}
|
||||
return statusResponse!;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:unit2/utils/request.dart';
|
||||
import 'package:unit2/utils/request_permission.dart';
|
||||
import 'package:unit2/utils/urls.dart';
|
||||
|
||||
import '../model/profile/attachment.dart';
|
||||
|
@ -12,7 +16,7 @@ class AttachmentServices {
|
|||
|
||||
Future<List<AttachmentCategory>> getCategories() async {
|
||||
List<AttachmentCategory> attachmentCategories = [];
|
||||
String path = Url.instance.attachmentCategories()+"11232";
|
||||
String path = Url.instance.attachmentCategories();
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
};
|
||||
|
@ -113,7 +117,7 @@ class AttachmentServices {
|
|||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': authtoken
|
||||
};
|
||||
// try {
|
||||
try {
|
||||
http.Response response = await Request.instance.deleteRequest(
|
||||
path: path, headers: headers, body: body, param: params);
|
||||
if (response.statusCode == 200) {
|
||||
|
@ -122,9 +126,29 @@ class AttachmentServices {
|
|||
} else {
|
||||
success = false;
|
||||
}
|
||||
// } catch (e) {
|
||||
// throw (e.toString());
|
||||
// }
|
||||
} catch (e) {
|
||||
throw (e.toString());
|
||||
}
|
||||
return success!;
|
||||
}
|
||||
|
||||
Future<bool> downloadAttachment(
|
||||
{required String filename,
|
||||
required String source,
|
||||
required String downLoadDir}) async {
|
||||
bool success = false;
|
||||
var dio = Dio();
|
||||
Response response;
|
||||
try {
|
||||
if (await requestPermission(Permission.storage)) {
|
||||
response = await dio.download(source, "$downLoadDir/$filename");
|
||||
if (response.statusCode == 200) {
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
return success;
|
||||
} catch (e) {
|
||||
throw e.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class Request {
|
|||
Map<String, String>? param}) async {
|
||||
Response response;
|
||||
try {
|
||||
response = await get(Uri.http(host, path!, param), headers: headers)
|
||||
response = await get(Uri.https(host, path!, param), headers: headers)
|
||||
.timeout(Duration(seconds: requestTimeout));
|
||||
} on TimeoutException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
|
@ -61,7 +61,7 @@ class Request {
|
|||
Map<String, String>? param}) async {
|
||||
Response response;
|
||||
try {
|
||||
response = await post(Uri.http(host, path!, param),
|
||||
response = await post(Uri.https(host, path!, param),
|
||||
headers: headers, body: jsonEncode(body))
|
||||
.timeout(Duration(seconds: requestTimeout));
|
||||
} on TimeoutException catch (_) {
|
||||
|
@ -104,7 +104,7 @@ class Request {
|
|||
required Map<String, dynamic>? param}) async {
|
||||
Response response;
|
||||
try {
|
||||
response =await put(Uri.http(host,path,param),headers: headers,body: jsonEncode(body));
|
||||
response =await put(Uri.https(host,path,param),headers: headers,body: jsonEncode(body));
|
||||
} on TimeoutException catch (_) {
|
||||
Fluttertoast.showToast(
|
||||
msg: timeoutError,
|
||||
|
@ -186,7 +186,7 @@ class Request {
|
|||
required Map<String, dynamic>? param}) async {
|
||||
Response response;
|
||||
try {
|
||||
response = await delete(Uri.http(host, path, param),
|
||||
response = await delete(Uri.https(host, path, param),
|
||||
headers: headers, body: jsonEncode(body))
|
||||
.timeout(Duration(seconds: requestTimeout));
|
||||
} on TimeoutException catch (_) {
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
Future<bool> requestPermission(Permission permission) async {
|
||||
if (await permission.isGranted) {
|
||||
return true;
|
||||
} else {
|
||||
var result = await permission.request();
|
||||
if (result == PermissionStatus.granted) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
|
@ -5,13 +5,17 @@ class Url {
|
|||
|
||||
String host() {
|
||||
// return '192.168.10.183:3000';
|
||||
// return 'agusandelnorte.gov.ph';
|
||||
return "192.168.10.219:3000";
|
||||
return 'agusandelnorte.gov.ph';
|
||||
// return "192.168.10.219:3000";
|
||||
// return "192.168.10.241";
|
||||
// return "192.168.10.221:3004";
|
||||
// return "playweb.agusandelnorte.gov.ph";
|
||||
// return 'devapi.agusandelnorte.gov.ph:3004';
|
||||
}
|
||||
String prefixHost(){
|
||||
return "https";
|
||||
// return "https";
|
||||
}
|
||||
|
||||
String authentication() {
|
||||
return '/api/account/auth/login/';
|
||||
|
@ -58,6 +62,9 @@ class Url {
|
|||
|
||||
//// work history paths
|
||||
String workhistory() {
|
||||
return "/api/jobnet_app/profile/pds/work_experience/";
|
||||
}
|
||||
String deleteWorkHistory(){
|
||||
return "/api/jobnet_app/profile/pds/work/";
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <audioplayers_linux/audioplayers_linux_plugin.h>
|
||||
#include <modal_progress_hud_nsn/modal_progress_hud_nsn_plugin.h>
|
||||
#include <platform_device_id_linux/platform_device_id_linux_plugin.h>
|
||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
|
||||
|
@ -20,4 +21,7 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||
g_autoptr(FlPluginRegistrar) platform_device_id_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "PlatformDeviceIdLinuxPlugin");
|
||||
platform_device_id_linux_plugin_register_with_registrar(platform_device_id_linux_registrar);
|
||||
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||
audioplayers_linux
|
||||
modal_progress_hud_nsn
|
||||
platform_device_id_linux
|
||||
url_launcher_linux
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
|
|
@ -8,6 +8,7 @@ import Foundation
|
|||
import assets_audio_player
|
||||
import assets_audio_player_web
|
||||
import audioplayers_darwin
|
||||
import device_info_plus
|
||||
import location
|
||||
import modal_progress_hud_nsn
|
||||
import package_info_plus
|
||||
|
@ -15,13 +16,17 @@ import path_provider_foundation
|
|||
import platform_device_id
|
||||
import platform_device_id_macos
|
||||
import rive_common
|
||||
import share_plus
|
||||
import shared_preferences_foundation
|
||||
import sqflite
|
||||
import syncfusion_pdfviewer_macos
|
||||
import url_launcher_macos
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
AssetsAudioPlayerPlugin.register(with: registry.registrar(forPlugin: "AssetsAudioPlayerPlugin"))
|
||||
AssetsAudioPlayerWebPlugin.register(with: registry.registrar(forPlugin: "AssetsAudioPlayerWebPlugin"))
|
||||
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
|
||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
|
||||
ModalProgressHudNsnPlugin.register(with: registry.registrar(forPlugin: "ModalProgressHudNsnPlugin"))
|
||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||
|
@ -29,6 +34,9 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||
PlatformDeviceIdMacosPlugin.register(with: registry.registrar(forPlugin: "PlatformDeviceIdMacosPlugin"))
|
||||
PlatformDeviceIdMacosPlugin.register(with: registry.registrar(forPlugin: "PlatformDeviceIdMacosPlugin"))
|
||||
RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
|
||||
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||
SyncfusionFlutterPdfViewerPlugin.register(with: registry.registrar(forPlugin: "SyncfusionFlutterPdfViewerPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
}
|
||||
|
|
160
pubspec.lock
|
@ -337,6 +337,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
cross_file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cross_file
|
||||
sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.3+4"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -385,6 +393,22 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
device_info_plus:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: device_info_plus
|
||||
sha256: f52ab3b76b36ede4d135aab80194df8925b553686f0fa12226b4e2d658e45903
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.2.2"
|
||||
device_info_plus_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: device_info_plus_platform_interface
|
||||
sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
device_preview:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -1253,6 +1277,22 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.8"
|
||||
share_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: share_plus
|
||||
sha256: "6cec740fa0943a826951223e76218df002804adb588235a8910dc3d6b0654e11"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.1.0"
|
||||
share_plus_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: share_plus_platform_interface
|
||||
sha256: "357412af4178d8e11d14f41723f80f12caea54cf0d5cd29af9dcdab85d58aea7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.3.0"
|
||||
shared_preferences:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1418,6 +1458,62 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
syncfusion_flutter_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_flutter_core
|
||||
sha256: "8db8f55c77f56968681447d3837c10f27a9e861e238a898fda116c7531def979"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "21.2.10"
|
||||
syncfusion_flutter_pdf:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_flutter_pdf
|
||||
sha256: a42186922a416c2c9634a8f221aee261101babc2d30b1a1e908a7f034e743046
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "21.2.4"
|
||||
syncfusion_flutter_pdfviewer:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: syncfusion_flutter_pdfviewer
|
||||
sha256: "2dc016f251c675f8e4923135c485356473b4d89c677670164292159cd1dd4f45"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "21.2.3"
|
||||
syncfusion_pdfviewer_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_pdfviewer_macos
|
||||
sha256: "8cc925cae532c0fa17e849165796d962107f45b86e66ee334dcaabf6b7305c82"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "21.2.10"
|
||||
syncfusion_pdfviewer_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_pdfviewer_platform_interface
|
||||
sha256: "08039ecdb8f79454fb367c6bf5a833846a666039415d2b5d76a7e59a5b3ff710"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "21.2.10"
|
||||
syncfusion_pdfviewer_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_pdfviewer_web
|
||||
sha256: "8e5ed0d313a1aa3869e4f2e8d079bc9bfa37ce79d91be7bb328e456f37b7995f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "21.2.10"
|
||||
syncfusion_pdfviewer_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_pdfviewer_windows
|
||||
sha256: "3e93f281135fb0562f7e6c343d2db741cf3cbd78c5b04884eef9af414408bc77"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "21.2.10"
|
||||
synchronized:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1474,6 +1570,70 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.2"
|
||||
url_launcher:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: url_launcher
|
||||
sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.11"
|
||||
url_launcher_android:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: url_launcher_android
|
||||
sha256: "3dd2388cc0c42912eee04434531a26a82512b9cb1827e0214430c9bcbddfe025"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.38"
|
||||
url_launcher_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_ios
|
||||
sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.4"
|
||||
url_launcher_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_linux
|
||||
sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.5"
|
||||
url_launcher_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_macos
|
||||
sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.6"
|
||||
url_launcher_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_platform_interface
|
||||
sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
url_launcher_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_web
|
||||
sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.18"
|
||||
url_launcher_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_windows
|
||||
sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.7"
|
||||
uuid:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -89,6 +89,10 @@ dependencies:
|
|||
file_picker: ^5.3.1
|
||||
expandable: ^5.0.1
|
||||
flutter_simple_treeview: ^3.0.2
|
||||
syncfusion_flutter_pdfviewer: ^21.2.3
|
||||
url_launcher: ^6.1.11
|
||||
url_launcher_android: ^6.0.38
|
||||
share_plus: ^7.1.0
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||
#include <platform_device_id_windows/platform_device_id_windows_plugin.h>
|
||||
#include <rive_common/rive_plugin.h>
|
||||
#include <share_plus/share_plus_windows_plugin_c_api.h>
|
||||
#include <syncfusion_pdfviewer_windows/syncfusion_pdfviewer_windows_plugin.h>
|
||||
#include <url_launcher_windows/url_launcher_windows.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
AudioplayersWindowsPluginRegisterWithRegistrar(
|
||||
|
@ -23,4 +26,10 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|||
registry->GetRegistrarForPlugin("PlatformDeviceIdWindowsPlugin"));
|
||||
RivePluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("RivePlugin"));
|
||||
SharePlusWindowsPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
|
||||
SyncfusionPdfviewerWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("SyncfusionPdfviewerWindowsPlugin"));
|
||||
UrlLauncherWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
||||
}
|
||||
|
|
|
@ -8,6 +8,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||
permission_handler_windows
|
||||
platform_device_id_windows
|
||||
rive_common
|
||||
share_plus
|
||||
syncfusion_pdfviewer_windows
|
||||
url_launcher_windows
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
|