diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c8b8a8f..4cf4c30 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -68,7 +68,6 @@ 7435055C04EA907D4DF9DEFB /* Pods-Runner.release.xcconfig */, 24CA4A0209E683A311335098 /* Pods-Runner.profile.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -358,13 +357,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2WLSMMLG6W; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.unit2; + PRODUCT_BUNDLE_IDENTIFIER = "uniT-App"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -486,13 +486,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2WLSMMLG6W; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.unit2; + PRODUCT_BUNDLE_IDENTIFIER = "uniT-App"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -508,13 +509,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2WLSMMLG6W; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.unit2; + PRODUCT_BUNDLE_IDENTIFIER = "uniT-App"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 48a1080..097b297 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,8 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -43,9 +47,5 @@ UIViewControllerBasedStatusBarAppearance - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/lib/bloc/profile/profile_bloc.dart b/lib/bloc/profile/profile_bloc.dart index f357ecc..c778ab6 100644 --- a/lib/bloc/profile/profile_bloc.dart +++ b/lib/bloc/profile/profile_bloc.dart @@ -15,16 +15,16 @@ class ProfileBloc extends Bloc { ProfileBloc() : super(ProfileInitial()) { ProfileInformation? _profileInformation; on((event, emit) async { - try { + // try { emit(ProfileLoading()); ProfileInformation? profileInformation = await ProfileService.instance.getProfile(event.token, event.userID); _profileInformation = profileInformation; emit(ProfileLoaded( profileInformation: _profileInformation!)); - } catch (e) { - emit(ProfileErrorState(mesage: e.toString())); - } + // } catch (e) { + // emit(ProfileErrorState(mesage: e.toString())); + // } }); } } diff --git a/lib/model/profile/basic_info.dart b/lib/model/profile/basic_info.dart index fda9bc1..29b1db2 100644 --- a/lib/model/profile/basic_info.dart +++ b/lib/model/profile/basic_info.dart @@ -1,9 +1,13 @@ +import 'package:unit2/model/profile/basic_information/citizenship.dart'; import 'package:unit2/model/profile/basic_information/contact_information.dart'; +import 'package:unit2/model/profile/basic_information/identification_information.dart'; import 'package:unit2/model/profile/basic_information/primary-information.dart'; class BasicInfo{ PrimaryInformation primaryInformation; List contactInformation; - BasicInfo({required this.contactInformation, required this.primaryInformation}); + List identifications; + List citizenships; + BasicInfo({required this.contactInformation, required this.primaryInformation,required this.identifications,required this.citizenships}); } \ No newline at end of file diff --git a/lib/model/profile/basic_information/citizenship.dart b/lib/model/profile/basic_information/citizenship.dart new file mode 100644 index 0000000..cddc21e --- /dev/null +++ b/lib/model/profile/basic_information/citizenship.dart @@ -0,0 +1,50 @@ +// To parse this JSON data, do +// +// final citizenship = citizenshipFromJson(jsonString); + +import 'package:meta/meta.dart'; +import 'dart:convert'; + +class Citizenship { + Citizenship({ + required this.country, + required this.naturalBorn, + }); + + final Country? country; + final bool? naturalBorn; + + factory Citizenship.fromJson(Map json) => Citizenship( + country: Country.fromJson(json["country"]), + naturalBorn: json["natural_born"], + ); + + Map toJson() => { + "country": country!.toJson(), + "natural_born": naturalBorn, + }; +} + +class Country { + Country({ + required this.id, + required this.code, + required this.name, + }); + + final int? id; + final String? code; + final String? name; + + factory Country.fromJson(Map json) => Country( + id: json["id"], + code: json["code"], + name: json["name"], + ); + + Map toJson() => { + "id": id, + "code": code, + "name": name, + }; +} diff --git a/lib/model/profile/basic_information/identification_information.dart b/lib/model/profile/basic_information/identification_information.dart new file mode 100644 index 0000000..09e20fe --- /dev/null +++ b/lib/model/profile/basic_information/identification_information.dart @@ -0,0 +1,293 @@ +import 'dart:convert'; + +Identification identificationFromJson(String str) => Identification.fromJson(json.decode(str)); + +String identificationToJson(Identification data) => json.encode(data.toJson()); + +class Identification { + Identification({ + required this.id, + required this.agency, + required this.issuedAt, + this.dateIssued, + this.expirationDate, + required this.asPdfReference, + required this.identificationNumber, + }); + + int? id; + Agency? agency; + IssuedAt? issuedAt; + DateTime? dateIssued; + DateTime? expirationDate; + bool? asPdfReference; + String? identificationNumber; + + factory Identification.fromJson(Map json) => Identification( + id: json["id"], + agency: Agency.fromJson(json["agency"]), + issuedAt: IssuedAt.fromJson(json["issued_at"]), + dateIssued:json["date_issued"]==null?null:DateTime.parse(json["date_issued"]), + expirationDate:json["expiration_date"]==null?null:DateTime.parse(json["expiration_date"]), + asPdfReference: json["as_pdf_reference"], + identificationNumber: json["identification_number"], + ); + + Map toJson() => { + "id": id, + "agency": agency!.toJson(), + "issued_at": issuedAt!.toJson(), + "date_issued": dateIssued, + "expiration_date": expirationDate, + "as_pdf_reference": asPdfReference, + "identification_number": identificationNumber, + }; +} + +class Agency { + Agency({ + required this.id, + required this.name, + required this.category, + required this.privateEntity, + }); + + int? id; + String? name; + Category? category; + bool? privateEntity; + + factory Agency.fromJson(Map json) => Agency( + id: json["id"], + name: json["name"], + category: Category.fromJson(json["category"]), + privateEntity: json["private_entity"], + ); + + Map toJson() => { + "id": id, + "name": name, + "category": category!.toJson(), + "private_entity": privateEntity, + }; +} + +class Category { + Category({ + required this.id, + required this.name, + required this.industryClass, + }); + + int? id; + String? name; + IndustryClass? industryClass; + + factory Category.fromJson(Map json) => Category( + id: json["id"], + name: json["name"], + industryClass: IndustryClass.fromJson(json["industry_class"]), + ); + + Map toJson() => { + "id": id, + "name": name, + "industry_class": industryClass!.toJson(), + }; +} + +class IndustryClass { + IndustryClass({ + required this.id, + required this.name, + this.description, + }); + + int? id; + String? name; + String? description; + + factory IndustryClass.fromJson(Map json) => IndustryClass( + id: json["id"], + name: json["name"], + description: json["description"], + ); + + Map toJson() => { + "id": id, + "name": name, + "description": description, + }; +} + +class IssuedAt { + IssuedAt({ + required this.id, + this.issuedAtClass, + required this.country, + this.barangay, + required this.addressCategory, + required this.cityMunicipality, + }); + + int? id; + dynamic issuedAtClass; + Country? country; + dynamic barangay; + AddressCategory? addressCategory; + CityMunicipality? cityMunicipality; + + factory IssuedAt.fromJson(Map json) => IssuedAt( + id: json["id"], + issuedAtClass: json["class"], + country: Country.fromJson(json["country"]), + barangay: json["barangay"], + addressCategory: AddressCategory.fromJson(json["address_category"]), + cityMunicipality: CityMunicipality.fromJson(json["city_municipality"]), + ); + + Map toJson() => { + "id": id, + "class": issuedAtClass, + "country": country!.toJson(), + "barangay": barangay, + "address_category": addressCategory!.toJson(), + "city_municipality": cityMunicipality!.toJson(), + }; +} + +class AddressCategory { + AddressCategory({ + required this.id, + required this.name, + required this.type, + }); + + int? id; + String? name; + String? type; + + factory AddressCategory.fromJson(Map json) => AddressCategory( + id: json["id"], + name: json["name"], + type: json["type"], + ); + + Map toJson() => { + "id": id, + "name": name, + "type": type, + }; +} + +class CityMunicipality { + CityMunicipality({ + required this.code, + required this.zipcode, + required this.province, + required this.psgcCode, + required this.description, + }); + + String? code; + String? zipcode; + Province? province; + String? psgcCode; + String? description; + + factory CityMunicipality.fromJson(Map json) => CityMunicipality( + code: json["code"], + zipcode: json["zipcode"], + province: Province.fromJson(json["province"]), + psgcCode: json["psgc_code"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "zipcode": zipcode, + "province": province!.toJson(), + "psgc_code": psgcCode, + "description": description, + }; +} + +class Province { + Province({ + required this.code, + required this.region, + required this.psgcCode, + required this.shortname, + required this.description, + }); + + String? code; + Region? region; + String? psgcCode; + String? shortname; + String? description; + + factory Province.fromJson(Map json) => Province( + code: json["code"], + region: Region.fromJson(json["region"]), + psgcCode: json["psgc_code"], + shortname: json["shortname"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "region": region!.toJson(), + "psgc_code": psgcCode, + "shortname": shortname, + "description": description, + }; +} + +class Region { + Region({ + required this.code, + required this.psgcCode, + required this.description, + }); + + int? code; + String? psgcCode; + String? description; + + factory Region.fromJson(Map json) => Region( + code: json["code"], + psgcCode: json["psgc_code"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "psgc_code": psgcCode, + "description": description, + }; +} + +class Country { + Country({ + required this.id, + required this.code, + required this.name, + }); + + int? id; + String? code; + String? name; + + factory Country.fromJson(Map json) => Country( + id: json["id"], + code: json["code"], + name: json["name"], + ); + + Map toJson() => { + "id": id, + "code": code, + "name": name, + }; +} diff --git a/lib/model/profile/eligibility.dart b/lib/model/profile/eligibility.dart new file mode 100644 index 0000000..8da69b6 --- /dev/null +++ b/lib/model/profile/eligibility.dart @@ -0,0 +1,250 @@ +// To parse this JSON data, do +// +// final eligibity = eligibityFromJson(jsonString); + +import 'package:meta/meta.dart'; +import 'dart:convert'; + +EligibityCert eligibityFromJson(String str) => EligibityCert.fromJson(json.decode(str)); + +String eligibityToJson(EligibityCert data) => json.encode(data.toJson()); + +class EligibityCert { + EligibityCert({ + required this.id, + required this.rating, + required this.examDate, + required this.attachments, + required this.eligibility, + required this.examAddress, + required this.validityDate, + required this.licenseNumber, + }); + + final int? id; + final double? rating; + final DateTime? examDate; + final dynamic attachments; + final Eligibility? eligibility; + final ExamAddress? examAddress; + final DateTime? validityDate; + final DateTime? licenseNumber; + + factory EligibityCert.fromJson(Map json) => EligibityCert( + id: json["id"], + rating: json["rating"]?.toDouble(), + examDate: DateTime.parse(json["exam_date"]), + attachments: null, + eligibility: Eligibility.fromJson(json["eligibility"]), + examAddress: ExamAddress.fromJson(json["exam_address"]), + validityDate: json["validity_date"], + licenseNumber: json["license_number"], + ); + + Map toJson() => { + "id": id, + "rating": rating, + "exam_date": "${examDate!.year.toString().padLeft(4, '0')}-${examDate!.month.toString().padLeft(2, '0')}-${examDate!.day.toString().padLeft(2, '0')}", + "attachments": attachments, + "eligibility": eligibility!.toJson(), + "exam_address": examAddress!.toJson(), + "validity_date": validityDate, + "license_number": licenseNumber, + }; +} + +class Eligibility { + Eligibility({ + required this.id, + required this.type, + required this.title, + }); + + final int? id; + final String? type; + final String? title; + + factory Eligibility.fromJson(Map json) => Eligibility( + id: json["id"], + type: json["type"], + title: json["title"], + ); + + Map toJson() => { + "id": id, + "type": type, + "title": title, + }; +} + +class ExamAddress { + ExamAddress({ + required this.id, + required this.examAddressClass, + required this.country, + required this.barangay, + required this.addressCategory, + required this.cityMunicipality, + }); + + final int? id; + final dynamic examAddressClass; + final Country? country; + final dynamic barangay; + final AddressCategory? addressCategory; + final CityMunicipality? cityMunicipality; + + factory ExamAddress.fromJson(Map json) => ExamAddress( + id: json["id"], + examAddressClass: json["class"], + country: Country.fromJson(json["country"]), + barangay: json["barangay"], + addressCategory: AddressCategory.fromJson(json["address_category"]), + cityMunicipality: CityMunicipality.fromJson(json["city_municipality"]), + ); + + Map toJson() => { + "id": id, + "class": examAddressClass, + "country": country!.toJson(), + "barangay": barangay, + "address_category": addressCategory!.toJson(), + "city_municipality": cityMunicipality!.toJson(), + }; +} + +class AddressCategory { + AddressCategory({ + required this.id, + required this.name, + required this.type, + }); + + final int? id; + final String? name; + final String? type; + + factory AddressCategory.fromJson(Map json) => AddressCategory( + id: json["id"], + name: json["name"], + type: json["type"], + ); + + Map toJson() => { + "id": id, + "name": name, + "type": type, + }; +} + +class CityMunicipality { + CityMunicipality({ + required this.code, + required this.zipcode, + required this.province, + required this.psgcCode, + required this.description, + }); + + final String? code; + final String? zipcode; + final Province? province; + final String? psgcCode; + final String? description; + + factory CityMunicipality.fromJson(Map json) => CityMunicipality( + code: json["code"], + zipcode: json["zipcode"], + province: Province.fromJson(json["province"]), + psgcCode: json["psgc_code"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "zipcode": zipcode, + "province": province!.toJson(), + "psgc_code": psgcCode, + "description": description, + }; +} + +class Province { + Province({ + required this.code, + required this.region, + required this.psgcCode, + required this.shortname, + required this.description, + }); + + final String? code; + final Region? region; + final String? psgcCode; + final String? shortname; + final String? description; + + factory Province.fromJson(Map json) => Province( + code: json["code"], + region: Region.fromJson(json["region"]), + psgcCode: json["psgc_code"], + shortname: json["shortname"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "region": region!.toJson(), + "psgc_code": psgcCode, + "shortname": shortname, + "description": description, + }; +} + +class Region { + Region({ + required this.code, + required this.psgcCode, + required this.description, + }); + + final int? code; + final String? psgcCode; + final String? description; + + factory Region.fromJson(Map json) => Region( + code: json["code"], + psgcCode: json["psgc_code"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "psgc_code": psgcCode, + "description": description, + }; +} + +class Country { + Country({ + required this.id, + required this.code, + required this.name, + }); + + final int? id; + final String? code; + final String? name; + + factory Country.fromJson(Map json) => Country( + id: json["id"], + code: json["code"], + name: json["name"], + ); + + Map toJson() => { + "id": id, + "code": code, + "name": name, + }; +} diff --git a/lib/model/profile/learning_development.dart b/lib/model/profile/learning_development.dart new file mode 100644 index 0000000..4131a02 --- /dev/null +++ b/lib/model/profile/learning_development.dart @@ -0,0 +1,361 @@ +// To parse this JSON data, do +// +// final learningDevelopement = learningDevelopementFromJson(jsonString); + +import 'dart:convert'; + +LearningDevelopement learningDevelopementFromJson(String str) => LearningDevelopement.fromJson(json.decode(str)); + +String learningDevelopementToJson(LearningDevelopement data) => json.encode(data.toJson()); + +class LearningDevelopement { + LearningDevelopement({ + this.attachments, + this.sponsoredBy, + this.conductedTraining, + this.totalHoursAttended, + }); + + final dynamic attachments; + final EdBy? sponsoredBy; + final ConductedTraining? conductedTraining; + final int? totalHoursAttended; + + factory LearningDevelopement.fromJson(Map json) => LearningDevelopement( + attachments: json["attachments"], + sponsoredBy: json["sponsored_by"] == null ? null : EdBy.fromJson(json["sponsored_by"]), + conductedTraining: json["conducted_training"] == null ? null : ConductedTraining.fromJson(json["conducted_training"]), + totalHoursAttended: json["total_hours_attended"], + ); + + Map toJson() => { + "attachments": attachments, + "sponsored_by": sponsoredBy?.toJson(), + "conducted_training": conductedTraining?.toJson(), + "total_hours_attended": totalHoursAttended, + }; +} + +class ConductedTraining { + ConductedTraining({ + this.id, + this.title, + this.topic, + this.venue, + this.locked, + this.toDate, + this.fromDate, + this.totalHours, + this.conductedBy, + this.sessionsAttended, + this.learningDevelopmentType, + }); + + final int? id; + final LearningDevelopmentType? title; + final LearningDevelopmentType? topic; + final Venue? venue; + final bool? locked; + final DateTime? toDate; + final DateTime? fromDate; + final int? totalHours; + final EdBy? conductedBy; + final List? sessionsAttended; + final LearningDevelopmentType? learningDevelopmentType; + + factory ConductedTraining.fromJson(Map json) => ConductedTraining( + id: json["id"], + title: json["title"] == null ? null : LearningDevelopmentType.fromJson(json["title"]), + topic: json["topic"] == null ? null : LearningDevelopmentType.fromJson(json["topic"]), + venue: json["venue"] == null ? null : Venue.fromJson(json["venue"]), + locked: json["locked"], + toDate: json["to_date"] == null ? null : DateTime.parse(json["to_date"]), + fromDate: json["from_date"] == null ? null : DateTime.parse(json["from_date"]), + totalHours: json["total_hours"], + conductedBy: json["conducted_by"] == null ? null : EdBy.fromJson(json["conducted_by"]), + sessionsAttended: json["sessions_attended"] == null ? [] : List.from(json["sessions_attended"]!.map((x) => x)), + learningDevelopmentType: json["learning_development_type"] == null ? null : LearningDevelopmentType.fromJson(json["learning_development_type"]), + ); + + Map toJson() => { + "id": id, + "title": title?.toJson(), + "topic": topic?.toJson(), + "venue": venue?.toJson(), + "locked": locked, + "to_date": "${toDate!.year.toString().padLeft(4, '0')}-${toDate!.month.toString().padLeft(2, '0')}-${toDate!.day.toString().padLeft(2, '0')}", + "from_date": "${fromDate!.year.toString().padLeft(4, '0')}-${fromDate!.month.toString().padLeft(2, '0')}-${fromDate!.day.toString().padLeft(2, '0')}", + "total_hours": totalHours, + "conducted_by": conductedBy?.toJson(), + "sessions_attended": sessionsAttended == null ? [] : List.from(sessionsAttended!.map((x) => x)), + "learning_development_type": learningDevelopmentType?.toJson(), + }; +} + +class EdBy { + EdBy({ + this.id, + this.name, + this.category, + this.privateEntity, + }); + + final int? id; + final String? name; + final SponsoredByCategory? category; + final bool? privateEntity; + + factory EdBy.fromJson(Map json) => EdBy( + id: json["id"], + name: json["name"], + category: json["category"] == null ? null : SponsoredByCategory.fromJson(json["category"]), + privateEntity: json["private_entity"], + ); + + Map toJson() => { + "id": id, + "name": name, + "category": category?.toJson(), + "private_entity": privateEntity, + }; +} + +class SponsoredByCategory { + SponsoredByCategory({ + this.id, + this.name, + this.industryClass, + }); + + final int? id; + final String? name; + final IndustryClass? industryClass; + + factory SponsoredByCategory.fromJson(Map json) => SponsoredByCategory( + id: json["id"], + name: json["name"], + industryClass: json["industry_class"] == null ? null : IndustryClass.fromJson(json["industry_class"]), + ); + + Map toJson() => { + "id": id, + "name": name, + "industry_class": industryClass?.toJson(), + }; +} + +class IndustryClass { + IndustryClass({ + this.id, + this.name, + this.description, + }); + + final int? id; + final String? name; + final dynamic description; + + factory IndustryClass.fromJson(Map json) => IndustryClass( + id: json["id"], + name: json["name"], + description: json["description"], + ); + + Map toJson() => { + "id": id, + "name": name, + "description": description, + }; +} + +class LearningDevelopmentType { + LearningDevelopmentType({ + this.id, + this.title, + }); + + final int? id; + final String? title; + + factory LearningDevelopmentType.fromJson(Map json) => LearningDevelopmentType( + id: json["id"], + title: json["title"], + ); + + Map toJson() => { + "id": id, + "title": title, + }; +} + +class Venue { + Venue({ + this.id, + this.country, + this.barangay, + this.category, + this.areaClass, + this.cityMunicipality, + }); + + final int? id; + final Country? country; + final dynamic barangay; + final VenueCategory? category; + final dynamic areaClass; + final CityMunicipality? cityMunicipality; + + factory Venue.fromJson(Map json) => Venue( + id: json["id"], + country: json["country"] == null ? null : Country.fromJson(json["country"]), + barangay: json["barangay"], + category: json["category"] == null ? null : VenueCategory.fromJson(json["category"]), + areaClass: json["area_class"], + cityMunicipality: json["city_municipality"] == null ? null : CityMunicipality.fromJson(json["city_municipality"]), + ); + + Map toJson() => { + "id": id, + "country": country?.toJson(), + "barangay": barangay, + "category": category?.toJson(), + "area_class": areaClass, + "city_municipality": cityMunicipality?.toJson(), + }; +} + +class VenueCategory { + VenueCategory({ + this.id, + this.name, + this.type, + }); + + final int? id; + final String? name; + final String? type; + + factory VenueCategory.fromJson(Map json) => VenueCategory( + id: json["id"], + name: json["name"], + type: json["type"], + ); + + Map toJson() => { + "id": id, + "name": name, + "type": type, + }; +} + +class CityMunicipality { + CityMunicipality({ + this.code, + this.zipcode, + this.province, + this.psgcCode, + this.description, + }); + + final String? code; + final String? zipcode; + final Province? province; + final String? psgcCode; + final String? description; + + factory CityMunicipality.fromJson(Map json) => CityMunicipality( + code: json["code"], + zipcode: json["zipcode"], + province: json["province"] == null ? null : Province.fromJson(json["province"]), + psgcCode: json["psgc_code"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "zipcode": zipcode, + "province": province?.toJson(), + "psgc_code": psgcCode, + "description": description, + }; +} + +class Province { + Province({ + this.code, + this.region, + this.psgcCode, + this.shortname, + this.description, + }); + + final String? code; + final Region? region; + final String? psgcCode; + final String? shortname; + final String? description; + + factory Province.fromJson(Map json) => Province( + code: json["code"], + region: json["region"] == null ? null : Region.fromJson(json["region"]), + psgcCode: json["psgc_code"], + shortname: json["shortname"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "region": region?.toJson(), + "psgc_code": psgcCode, + "shortname": shortname, + "description": description, + }; +} + +class Region { + Region({ + this.code, + this.psgcCode, + this.description, + }); + + final int? code; + final String? psgcCode; + final String? description; + + factory Region.fromJson(Map json) => Region( + code: json["code"], + psgcCode: json["psgc_code"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "psgc_code": psgcCode, + "description": description, + }; +} + +class Country { + Country({ + this.id, + this.code, + this.name, + }); + + final int? id; + final String? code; + final String? name; + + factory Country.fromJson(Map json) => Country( + id: json["id"], + code: json["code"], + name: json["name"], + ); + + Map toJson() => { + "id": id, + "code": code, + "name": name, + }; +} diff --git a/lib/model/profile/profileInfomation.dart b/lib/model/profile/profileInfomation.dart index 891b522..1e7fa36 100644 --- a/lib/model/profile/profileInfomation.dart +++ b/lib/model/profile/profileInfomation.dart @@ -1,7 +1,13 @@ import 'package:unit2/model/profile/basic_info.dart'; import 'package:unit2/model/profile/basic_information/primary-information.dart'; +import 'package:unit2/model/profile/eligibility.dart'; +import 'package:unit2/model/profile/learning_development.dart'; +import 'package:unit2/model/profile/references.dart'; class ProfileInformation{ BasicInfo basicInfo; - ProfileInformation({required this.basicInfo}); + List eligibilities; + List references; + List learningsAndDevelopment; + ProfileInformation({required this.basicInfo,required this.eligibilities,required this.references, required this.learningsAndDevelopment}); } \ No newline at end of file diff --git a/lib/model/profile/references.dart b/lib/model/profile/references.dart new file mode 100644 index 0000000..b353cec --- /dev/null +++ b/lib/model/profile/references.dart @@ -0,0 +1,234 @@ +// To parse this JSON data, do +// +// final references = referencesFromJson(jsonString); +class PersonalReference { + PersonalReference({ + required this.id, + required this.address, + required this.lastName, + required this.contactNo, + required this.firstName, + required this.middleName, + }); + + final int? id; + final Address? address; + final String? lastName; + final String? contactNo; + final String? firstName; + final String? middleName; + + factory PersonalReference.fromJson(Map json) => PersonalReference( + id: json["id"], + address: json['address'] == null?null: Address.fromJson(json["address"]), + lastName: json["last_name"], + contactNo: json["contact_no"], + firstName: json["first_name"], + middleName: json["middle_name"], + ); + + Map toJson() => { + "id": id, + "address": address!.toJson(), + "last_name": lastName, + "contact_no": contactNo, + "first_name": firstName, + "middle_name": middleName, + }; +} + +class Address { + Address({ + required this.id, + required this.addressClass, + required this.country, + required this.barangay, + required this.addressCategory, + required this.cityMunicipality, + }); + + final int? id; + final String? addressClass; + final Country? country; + final Barangay? barangay; + final AddressCategory? addressCategory; + final CityMunicipality? cityMunicipality; + + factory Address.fromJson(Map json) => Address( + id: json["id"], + addressClass: json["class"], + country: json['country']== null?null: Country.fromJson(json["country"]), + barangay:json["barangay"]== null?null: Barangay.fromJson(json["barangay"]), + addressCategory: json["address_category"]== null? null: AddressCategory.fromJson(json["address_category"]), + cityMunicipality: json["city_municipality"]==null?null: CityMunicipality.fromJson(json["city_municipality"]), + ); + + Map toJson() => { + "id": id, + "class": addressClass, + "country": country!.toJson(), + "barangay": barangay!.toJson(), + "address_category": addressCategory!.toJson(), + "city_municipality": cityMunicipality!.toJson(), + }; +} + +class AddressCategory { + AddressCategory({ + required this.id, + required this.name, + required this.type, + }); + + final int? id; + final String? name; + final String? type; + + factory AddressCategory.fromJson(Map json) => AddressCategory( + id: json["id"], + name: json["name"], + type: json["type"], + ); + + Map toJson() => { + "id": id, + "name": name, + "type": type, + }; +} + +class Barangay { + Barangay({ + required this.code, + required this.description, + required this.cityMunicipality, + }); + + final String? code; + final String? description; + final CityMunicipality? cityMunicipality; + + factory Barangay.fromJson(Map json) => Barangay( + code: json["code"], + description: json["description"], + cityMunicipality: CityMunicipality.fromJson(json["city_municipality"]), + ); + + Map toJson() => { + "code": code, + "description": description, + "city_municipality": cityMunicipality!.toJson(), + }; +} + +class CityMunicipality { + CityMunicipality({ + required this.code, + required this.zipcode, + required this.province, + required this.psgcCode, + required this.description, + }); + + final String? code; + final String? zipcode; + final Province? province; + final String? psgcCode; + final String? description; + + factory CityMunicipality.fromJson(Map json) => CityMunicipality( + code: json["code"], + zipcode: json["zipcode"], + province: Province.fromJson(json["province"]), + psgcCode: json["psgc_code"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "zipcode": zipcode, + "province": province!.toJson(), + "psgc_code": psgcCode, + "description": description, + }; +} + +class Province { + Province({ + required this.code, + required this.region, + required this.psgcCode, + required this.shortname, + required this.description, + }); + + final String? code; + final Region? region; + final String? psgcCode; + final String? shortname; + final String? description; + + factory Province.fromJson(Map json) => Province( + code: json["code"], + region: Region.fromJson(json["region"]), + psgcCode: json["psgc_code"], + shortname: json["shortname"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "region": region!.toJson(), + "psgc_code": psgcCode, + "shortname": shortname, + "description": description, + }; +} + +class Region { + Region({ + required this.code, + required this.psgcCode, + required this.description, + }); + + final int? code; + final String? psgcCode; + final String? description; + + factory Region.fromJson(Map json) => Region( + code: json["code"], + psgcCode: json["psgc_code"], + description: json["description"], + ); + + Map toJson() => { + "code": code, + "psgc_code": psgcCode, + "description": description, + }; +} + +class Country { + Country({ + required this.id, + required this.code, + required this.name, + }); + + final int? id; + final String? code; + final String? name; + + factory Country.fromJson(Map json) => Country( + id: json["id"], + code: json["code"], + name: json["name"], + ); + + Map toJson() => { + "id": id, + "code": code, + "name": name, + }; +} diff --git a/lib/screens/profile/components/basic_information/citizenship_screen.dart b/lib/screens/profile/components/basic_information/citizenship_screen.dart new file mode 100644 index 0000000..3275bd0 --- /dev/null +++ b/lib/screens/profile/components/basic_information/citizenship_screen.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter/src/widgets/placeholder.dart'; +import 'package:unit2/model/profile/basic_information/citizenship.dart'; +import 'package:unit2/theme-data.dart/colors.dart'; +import 'package:unit2/utils/global.dart'; + +class CitizenShipScreen extends StatefulWidget { + final List citizenships; + const CitizenShipScreen({super.key, required this.citizenships}); + + @override + State createState() => _CitizenShipScreenState(); +} + +class _CitizenShipScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("Citizenship"),centerTitle: true, + backgroundColor: primary, + ), + body: widget.citizenships.isEmpty? + Container( + width: screenWidth, + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: const BorderRadius.all(Radius.circular(12))), + + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Philippines",style: Theme.of(context).textTheme.titleLarge,), + Text("Filipino",style: Theme.of(context).textTheme.titleSmall,) + ], + + + ), + ):Container() + , + ); + } +} \ No newline at end of file diff --git a/lib/screens/profile/components/basic_information/contact_information.dart b/lib/screens/profile/components/basic_information/contact_information.dart index 9fa40aa..68962a6 100644 --- a/lib/screens/profile/components/basic_information/contact_information.dart +++ b/lib/screens/profile/components/basic_information/contact_information.dart @@ -1,6 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/src/widgets/framework.dart'; -import 'package:flutter/src/widgets/placeholder.dart'; import 'package:unit2/model/profile/basic_information/contact_information.dart'; import 'package:unit2/theme-data.dart/colors.dart'; @@ -25,53 +23,51 @@ class _ContactInformationState extends State { body: ListView.builder( itemCount: widget.contacts.length, itemBuilder: (BuildContext context, int index) { - return Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - color: Colors.grey[200], - borderRadius: const BorderRadius.all(Radius.circular(12))), - padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), - child: Row( - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: const BorderRadius.all(Radius.circular(12))), + padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(widget.contacts[index].numbermail.toString(),style: Theme.of(context).textTheme.titleLarge,), + const SizedBox(height: 5,), + Row( children: [ - Text(widget.contacts[index].numbermail.toString(),style: Theme.of(context).textTheme.titleLarge,), - const SizedBox(height: 5,), - Row( - children: [ - Text(widget.contacts[index].commService! - .serviceProvider!.alias - .toString()), - const SizedBox(width: 15,), - widget.contacts[index].active==true? const Badge(backgroundColor: Colors.green, label: Text("Active",),):const SizedBox(), - const SizedBox(width: 8), - widget.contacts[index].primary==true? const Badge(backgroundColor: Colors.blue, label: Text("Primary"),):const SizedBox() - ], - ), - const SizedBox(height: 5,), - Text(widget.contacts[index].commService! - .serviceProvider!.agency!.name - .toString()), - - ]), - ), - IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) - ], - ), + Text(widget.contacts[index].commService! + .serviceProvider!.alias + .toString()), + const SizedBox(width: 15,), + widget.contacts[index].active==true? const Badge(backgroundColor: Colors.green, label: Text("Active",),):const SizedBox(), + const SizedBox(width: 8), + widget.contacts[index].primary==true? const Badge(backgroundColor: Colors.blue, label: Text("Primary"),):const SizedBox() + ], + ), + const SizedBox(height: 5,), + Text(widget.contacts[index].commService! + .serviceProvider!.agency!.name + .toString()), + + ]), + ), + IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) + ], ), - const SizedBox(height: 5,), - + ), + const SizedBox(height: 5,), + - ], - ), + ], ); }), ), diff --git a/lib/screens/profile/components/basic_information/identification_information.dart b/lib/screens/profile/components/basic_information/identification_information.dart new file mode 100644 index 0000000..7cf8efc --- /dev/null +++ b/lib/screens/profile/components/basic_information/identification_information.dart @@ -0,0 +1,63 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter/src/widgets/placeholder.dart'; +import 'package:unit2/model/profile/basic_information/identification_information.dart'; +import 'package:unit2/theme-data.dart/colors.dart'; +import 'package:unit2/utils/global.dart'; + +class IdentificationInformations extends StatefulWidget { + final List identities; + const IdentificationInformations({super.key, required this.identities}); + + @override + State createState() => _IdentificationInformationsState(); +} + +class _IdentificationInformationsState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text("Identifications"),centerTitle: true, backgroundColor: primary,), +body: ListView.builder( + itemCount: widget.identities.length, + itemBuilder: (BuildContext context, int index){ + return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: screenWidth, + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: const BorderRadius.all(Radius.circular(12))), + padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(widget.identities[index].agency!.name!,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.bold)), + Row( + children: [ + Text(widget.identities[index].identificationNumber!,style: Theme.of(context).textTheme.titleSmall!.copyWith(fontWeight: FontWeight.bold)), + const SizedBox(width: 20,), + Badge(backgroundColor: success2, label:Text(widget.identities[index].agency!.privateEntity==true?"PRIVATE":"GOVERNMENT",)), + ], + ), + Text("${widget.identities[index].issuedAt!.cityMunicipality!.description!} ${widget.identities[index].issuedAt!.cityMunicipality!.province!.description}"), + ]), + + ), + IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) + ], + ), + ), + const SizedBox(height: 5,), + ], + ); +}), + ); + } +} \ No newline at end of file diff --git a/lib/screens/profile/components/eligibility.dart b/lib/screens/profile/components/eligibility.dart new file mode 100644 index 0000000..be2d7ff --- /dev/null +++ b/lib/screens/profile/components/eligibility.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter/src/widgets/placeholder.dart'; +import 'package:unit2/model/profile/eligibility.dart'; +import 'package:unit2/theme-data.dart/colors.dart'; +import 'package:unit2/utils/global.dart'; + +class EligibiltyScreen extends StatefulWidget { + final List eligibilities; + const EligibiltyScreen({super.key, required this.eligibilities}); + + @override + State createState() => _EligibiltyScreenState(); +} + +class _EligibiltyScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text("Eligibility"), + centerTitle: true, + backgroundColor: primary, + ), + body: ListView.builder( + itemCount: widget.eligibilities.length, + itemBuilder: (BuildContext context, int index) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: screenWidth, + padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: + const BorderRadius.all(Radius.circular(12))), + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + + Text(widget.eligibilities[index].eligibility!.title!, + style: Theme.of(context) + .textTheme + .titleMedium! + .copyWith(fontWeight: FontWeight.bold)), + Text( + "License number: ${widget.eligibilities[index].licenseNumber==null?'N/A':widget.eligibilities[index].licenseNumber.toString()}"), + Text("Rating: ${widget.eligibilities[index].rating}.") + ]), + + ), + IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) + ], + ), + ) + ], + ); + }), + ); + } +} diff --git a/lib/screens/profile/components/learning_and_development_screen.dart b/lib/screens/profile/components/learning_and_development_screen.dart new file mode 100644 index 0000000..f2f89ed --- /dev/null +++ b/lib/screens/profile/components/learning_and_development_screen.dart @@ -0,0 +1,67 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter/src/widgets/placeholder.dart'; +import 'package:intl/intl.dart'; +import 'package:unit2/model/profile/learning_development.dart'; +import 'package:unit2/theme-data.dart/colors.dart'; +import 'package:unit2/utils/global.dart'; + +class LearningAndDevelopmentScreen extends StatefulWidget { + final List learningDevelopments; + const LearningAndDevelopmentScreen({super.key, required this.learningDevelopments}); + + @override + State createState() => _LearningAndDevelopmentScreenState(); +} + +class _LearningAndDevelopmentScreenState extends State { + DateFormat dteFormat2 = DateFormat.yMMMMd('en_US'); + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text("Learning and Development"), + centerTitle: true, + backgroundColor: primary, + + ), + body: ListView.builder( + itemCount: widget.learningDevelopments.length, + itemBuilder: (BuildContext context, int index){ + String start = dteFormat2.format(widget.learningDevelopments[index].conductedTraining!.fromDate!); + String end = dteFormat2.format(widget.learningDevelopments[index].conductedTraining!.toDate!); + String type = widget.learningDevelopments[index].conductedTraining!.learningDevelopmentType!.title!; + return Column( + children: [ + Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: const BorderRadius.all(Radius.circular(12))), + padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), + width: screenWidth, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(widget.learningDevelopments[index].conductedTraining!.title!.title!), + const SizedBox(height: 5,), + Text(widget.learningDevelopments[index].conductedTraining!.conductedBy!.name!), + const SizedBox(height: 5,), + Text("$start TO $end"), + const SizedBox(height: 5,), + Text("TYPE : $type"), + ]), + ), + IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)), + ], + ), + ), + const SizedBox(height: 8,), + ], + ); + }), + ); + } +} \ No newline at end of file diff --git a/lib/screens/profile/components/loading_screen.dart b/lib/screens/profile/components/loading_screen.dart index a84ebaf..eda754a 100644 --- a/lib/screens/profile/components/loading_screen.dart +++ b/lib/screens/profile/components/loading_screen.dart @@ -47,39 +47,60 @@ class LoadingScreen extends StatelessWidget { subMenu(Icons.flag, "Citizenships",(){}), ]), const Divider(), - const MainMenu( + MainMenu( icon: Elusive.group, title: "Family", + onTap: () { + + }, ), const Divider(), - const MainMenu( + MainMenu( icon: FontAwesome5.graduation_cap, title: "Education", + onTap: () { + + }, ), const Divider(), - const MainMenu( + MainMenu( icon: Icons.stars, title: "Eligibility", + onTap: () { + + }, ), const Divider(), - const MainMenu( + MainMenu( icon: FontAwesome5.shopping_bag, title: "Work History", + onTap: () { + + }, ), const Divider(), - const MainMenu( + MainMenu( icon: FontAwesome5.walking, title: "Voluntary Work & Civic Services", + onTap: () { + + }, ), const Divider(), - const MainMenu( + MainMenu( icon: Elusive.lightbulb, title: "Learning & Development", + onTap: () { + + }, ), const Divider(), - const MainMenu( + MainMenu( icon: Brandico.codepen, title: "Personal References", + onTap: () { + + }, ), ExpandableGroup( collapsedIcon: diff --git a/lib/screens/profile/components/main_menu.dart b/lib/screens/profile/components/main_menu.dart index d315a7d..cdc5c26 100644 --- a/lib/screens/profile/components/main_menu.dart +++ b/lib/screens/profile/components/main_menu.dart @@ -4,9 +4,11 @@ import 'package:unit2/theme-data.dart/colors.dart'; class MainMenu extends StatelessWidget { final IconData icon; final String title; + final Function() onTap; const MainMenu({ required this.icon, required this.title, + required this.onTap, Key? key, }) : super(key: key); @@ -19,9 +21,10 @@ class MainMenu extends StatelessWidget { ), title: Text( title, - style: TextStyle(fontWeight: FontWeight.bold), + style: const TextStyle(fontWeight: FontWeight.bold), ), trailing: const Icon(Icons.keyboard_arrow_right), + onTap: onTap, ); } } diff --git a/lib/screens/profile/components/references_screen.dart b/lib/screens/profile/components/references_screen.dart new file mode 100644 index 0000000..5fb200b --- /dev/null +++ b/lib/screens/profile/components/references_screen.dart @@ -0,0 +1,57 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter/src/widgets/placeholder.dart'; +import 'package:unit2/model/profile/references.dart'; +import 'package:unit2/theme-data.dart/colors.dart'; + +class ReferencesScreen extends StatefulWidget { + final List references; + const ReferencesScreen({super.key, required this.references}); + + @override + State createState() => _ReferencesScreenState(); +} + +class _ReferencesScreenState extends State { + @override + Widget build(BuildContext context) { + + return Scaffold( + appBar: AppBar(title: const Text("Personal References"),centerTitle: true,backgroundColor: primary,), + body: ListView.builder( + itemCount: widget.references.length, + itemBuilder: (BuildContext context, int index){ + String fullname = "${widget.references[0].firstName} ${widget.references[0].middleName} ${widget.references[0].lastName}"; + String addres = "${widget.references[0].address!.cityMunicipality!.description}, ${widget.references[0].address!.cityMunicipality!.province!.description}, ${widget.references[0].address!.cityMunicipality!.province!.region!.description}"; + String mobile = widget.references[0].contactNo.toString(); + return Column(children: [ + Container( + padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: const BorderRadius.all(Radius.circular(12))), + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Text(fullname,style: Theme.of(context).textTheme.titleLarge!.copyWith(fontWeight: FontWeight.bold)), + const SizedBox(height: 5,), + Text(addres,style: Theme.of(context).textTheme.labelLarge!.copyWith(fontWeight: FontWeight.bold)), + const SizedBox(height: 8,), + Text("PHONE / MOBILE NUMBER $mobile",style: Theme.of(context).textTheme.labelSmall!.copyWith(fontWeight: FontWeight.bold)), + ],), + ), + IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) + ], + ), + ), + const SizedBox(height: 8,), + ],); + }) , + ); + } +} \ No newline at end of file diff --git a/lib/screens/profile/profile.dart b/lib/screens/profile/profile.dart index 8e7b6f0..3cd5c79 100644 --- a/lib/screens/profile/profile.dart +++ b/lib/screens/profile/profile.dart @@ -8,9 +8,14 @@ import 'package:fluttericon/entypo_icons.dart'; import 'package:fluttericon/font_awesome5_icons.dart'; import 'package:fluttericon/modern_pictograms_icons.dart'; import 'package:unit2/bloc/profile/profile_bloc.dart'; +import 'package:unit2/screens/profile/components/basic_information/citizenship_screen.dart'; import 'package:unit2/screens/profile/components/basic_information/contact_information.dart'; +import 'package:unit2/screens/profile/components/basic_information/identification_information.dart'; import 'package:unit2/screens/profile/components/basic_information/primary_information.dart'; +import 'package:unit2/screens/profile/components/eligibility.dart'; +import 'package:unit2/screens/profile/components/learning_and_development_screen.dart'; import 'package:unit2/screens/profile/components/loading_screen.dart'; +import 'package:unit2/screens/profile/components/references_screen.dart'; import 'package:unit2/theme-data.dart/colors.dart'; import '../../bloc/user/user_bloc.dart'; import 'components/main_menu.dart'; @@ -84,49 +89,76 @@ class _ProfileInfoState extends State { }), subMenu(Icons.home, "Home Addresses",(){}), subMenu( - Icons.contact_mail, "Identifications",(){}), + Icons.contact_mail, "Identifications",(){ + Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ + return IdentificationInformations(identities: state.profileInformation.basicInfo.identifications); + })); + }), subMenu( Icons.contact_phone, "Contact Info",(){ Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ return ContactInformation(contacts: state.profileInformation.basicInfo.contactInformation,); })); }), - subMenu(Icons.flag, "Citizenships",(){}), + subMenu(Icons.flag, "Citizenships",(){ + Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ + return CitizenShipScreen(citizenships: state.profileInformation.basicInfo.citizenships,); + })); + }), ]), const Divider(), - const MainMenu( + MainMenu( icon: Elusive.group, title: "Family", + onTap: (){}, ), const Divider(), - const MainMenu( + MainMenu( icon: FontAwesome5.graduation_cap, title: "Education", + onTap: (){}, ), const Divider(), - const MainMenu( + MainMenu( icon: Icons.stars, title: "Eligibility", + onTap: (){ + Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ + return EligibiltyScreen(eligibilities: state.profileInformation.eligibilities); + })); + }, ), const Divider(), - const MainMenu( + MainMenu( icon: FontAwesome5.shopping_bag, title: "Work History", + onTap: (){}, ), const Divider(), - const MainMenu( + MainMenu( icon: FontAwesome5.walking, title: "Voluntary Work & Civic Services", + onTap: (){}, ), const Divider(), - const MainMenu( + MainMenu( icon: Elusive.lightbulb, title: "Learning & Development", + onTap: (){ + Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ + return LearningAndDevelopmentScreen(learningDevelopments: state.profileInformation.learningsAndDevelopment); + })); + }, ), const Divider(), - const MainMenu( + MainMenu( icon: Brandico.codepen, title: "Personal References", + onTap: (){ + Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ + return ReferencesScreen(references: state.profileInformation.references); + })); + }, ), ExpandableGroup( collapsedIcon: diff --git a/lib/sevices/profile/profile_service.dart b/lib/sevices/profile/profile_service.dart index c502434..6f25add 100644 --- a/lib/sevices/profile/profile_service.dart +++ b/lib/sevices/profile/profile_service.dart @@ -2,8 +2,13 @@ import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:unit2/model/login_data/employee_info/employee_info.dart'; import 'package:unit2/model/profile/basic_info.dart'; +import 'package:unit2/model/profile/basic_information/citizenship.dart'; import 'package:unit2/model/profile/basic_information/contact_information.dart'; +import 'package:unit2/model/profile/basic_information/identification_information.dart'; +import 'package:unit2/model/profile/eligibility.dart'; +import 'package:unit2/model/profile/learning_development.dart'; import 'package:unit2/model/profile/profileInfomation.dart'; +import 'package:unit2/model/profile/references.dart'; import 'package:unit2/utils/request.dart'; import 'package:unit2/utils/urls.dart'; @@ -16,19 +21,25 @@ class ProfileService { Future getProfile(String token, int id) async { String url = Url.instance.profileInformation(); String path = url + id.toString(); - ProfileInformation? _profileInformation; + ProfileInformation? profileInformation0; + List references = []; ContactInfo contactInfo; + Identification identification; + List identificationInformation =[]; List contactInformation = []; PrimaryInformation primaryInformation; + List eligibilities = []; + List citizenships = []; + List learningsDevelopments = []; Map headers = { 'Content-Type': 'application/json; charset=UTF-8', 'Authorization': "Token $token" }; - try{ + // try{ http.Response response = await Request.instance .getRequest(path: path, param: {}, headers: headers); if (response.statusCode == 200) { - Map data = jsonDecode(response.body); + Map data = jsonDecode(response.body); // get primary information primaryInformation = PrimaryInformation.fromJson( data['data']['basic_information']['primary_information']); @@ -38,13 +49,49 @@ class ProfileService { contactInfo = ContactInfo.fromJson(contact['contact_info']); contactInformation.add(contactInfo); }); - BasicInfo basicInfo = BasicInfo(contactInformation: contactInformation, primaryInformation: primaryInformation); - ProfileInformation profileInformation = ProfileInformation(basicInfo: basicInfo); - _profileInformation = profileInformation; + // get all identifications + data['data']['basic_information']['identification_records'].forEach((var identity){ + identification = Identification.fromJson(identity); + identificationInformation.add(identification); + }); + //get all eligibilities + data['data']['eligibilities'].forEach((var cert){ + EligibityCert eligibility = EligibityCert.fromJson(cert); + eligibilities.add(eligibility); + }); + // get all citizenships + if(data['data']['citizenship']!= null){ + data['data']['citizenships'].forEach((var citizenship){ + Citizenship person = Citizenship.fromJson(citizenship); + citizenships.add(person); + }); + } + // get all references; + data['data']['personal_references'].forEach((var person){ + PersonalReference reference = PersonalReference.fromJson(person); + references.add(reference); + }); + + //get all learning and developments + + data['data']['learning_development'].forEach((var training){ + LearningDevelopement learnings = LearningDevelopement.fromJson(training); + learningsDevelopments.add(learnings); + }); + + + + BasicInfo basicInfo = BasicInfo(contactInformation: contactInformation, + primaryInformation: primaryInformation, + identifications: identificationInformation, + citizenships: citizenships + ); + ProfileInformation profileInformation = ProfileInformation(basicInfo: basicInfo,eligibilities: eligibilities,references: references!,learningsAndDevelopment: learningsDevelopments); + profileInformation0 = profileInformation; } - }catch(e){ - throw(e.toString()); - } - return _profileInformation; + // }catch(e){ + // throw(e.toString()); + // } + return profileInformation0; } } diff --git a/lib/utils/urls.dart b/lib/utils/urls.dart index cee712a..525cc13 100644 --- a/lib/utils/urls.dart +++ b/lib/utils/urls.dart @@ -4,8 +4,8 @@ class Url { String host() { // return '192.168.10.221:3003'; - // return 'agusandelnorte.gov.ph'; - return 'devweb.agusandelnorte.gov.ph'; + return 'agusandelnorte.gov.ph'; + // return 'devweb.agusandelnorte.gov.ph'; } String authentication() { diff --git a/macos/Podfile.lock b/macos/Podfile.lock new file mode 100644 index 0000000..aa74d3f --- /dev/null +++ b/macos/Podfile.lock @@ -0,0 +1,51 @@ +PODS: + - FlutterMacOS (1.0.0) + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) + - package_info_plus (0.0.1): + - FlutterMacOS + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - shared_preferences_foundation (0.0.1): + - Flutter + - FlutterMacOS + - sqflite (0.0.2): + - FlutterMacOS + - FMDB (>= 2.7.5) + +DEPENDENCIES: + - FlutterMacOS (from `Flutter/ephemeral`) + - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) + - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos`) + - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos`) + - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`) + +SPEC REPOS: + trunk: + - FMDB + +EXTERNAL SOURCES: + FlutterMacOS: + :path: Flutter/ephemeral + package_info_plus: + :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos + path_provider_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos + shared_preferences_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos + sqflite: + :path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos + +SPEC CHECKSUMS: + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a + package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce + path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852 + shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca + sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea + +PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 + +COCOAPODS: 1.11.3 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 83583de..7b7cf22 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -21,6 +21,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 0B42AD366C3C28D47C2AEC89 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6C623098EB8995A39C4964E /* Pods_Runner.framework */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; @@ -52,9 +53,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 2023D02FF0211CAEE16878C9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* unit2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "unit2.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* unit2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = unit2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -66,8 +68,11 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 5BC0F6D90E7D68DE5330DF33 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 7FF1BC1DFB4A45BAC2293138 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + D6C623098EB8995A39C4964E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -75,6 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 0B42AD366C3C28D47C2AEC89 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -99,6 +105,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, + 64DE41DBDE00B8F8F94614A7 /* Pods */, ); sourceTree = ""; }; @@ -145,9 +152,21 @@ path = Runner; sourceTree = ""; }; + 64DE41DBDE00B8F8F94614A7 /* Pods */ = { + isa = PBXGroup; + children = ( + 5BC0F6D90E7D68DE5330DF33 /* Pods-Runner.debug.xcconfig */, + 7FF1BC1DFB4A45BAC2293138 /* Pods-Runner.release.xcconfig */, + 2023D02FF0211CAEE16878C9 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( + D6C623098EB8995A39C4964E /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -159,11 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + C3E6A8BAF2259AABAF243D8C /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, + F31D2B687E220EE9896D3A25 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -235,6 +256,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -270,6 +292,45 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; + C3E6A8BAF2259AABAF243D8C /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + F31D2B687E220EE9896D3A25 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -344,7 +405,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -423,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -470,7 +531,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + +