refactor profile screens

feature/passo/PASSO-#1-Sync-data-from-device-to-postgre-and-vice-versa
PGAN-MIS 2023-02-09 16:48:19 +08:00
parent 7795b5883b
commit 118a4f4587
23 changed files with 1120 additions and 833 deletions

View File

@ -28,7 +28,7 @@ class EligibityCert {
final Eligibility? eligibility; final Eligibility? eligibility;
final ExamAddress? examAddress; final ExamAddress? examAddress;
final DateTime? validityDate; final DateTime? validityDate;
final DateTime? licenseNumber; final String? licenseNumber;
factory EligibityCert.fromJson(Map<String, dynamic> json) => EligibityCert( factory EligibityCert.fromJson(Map<String, dynamic> json) => EligibityCert(
id: json["id"], id: json["id"],

View File

@ -1,7 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:unit2/model/profile/basic_information/adress.dart'; import 'package:unit2/model/profile/basic_information/adress.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart'; import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class AddressScreen extends StatefulWidget { class AddressScreen extends StatefulWidget {
final List<MainAdress> addresses; final List<MainAdress> addresses;
@ -16,33 +18,41 @@ class _AddressScreenState extends State<AddressScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text("Addresses"),centerTitle: true, backgroundColor: primary,), appBar: AppBar(title: const Text(adressScreenTitle),centerTitle: true, backgroundColor: primary,),
body: ListView.builder( body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
itemCount: widget.addresses.length, itemCount: widget.addresses.length,
itemBuilder: ( itemBuilder: (
BuildContext context, int index){ BuildContext context, int index){
String? subdivision = widget.addresses[index].details??''; String? subdivision = widget.addresses[index].details??'';
String category = widget.addresses[index].address!.category!.name!; String category = widget.addresses[index].address!.category!.name!;
String? barangay = widget.addresses[index].address!.barangay != null?widget.addresses[index].address!.barangay!.description:''; String? barangay = widget.addresses[index].address!.barangay != null?'${widget.addresses[index].address!.barangay!.description!.toUpperCase()},':'';
String cityMunicipality = widget.addresses[index].address!.cityMunicipality!.description!; String cityMunicipality = widget.addresses[index].address!.cityMunicipality!.description!;
String province = widget.addresses[index].address!.cityMunicipality!.province!.description!; String province = widget.addresses[index].address!.cityMunicipality!.province!.description!;
String region = widget.addresses[index].address!.cityMunicipality!.province!.region!.description!; String region = widget.addresses[index].address!.cityMunicipality!.province!.region!.description!;
return Column(children: [ return Column(children: [
Container(
width: screenWidth, Column(
decoration: BoxDecoration( children: [
color: Colors.grey[200], Container(
borderRadius: const BorderRadius.all(Radius.circular(12))), width: screenWidth,
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), decoration: box1(),
child: Row(children: [ padding: const EdgeInsets.fromLTRB(8,16,0,16),
Expanded(child: Column(children: [ child: Row(children: [
Row(children: [Text(subdivision), const SizedBox(width: 5,), Text(category)],), Expanded(child: Column(children: [
Text("$barangay $cityMunicipality $province $region"), Row(children: [Text(subdivision,style: Theme.of(context).textTheme.titleMedium,), const SizedBox(width: 5,),
],)),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) Text(category,style: Theme.of(context).textTheme.bodySmall,)],),
]), const Divider(),
const SizedBox(height: 5,),
Text("$barangay $cityMunicipality, $province, $region",style: Theme.of(context).textTheme.labelLarge,),
],)),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
]),
),
],
), ),
const SizedBox(height: 5,) const SizedBox(height: 5,),
],); ],);
}), }),
); );

View File

@ -4,6 +4,7 @@ import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/basic_information/citizenship.dart'; import 'package:unit2/model/profile/basic_information/citizenship.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart'; import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class CitizenShipScreen extends StatefulWidget { class CitizenShipScreen extends StatefulWidget {
final List<Citizenship> citizenships; final List<Citizenship> citizenships;
@ -18,7 +19,7 @@ class _CitizenShipScreenState extends State<CitizenShipScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text("Citizenship"),centerTitle: true, title: const Text(citizenshipScreenTitle),centerTitle: true,
backgroundColor: primary, backgroundColor: primary,
), ),
body: widget.citizenships.isEmpty? body: widget.citizenships.isEmpty?

View File

@ -1,36 +1,39 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:unit2/model/profile/basic_information/contact_information.dart'; import 'package:unit2/model/profile/basic_information/contact_information.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/text_container.dart';
class ContactInformation extends StatefulWidget { class ContactInformationScreen extends StatefulWidget {
final List<ContactInfo> contacts; final List<ContactInfo> contacts;
const ContactInformation({super.key, required this.contacts}); const ContactInformationScreen({super.key, required this.contacts});
@override @override
State<ContactInformation> createState() => _ContactInformationState(); State<ContactInformationScreen> createState() => _ContactInformationScreenState();
} }
class _ContactInformationState extends State<ContactInformation> { class _ContactInformationScreenState extends State<ContactInformationScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text("Contact Information"), title: const Text(contactScreenTitle),
centerTitle: true, centerTitle: true,
backgroundColor: primary, backgroundColor: primary,
), ),
body: ListView.builder( body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
itemCount: widget.contacts.length, itemCount: widget.contacts.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
String numberMail = widget.contacts[index].numbermail!;
String commService = widget.contacts[index].commService!.serviceProvider!.alias!;
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: box1(),
color: Colors.grey[200],
borderRadius: const BorderRadius.all(Radius.circular(12))),
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8),
child: Row( child: Row(
children: [ children: [
@ -39,16 +42,18 @@ class _ContactInformationState extends State<ContactInformation> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(widget.contacts[index].numbermail.toString(),style: Theme.of(context).textTheme.titleLarge,), Text(numberMail,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500)),
const Divider(),
const SizedBox(height: 5,), const SizedBox(height: 5,),
Row( Row(
children: [ children: [
Text(widget.contacts[index].commService! Expanded(
.serviceProvider!.alias child: Text(commService
.toString()), .toString(),style: Theme.of(context).textTheme.titleSmall,),
const SizedBox(width: 15,), ),
widget.contacts[index].active==true? const Badge(backgroundColor: Colors.green, label: Text("Active",),):const SizedBox(), widget.contacts[index].active==true? const Badge(backgroundColor: Colors.green, label: Text("Active",),):const SizedBox(),
const SizedBox(width: 8), const SizedBox(width: 5),
widget.contacts[index].primary==true? const Badge(backgroundColor: Colors.blue, label: Text("Primary"),):const SizedBox() widget.contacts[index].primary==true? const Badge(backgroundColor: Colors.blue, label: Text("Primary"),):const SizedBox()
], ],
), ),
@ -59,7 +64,7 @@ class _ContactInformationState extends State<ContactInformation> {
]), ]),
), ),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
], ],
), ),
), ),

View File

@ -1,63 +0,0 @@
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<Identification> identities;
const IdentificationInformations({super.key, required this.identities});
@override
State<IdentificationInformations> createState() => _IdentificationInformationsState();
}
class _IdentificationInformationsState extends State<IdentificationInformations> {
@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,),
],
);
}),
);
}
}

View File

@ -0,0 +1,90 @@
import 'package:flutter/material.dart';
import 'package:unit2/model/profile/basic_information/identification_information.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class IdentificationsScreen extends StatefulWidget {
final List<Identification> identities;
const IdentificationsScreen({super.key, required this.identities});
@override
State<IdentificationsScreen> createState() =>
_IdentificationsScreenState();
}
class _IdentificationsScreenState
extends State<IdentificationsScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(identificationScreenTitle),
centerTitle: true,
backgroundColor: primary,
),
body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
itemCount: widget.identities.length,
itemBuilder: (BuildContext context, int index) {
String agency = widget.identities[index].agency!.name!;
String idNumber = widget.identities[index].identificationNumber!;
bool government = widget.identities[index].agency!.privateEntity!;
String issuedAt = "${widget.identities[index].issuedAt!.cityMunicipality!.description!} ${widget.identities[index].issuedAt!.cityMunicipality!.province!.description}";
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: screenWidth,
decoration: box1(),
padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(agency,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500)),
const Divider(),
const SizedBox(height: 5,),
Row(
children: [
Expanded(
child: Text(
"$idNumberText : $idNumber",style: Theme.of(context).textTheme.titleSmall,
),
),
Badge(
backgroundColor: success2,
label: Text(
government ==
true
? privateText.toUpperCase()
:governmentText.toUpperCase(),
style: Theme.of(context).textTheme.bodySmall!.copyWith(color: Colors.white),)),
],
),
const SizedBox(height: 5,),
Text(issuedAt),
]),
),
IconButton(
onPressed: () {}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
],
),
),
const SizedBox(
height: 5,
),
],
);
}),
);
}
}

View File

@ -1,163 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:intl/intl.dart';
import 'package:unit2/model/profile/basic_information/primary-information.dart';
import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/theme-data.dart/form-style.dart';
import 'package:unit2/utils/global.dart';
class PrimaryInfo extends StatefulWidget {
final PrimaryInformation primaryInformation;
const PrimaryInfo({super.key, required this.primaryInformation});
@override
State<PrimaryInfo> createState() => _PrimaryInfoState();
}
class _PrimaryInfoState extends State<PrimaryInfo> {
@override
Widget build(BuildContext context) {
final _formKey = GlobalKey<FormBuilderState>();
bool enabled = false;
DateFormat dteFormat2 = DateFormat.yMMMMd('en_US');
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: const Text("Primary Information"),
centerTitle: true,
backgroundColor: primary,
),
body: Container(
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 24),
child: FormBuilder(
child: Column(
children: [
FormBuilderTextField(
enabled: enabled,
name: 'lastname',
initialValue: widget.primaryInformation.lastName!,
decoration: normalTextFieldStyle("Last name", ""),
),
const SizedBox(height: 15,),
FormBuilderTextField(
enabled: enabled,
name: 'firstname',
initialValue: widget.primaryInformation.firstName!,
decoration: normalTextFieldStyle("First name", ""),
),
const SizedBox(height: 15,),
SizedBox(
width: screenWidth,
child: Row(children: [
Flexible(
flex: 2,
child: FormBuilderTextField(
enabled: enabled,
name: 'middlename',
initialValue: widget.primaryInformation.middleName!,
decoration: normalTextFieldStyle("Middle name", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'extension-name',
initialValue: widget.primaryInformation.nameExtension??='N/A',
decoration: normalTextFieldStyle("Name extension", ""),
),)
]),
),
const SizedBox(height: 15,),
SizedBox(width: screenWidth,
child: Row(children: [
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'bday',
initialValue: dteFormat2.format(widget.primaryInformation.birthdate!),
decoration: normalTextFieldStyle("Birth date", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'sex',
initialValue: widget.primaryInformation.sex!,
decoration: normalTextFieldStyle("Sex", ""),
),)
]),),
const SizedBox(height: 15,),
SizedBox(width: screenWidth,
child: Row(children: [
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'bloodtype',
initialValue:widget.primaryInformation.bloodType!,
decoration: normalTextFieldStyle("Blood type", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'civil-status',
initialValue: widget.primaryInformation.civilStatus!,
decoration: normalTextFieldStyle("Civil Status", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'gender',
initialValue:widget.primaryInformation.gender??="N/A",
decoration: normalTextFieldStyle("Gender", ""),
),),
]),),
const SizedBox(height: 15,),
SizedBox(width: screenWidth,
child: Row(children: [
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'height',
initialValue:widget.primaryInformation.heightM!.toString(),
decoration: normalTextFieldStyle("Height", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'Weight',
initialValue: widget.primaryInformation.weightKg!.toString(),
decoration: normalTextFieldStyle("Weight", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: 'prefix&suffix',
initialValue:"${widget.primaryInformation.titlePrefix??="NA"} | ${widget.primaryInformation.titleSuffix??="N/A"}",
decoration: normalTextFieldStyle("Title Prefix and Suffix", ""),
),),
]),),
],
)),
)),
);
}
}

View File

@ -0,0 +1,159 @@
import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:intl/intl.dart';
import 'package:unit2/model/profile/basic_information/primary-information.dart';
import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/theme-data.dart/form-style.dart';
import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class PrimaryInfo extends StatefulWidget {
final PrimaryInformation primaryInformation;
const PrimaryInfo({super.key, required this.primaryInformation});
@override
State<PrimaryInfo> createState() => _PrimaryInfoState();
}
class _PrimaryInfoState extends State<PrimaryInfo> {
@override
Widget build(BuildContext context) {
final _formKey = GlobalKey<FormBuilderState>();
bool enabled = false;
DateFormat dteFormat2 = DateFormat.yMMMMd('en_US');
return Scaffold(
appBar: AppBar(
title: const Text(primaryInformationScreenTitle),
centerTitle: true,
backgroundColor: primary,
),
body: Container(
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 24),
child: FormBuilder(
child: Column(
children: [
FormBuilderTextField(
enabled: enabled,
name: lastname,
initialValue: widget.primaryInformation.lastName!,
decoration: normalTextFieldStyle("Last name", ""),
),
const SizedBox(height: 15,),
FormBuilderTextField(
enabled: enabled,
name: firstname,
initialValue: widget.primaryInformation.firstName!,
decoration: normalTextFieldStyle("First name", ""),
),
const SizedBox(height: 15,),
SizedBox(
width: screenWidth,
child: Row(children: [
Flexible(
flex: 2,
child: FormBuilderTextField(
enabled: enabled,
name: middlename,
initialValue: widget.primaryInformation.middleName!,
decoration: normalTextFieldStyle("Middle name", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: extensionName,
initialValue: widget.primaryInformation.nameExtension??='N/A',
decoration: normalTextFieldStyle("Name extension", ""),
),)
]),
),
const SizedBox(height: 15,),
SizedBox(width: screenWidth,
child: Row(children: [
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: extensionName,
initialValue: dteFormat2.format(widget.primaryInformation.birthdate!),
decoration: normalTextFieldStyle("Birth date", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: sex,
initialValue: widget.primaryInformation.sex!,
decoration: normalTextFieldStyle("Sex", ""),
),)
]),),
const SizedBox(height: 15,),
SizedBox(width: screenWidth,
child: Row(children: [
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: bloodType,
initialValue:widget.primaryInformation.bloodType!,
decoration: normalTextFieldStyle("Blood type", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: civilStatus,
initialValue: widget.primaryInformation.civilStatus!,
decoration: normalTextFieldStyle("Civil Status", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: gender,
initialValue:widget.primaryInformation.gender??="N/A",
decoration: normalTextFieldStyle("Gender", ""),
),),
]),),
const SizedBox(height: 15,),
SizedBox(width: screenWidth,
child: Row(children: [
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: height,
initialValue:widget.primaryInformation.heightM!.toString(),
decoration: normalTextFieldStyle("Height", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: width,
initialValue: widget.primaryInformation.weightKg!.toString(),
decoration: normalTextFieldStyle("Weight", ""),
),),
const SizedBox(width: 10,),
Flexible(
flex: 1,
child: FormBuilderTextField(
enabled: enabled,
name: prefixSuffix,
initialValue:"${widget.primaryInformation.titlePrefix??="NA"} | ${widget.primaryInformation.titleSuffix??="N/A"}",
decoration: normalTextFieldStyle("Title Prefix and Suffix", ""),
),),
]),),
],
)),
));
}
}

View File

@ -1,8 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/educational_background.dart'; import 'package:unit2/model/profile/educational_background.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/text_container.dart';
class EducationScreen extends StatefulWidget { class EducationScreen extends StatefulWidget {
final List<EducationalBackground> educationBackgrounds; final List<EducationalBackground> educationBackgrounds;
@ -17,52 +18,109 @@ class _EducationScreenState extends State<EducationScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text("Educational Background"), title: const Text(educationScreenTitle),
centerTitle: true, centerTitle: true,
backgroundColor: primary, backgroundColor: primary,
), ),
body: ListView.builder( body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
itemCount: widget.educationBackgrounds.length, itemCount: widget.educationBackgrounds.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
String level = widget.educationBackgrounds[index].education!.level!; String level = widget.educationBackgrounds[index].education!.level!;
String periodFrom = widget.educationBackgrounds[index].periodFrom!; String periodFrom = widget.educationBackgrounds[index].periodFrom!;
String periodTo = widget.educationBackgrounds[index].periodTo!; String periodTo = widget.educationBackgrounds[index].periodTo!;
String? program = widget.educationBackgrounds[index].education!.course == null? null: widget.educationBackgrounds[index].education!.course!.program!; String? program =
List<Honor>? honors = widget.educationBackgrounds[index].honors!.toList(); widget.educationBackgrounds[index].education!.course == null
String school = widget.educationBackgrounds[index].education!.school!.name!; ? null
: widget.educationBackgrounds[index].education!.course!
.program!;
List<Honor>? honors =
widget.educationBackgrounds[index].honors!.toList();
String school =
widget.educationBackgrounds[index].education!.school!.name!;
return Column( return Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: box1(),
color: Colors.grey[200],
borderRadius:
const BorderRadius.all(Radius.circular(12))),
padding: padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8), const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Column(children: [ child: Column(
Row( mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(level), Row(
Text("$periodFrom $periodTo"), children: [
], Expanded(
), child: Text(
Text(program??=''), level,
Text(school), style: Theme.of(context)
Container( .textTheme
child: honors.isNotEmpty? Column( .titleMedium!
children: honors.map((Honor honor) => Text(honor.name!)).toList(), .copyWith(fontWeight: FontWeight.w500),
):const SizedBox() )),
) Text(
]), "$periodFrom - $periodTo",
style:
Theme.of(context).textTheme.bodyMedium,
),
],
),
const SizedBox(height: 5,),
Text(
school,
style: Theme.of(context).textTheme.titleSmall,
),
Container(
padding: const EdgeInsets.only(top: 8),
child: honors.isNotEmpty
? Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("$honorsText : "),
Column(
children:
honors
.map((Honor honor) =>
Text(" ${honor.name!}"))
.toList(),
),
],
)
: const SizedBox()),
program == null
? const SizedBox()
: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
const SizedBox(
height: 5,
),
Text(program),
],
),
]),
), ),
IconButton( IconButton(
onPressed: () {}, icon: const Icon(Icons.more_vert)) onPressed: () {},
icon: const Icon(
Icons.more_vert,
color: Colors.grey,
))
], ],
), ),
) ),
const SizedBox(
height: 5,
),
], ],
); );
}), }),

View File

@ -1,68 +0,0 @@
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<EligibityCert> eligibilities;
const EligibiltyScreen({super.key, required this.eligibilities});
@override
State<EligibiltyScreen> createState() => _EligibiltyScreenState();
}
class _EligibiltyScreenState extends State<EligibiltyScreen> {
@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))
],
),
)
],
);
}),
);
}
}

View File

@ -0,0 +1,70 @@
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/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class EligibiltyScreen extends StatefulWidget {
final List<EligibityCert> eligibilities;
const EligibiltyScreen({super.key, required this.eligibilities});
@override
State<EligibiltyScreen> createState() => _EligibiltyScreenState();
}
class _EligibiltyScreenState extends State<EligibiltyScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(elibilityScreenTitle),
centerTitle: true,
backgroundColor: primary,
),
body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
itemCount: widget.eligibilities.length,
itemBuilder: (BuildContext context, int index) {
String title = widget.eligibilities[index].eligibility!.title!;
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: screenWidth,
padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: box1(),
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500),
),
const Divider(),
const SizedBox(height: 5,),
Text(
"$licenseNumber: ${widget.eligibilities[index].licenseNumber == null ? 'N/A' : widget.eligibilities[index].licenseNumber.toString()}",style: Theme.of(context).textTheme.titleSmall),
const SizedBox(height: 3,),
Text(
"$rating : ${widget.eligibilities[index].rating}.",style: Theme.of(context).textTheme.titleSmall)
]),
),
IconButton(
onPressed: () {}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
],
),
)
],
);
}),
);
}
}

View File

@ -1,11 +1,9 @@
import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/family_backround.dart'; import 'package:unit2/model/profile/family_backround.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart'; import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class FamilyBackgroundScreen extends StatefulWidget { class FamilyBackgroundScreen extends StatefulWidget {
final List<FamilyBackground> familyBackground; final List<FamilyBackground> familyBackground;
@ -23,167 +21,275 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
List<FamilyBackground> otherRelated = []; List<FamilyBackground> otherRelated = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
father = widget.familyBackground.firstWhere((element) => element.relationship!.id==1); father = widget.familyBackground
mother = widget.familyBackground.firstWhere((element) => element.relationship!.id==2); .firstWhere((element) => element.relationship!.id == 1);
spouse = widget.familyBackground.firstWhere((element) => element.relationship!.id==3); mother = widget.familyBackground
var childs = widget.familyBackground.where((element) => element.relationship!.id==4); .firstWhere((element) => element.relationship!.id == 2);
if(childs.isNotEmpty){ spouse = widget.familyBackground
.firstWhere((element) => element.relationship!.id == 3);
// get all children
var childs = widget.familyBackground
.where((element) => element.relationship!.id == 4);
if (childs.isNotEmpty) {
for (var element in childs) { for (var element in childs) {
children.add(element); children.add(element);
} }
} }
var relateds = widget.familyBackground.where((element) => element.relationship!.id! < 4);
if(relateds.isNotEmpty){ //get all related persons
for (var element in childs) { var relateds = widget.familyBackground
.where((element) => element.relationship!.id! > 4);
if (relateds.isNotEmpty) {
for (var element in relateds) {
otherRelated.add(element); otherRelated.add(element);
} }
} }
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text("Addresses"), centerTitle: true, backgroundColor: primary,), appBar: AppBar(
body: Column( title: const Text(familyBackgroundScreenTitle),
children: [ centerTitle: true,
//Father backgroundColor: primary,
Container( ),
decoration: BoxDecoration( body: ListView(children: [
color: Colors.grey[200], //Father----------------------------------------------
borderRadius: const BorderRadius.all(Radius.circular(12))), Container(
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), decoration: box1(),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
width: screenWidth, width: screenWidth,
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Text("Father"), const Text(fatherText),
Text("${father!.relatedPerson!.firstName} ${father!.relatedPerson!.middleName} ${father!.relatedPerson!.lastName} ${father!.relatedPerson!.nameExtension??''}"), const SizedBox(height: 5,),
const Text("Full Name"), Text(
Row(children: [ " ${father!.relatedPerson!.firstName} ${father!.relatedPerson!.middleName} ${father!.relatedPerson!.lastName} ${father!.relatedPerson!.nameExtension ?? ''},",style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500),),
Checkbox(value: false, onChanged: (value){}), Text(" $fullname",style: Theme.of(context).textTheme.bodySmall,),
const Text("Incase of emergency") Row(
],) children: [
]), Checkbox(value: false, onChanged: (value) {}),
), const Text(incaseOfEmergency)
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) ],
], )
),), ]),
const SizedBox(height: 5,), ),
//Mother IconButton(
Container( onPressed: () {},
decoration: BoxDecoration( icon: const Icon(
color: Colors.grey[200], Icons.more_vert,
borderRadius: const BorderRadius.all(Radius.circular(12))), color: Colors.grey,
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), ))
width: screenWidth, ],
child: Row( ),
children: [ ),
Expanded( const SizedBox(
child: Column( height: 5,
mainAxisAlignment: MainAxisAlignment.start, ),
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("Mother"),
Text("${mother!.relatedPerson!.firstName} ${mother!.relatedPerson!.middleName} ${mother!.relatedPerson!.lastName} ${mother!.relatedPerson!.nameExtension??''}"),
const Text("Full Name"),
Row(children: [
Checkbox(value: false, onChanged: (value){}),
const Text("Incase of emergency")
],)
]),
),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert))
],
),),
const SizedBox(height: 5,),
//Spouse
spouse != null?
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: [
const Text("Spouse"),
Text("${spouse!.relatedPerson!.firstName} ${spouse!.relatedPerson!.middleName} ${spouse!.relatedPerson!.lastName} ${spouse!.relatedPerson!.nameExtension??''}"),
const Text("Full Name"),
Row(children: [
Checkbox(value: false, onChanged: (value){}),
const Text("Incase of emergency")
],)
]),
),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert))
],
),):const SizedBox(),
const SizedBox(height: 5,),
// Childrens //Mother-----------------------------------------------------
children.isNotEmpty?Expanded( Container(
child: ListView( decoration: box1(),
children: children.map((child) => Container( padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration( width: screenWidth,
color: Colors.grey[200], child: Row(
borderRadius: const BorderRadius.all(Radius.circular(12))), children: [
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), Expanded(
width: screenWidth, child: Column(
child: Row( mainAxisAlignment: MainAxisAlignment.start,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Expanded( children: [
child: Column( const Text(motherText),
mainAxisAlignment: MainAxisAlignment.start, const SizedBox(height: 5,),
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ " ${mother!.relatedPerson!.firstName} ${mother!.relatedPerson!.middleName} ${mother!.relatedPerson!.lastName} ${mother!.relatedPerson!.nameExtension ?? ''}",style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500),),
const Text("Children"), Text(" $fullname",style: Theme.of(context).textTheme.bodySmall),
Text("${child.relatedPerson!.firstName} ${child.relatedPerson!.middleName} ${child.relatedPerson!.lastName} ${child.relatedPerson!.nameExtension??''}"), Row(
const Text("Full Name"), children: [
Row(children: [ Checkbox(value: false, onChanged: (value) {}),
Checkbox(value: false, onChanged: (value){}), const Text(incaseOfEmergency)
const Text("Incase of emergency") ],
],) )
]), ]),
), ),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) IconButton(
], onPressed: () {},
),),).toList()), icon: const Icon(
):const SizedBox(), Icons.more_vert,
color: Colors.grey,
))
],
),
),
const SizedBox(
height: 5,
),
//Spouse ---------------------------------------------------------
spouse != null
? Container(
decoration: box1(),
padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
width: screenWidth,
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(spouseText),
const SizedBox(height: 5,),
Text(
" ${spouse!.relatedPerson!.firstName} ${spouse!.relatedPerson!.middleName} ${spouse!.relatedPerson!.lastName} ${spouse!.relatedPerson!.nameExtension ?? ''}",style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500)),
Text(" $fullname",style: Theme.of(context).textTheme.bodySmall),
Row(
children: [
Checkbox(value: false, onChanged: (value) {}),
const Text(incaseOfEmergency)
],
)
]),
),
IconButton(
onPressed: () {},
icon: const Icon(
Icons.more_vert,
color: Colors.grey,
))
],
),
)
: const SizedBox(),
const SizedBox(
height: 5,
),
otherRelated.isNotEmpty?Expanded( // Childrens ----------------------------------
child: ListView( children.isNotEmpty
children: otherRelated.map((relative) => Container( ? Container(
decoration: BoxDecoration( decoration: box1(),
color: Colors.grey[200], child: Column(
borderRadius: const BorderRadius.all(Radius.circular(12))), mainAxisAlignment: MainAxisAlignment.start,
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), crossAxisAlignment: CrossAxisAlignment.start,
width: screenWidth, children: children
child: Row( .map(
children: [ (child){
Expanded( int index = children.indexOf(child);
child: Column( return Container(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.symmetric(
children: [ horizontal: 12, vertical: 8),
const Text("Other related Person(s)"), width: screenWidth,
Text("${relative.relatedPerson!.firstName} ${relative!.relatedPerson!.middleName} ${relative!.relatedPerson!.lastName} ${relative!.relatedPerson!.nameExtension??''}"), child: Column(
const Text("Full Name"), mainAxisAlignment: MainAxisAlignment.start,
Row(children: [ crossAxisAlignment: CrossAxisAlignment.start,
Checkbox(value: false, onChanged: (value){}), children: [
const Text("Incase of emergency") index == 0? const Text(childrenText):const SizedBox(),
],) const SizedBox(
]), height: 5,
), ),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) Row(
], children: [
),),).toList()), Expanded(
):const SizedBox() child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
" ${child.relatedPerson!.firstName} ${child.relatedPerson!.middleName} ${child.relatedPerson!.lastName} ${child.relatedPerson!.nameExtension ?? ''}",style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500)),
Text(" $fullname",style: Theme.of(context).textTheme.bodySmall),
Row(
children: [
Checkbox(
value: false,
onChanged: (value) {}),
const Text(incaseOfEmergency)
],
)
]),
),
IconButton(
onPressed: () {},
icon: const Icon(Icons.more_vert,color: Colors.grey,))
],
),
],
),
);
}
)
.toList()),
)
: const SizedBox(),
const SizedBox(
height: 5,
),
//Other related person
otherRelated.isNotEmpty
? Container(
decoration: box1(),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: otherRelated
.map(
(relative){
int index2 = otherRelated.indexOf(relative);
return Container(
padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 8),
width: screenWidth,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
index2 == 0? const Text(otherRelatedText):const SizedBox(),
const SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
" ${relative.relatedPerson!.firstName} ${relative.relatedPerson!.middleName} ${relative.relatedPerson!.lastName} ${relative.relatedPerson!.nameExtension ?? ''}",style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500)),
Text(" $fullname",style: Theme.of(context).textTheme.bodySmall!),
Row(
children: [
Checkbox(
value: false,
onChanged: (value) {}),
const Text(incaseOfEmergency)
],
)
]),
),
IconButton(
onPressed: () {},
icon: const Icon(Icons.more_vert,color: Colors.grey,))
],
),
],
),
);
}
)
.toList()),
)
: const SizedBox(),
]), ]),
); );
} }
} }

View File

@ -3,8 +3,10 @@ import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart'; import 'package:flutter/src/widgets/placeholder.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:unit2/model/profile/learning_development.dart'; import 'package:unit2/model/profile/learning_development.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart'; import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class LearningAndDevelopmentScreen extends StatefulWidget { class LearningAndDevelopmentScreen extends StatefulWidget {
final List<LearningDevelopement> learningDevelopments; final List<LearningDevelopement> learningDevelopments;
@ -19,23 +21,24 @@ class _LearningAndDevelopmentScreenState extends State<LearningAndDevelopmentScr
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text("Learning and Development"), appBar: AppBar(title: const Text(learningAndDevelopmentScreenTitle),
centerTitle: true, centerTitle: true,
backgroundColor: primary, backgroundColor: primary,
), ),
body: ListView.builder( body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
itemCount: widget.learningDevelopments.length, itemCount: widget.learningDevelopments.length,
itemBuilder: (BuildContext context, int index){ itemBuilder: (BuildContext context, int index){
String training = widget.learningDevelopments[index].conductedTraining!.title!.title!;
String provider = widget.learningDevelopments[index].conductedTraining!.conductedBy!.name!;
String start = dteFormat2.format(widget.learningDevelopments[index].conductedTraining!.fromDate!); String start = dteFormat2.format(widget.learningDevelopments[index].conductedTraining!.fromDate!);
String end = dteFormat2.format(widget.learningDevelopments[index].conductedTraining!.toDate!); String end = dteFormat2.format(widget.learningDevelopments[index].conductedTraining!.toDate!);
String type = widget.learningDevelopments[index].conductedTraining!.learningDevelopmentType!.title!; String type = widget.learningDevelopments[index].conductedTraining!.learningDevelopmentType!.title!;
return Column( return Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: box1(),
color: Colors.grey[200],
borderRadius: const BorderRadius.all(Radius.circular(12))),
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8),
width: screenWidth, width: screenWidth,
child: Row( child: Row(
@ -45,13 +48,14 @@ class _LearningAndDevelopmentScreenState extends State<LearningAndDevelopmentScr
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(widget.learningDevelopments[index].conductedTraining!.title!.title!), Text(training,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500),),
const Divider(),
const SizedBox(height: 5,), const SizedBox(height: 5,),
Text(widget.learningDevelopments[index].conductedTraining!.conductedBy!.name!), Text(provider,style: Theme.of(context).textTheme.titleSmall,),
const SizedBox(height: 5,), const SizedBox(height: 5,),
Text("$start TO $end"), Text("$duration : $start TO $end",style: Theme.of(context).textTheme.labelMedium,),
const SizedBox(height: 5,), const SizedBox(height: 5,),
Text("TYPE : $type"), Text("$type : $type",style: Theme.of(context).textTheme.labelMedium,),
]), ]),
), ),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)), IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)),

View File

@ -25,7 +25,7 @@ class LoadingScreen extends StatelessWidget {
child: ListView( child: ListView(
children: [ children: [
const Text( const Text(
"View and Update your Profile Information"), "View and Update your Profile Information",textAlign: TextAlign.center,),
ExpandableGroup( ExpandableGroup(
collapsedIcon: collapsedIcon:
const Icon(Icons.keyboard_arrow_down), const Icon(Icons.keyboard_arrow_down),

View File

@ -2,8 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart'; import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/other_information/non_acedimic_recognition.dart'; import 'package:unit2/model/profile/other_information/non_acedimic_recognition.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart'; import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class NonAcademicRecognitionScreen extends StatefulWidget { class NonAcademicRecognitionScreen extends StatefulWidget {
final List<NonAcademicRecognition> nonAcademicRecognitions; final List<NonAcademicRecognition> nonAcademicRecognitions;
@ -17,8 +19,9 @@ class _NonAcademicRecognitionScreenState extends State<NonAcademicRecognitionScr
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text("Non Academic Recognition"), centerTitle: true, backgroundColor: primary,), appBar: AppBar(title: const Text(nonAcademicRecTitle), centerTitle: true, backgroundColor: primary,),
body: ListView.builder( body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
itemCount: widget.nonAcademicRecognitions.length, itemCount: widget.nonAcademicRecognitions.length,
itemBuilder: (BuildContext context, int index){ itemBuilder: (BuildContext context, int index){
String award = widget.nonAcademicRecognitions[index].title!; String award = widget.nonAcademicRecognitions[index].title!;
@ -27,9 +30,7 @@ class _NonAcademicRecognitionScreenState extends State<NonAcademicRecognitionScr
children: [ children: [
Container( Container(
width: screenWidth, width: screenWidth,
decoration: BoxDecoration( decoration: box1(),
color: Colors.grey[200],
borderRadius: const BorderRadius.all(Radius.circular(12))),
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8),
child: Row( child: Row(
children: [ children: [
@ -37,11 +38,12 @@ class _NonAcademicRecognitionScreenState extends State<NonAcademicRecognitionScr
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(award), Text(award,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500),),
const Divider(),
Text(presenter), Text(presenter),
],)), ],)),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
], ],
), ),
), ),

View File

@ -2,7 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart'; import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/other_information/organization_memberships.dart'; import 'package:unit2/model/profile/other_information/organization_memberships.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/text_container.dart';
import '../../../../utils/global.dart'; import '../../../../utils/global.dart';
@ -19,26 +21,24 @@ class _OrgMembershipsScreenState extends State<OrgMembershipsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text("Organization Memberships"), title: const Text(orgMembershipTitle),
backgroundColor: primary, backgroundColor: primary,
centerTitle: true, centerTitle: true,
), ),
body: ListView.builder( body: ListView.builder(
itemCount: widget.orgMemberships.length, itemCount: widget.orgMemberships.length,
padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
String entity = String entity =
widget.orgMemberships[index].agency!.privateEntity == false widget.orgMemberships[index].agency!.privateEntity == false
? "Government" ? governmentText.toUpperCase()
: "Private"; : privateText.toUpperCase();
String agencyName = widget.orgMemberships[index].agency!.name!; String agencyName = widget.orgMemberships[index].agency!.name!;
return Column( return Column(
children: [ children: [
Container( Container(
width: screenWidth, width: screenWidth,
decoration: BoxDecoration( decoration: box1(),
color: Colors.grey[200],
borderRadius:
const BorderRadius.all(Radius.circular(12))),
padding: padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8), const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Row(children: [ child: Row(children: [
@ -47,14 +47,17 @@ class _OrgMembershipsScreenState extends State<OrgMembershipsScreen> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(entity),
Text(agencyName), Text(agencyName,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500),),
const Divider(),
Text(entity,style: Theme.of(context).textTheme.labelLarge,),
], ],
)), )),
IconButton( IconButton(
onPressed: () {}, icon: const Icon(Icons.more_vert)) onPressed: () {}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
]), ]),
) ),
const SizedBox(height: 5,),
], ],
); );
}), }),

View File

@ -3,6 +3,8 @@ import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart'; import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/other_information/skills_and_hobbies.dart'; import 'package:unit2/model/profile/other_information/skills_and_hobbies.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/global.dart';
import 'package:unit2/utils/text_container.dart';
class SkillHobbiesScreen extends StatefulWidget { class SkillHobbiesScreen extends StatefulWidget {
final List<SkillsHobbies>skillsHobbies; final List<SkillsHobbies>skillsHobbies;
@ -16,33 +18,35 @@ class _SkillHobbiesScreenState extends State<SkillHobbiesScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text("Skills and Hobbies"), appBar: AppBar(title: const Text(skillAndHobbiesTitle),
backgroundColor: primary, backgroundColor: primary,
centerTitle: true, centerTitle: true,
), ),
body: Wrap( body: Padding(
spacing: 5, padding: const EdgeInsets.all(16),
runSpacing: 5, child: Wrap(
clipBehavior: Clip.none, spacing: 8,
verticalDirection: VerticalDirection.down, runSpacing: 8,
children:widget.skillsHobbies.map((SkillsHobbies sh){ alignment: WrapAlignment.start,
return Badge( clipBehavior: Clip.none,
padding: const EdgeInsets.all(8), verticalDirection: VerticalDirection.up,
alignment: AlignmentDirectional.topStart, crossAxisAlignment: WrapCrossAlignment.start,
backgroundColor: Colors.grey.shade300, direction: Axis.horizontal,
child: Row( children:widget.skillsHobbies.map((SkillsHobbies sh){
children: [ return FittedBox(
Text(sh.name!), child: Row(
IconButton( children: [
onPressed: () {}, Text(sh.name!),
icon: const Icon(Icons.close)), IconButton(
], onPressed: () {},
), icon: const Icon(Icons.close)),
],
); ),
}).toList() );
}).toList()
),
), ),
); );
} }

View File

@ -2,7 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart'; import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/references.dart'; import 'package:unit2/model/profile/references.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/text_container.dart';
class ReferencesScreen extends StatefulWidget { class ReferencesScreen extends StatefulWidget {
final List<PersonalReference> references; final List<PersonalReference> references;
@ -17,19 +19,18 @@ class _ReferencesScreenState extends State<ReferencesScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text("Personal References"),centerTitle: true,backgroundColor: primary,), appBar: AppBar(title: const Text(referencesScreenTitle),centerTitle: true,backgroundColor: primary,),
body: ListView.builder( body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
itemCount: widget.references.length, itemCount: widget.references.length,
itemBuilder: (BuildContext context, int index){ itemBuilder: (BuildContext context, int index){
String fullname = "${widget.references[0].firstName} ${widget.references[0].middleName} ${widget.references[0].lastName}"; String fullname = "${widget.references[index].firstName} ${widget.references[index].middleName} ${widget.references[index].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 addres = "${widget.references[index].address!.cityMunicipality!.description}, ${widget.references[index].address!.cityMunicipality!.province!.description}, ${widget.references[0].address!.cityMunicipality!.province!.region!.description}";
String mobile = widget.references[0].contactNo.toString(); String mobile = widget.references[index].contactNo.toString();
return Column(children: [ return Column(children: [
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8),
decoration: BoxDecoration( decoration:box1(),
color: Colors.grey[200],
borderRadius: const BorderRadius.all(Radius.circular(12))),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -38,18 +39,19 @@ class _ReferencesScreenState extends State<ReferencesScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(fullname,style: Theme.of(context).textTheme.titleLarge!.copyWith(fontWeight: FontWeight.bold)), Text(fullname,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500)),
const Divider(),
const SizedBox(height: 5,), const SizedBox(height: 5,),
Text(addres,style: Theme.of(context).textTheme.labelLarge!.copyWith(fontWeight: FontWeight.bold)), Text(addres,style: Theme.of(context).textTheme.titleSmall!.copyWith(fontWeight: FontWeight.w500)),
const SizedBox(height: 8,), const SizedBox(height: 8,),
Text("PHONE / MOBILE NUMBER $mobile",style: Theme.of(context).textTheme.labelSmall!.copyWith(fontWeight: FontWeight.bold)), Text("${mobileOrPhone.toUpperCase()} : $mobile",style: Theme.of(context).textTheme.labelMedium!),
],), ],),
), ),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
], ],
), ),
), ),
const SizedBox(height: 8,), const SizedBox(height: 5,),
],); ],);
}) , }) ,
); );

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart'; 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:intl/intl.dart';
import 'package:unit2/model/profile/voluntary_works.dart'; import 'package:unit2/model/profile/voluntary_works.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/text_container.dart';
class VolunataryWorkScreen extends StatefulWidget { class VolunataryWorkScreen extends StatefulWidget {
final List<VoluntaryWork> voluntaryWorks; final List<VoluntaryWork> voluntaryWorks;
@ -18,9 +18,10 @@ class _VolunataryWorkScreenState extends State<VolunataryWorkScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text("Volunatary Work & Civic Services"),backgroundColor: primary,), appBar: AppBar(title: const Text(voluntaryScreenTitle),backgroundColor: primary,),
body: ListView.builder( body: ListView.builder(
itemCount:widget.voluntaryWorks.length , itemCount:widget.voluntaryWorks.length ,
padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
itemBuilder: (BuildContext context, int index){ itemBuilder: (BuildContext context, int index){
String position = widget.voluntaryWorks[index].position!.title!; String position = widget.voluntaryWorks[index].position!.title!;
String agency = widget.voluntaryWorks[index].agency!.name!; String agency = widget.voluntaryWorks[index].agency!.name!;
@ -30,9 +31,7 @@ class _VolunataryWorkScreenState extends State<VolunataryWorkScreen> {
return Column( return Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration:box1(),
color: Colors.grey[200],
borderRadius: const BorderRadius.all(Radius.circular(12))),
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8),
child: Row( child: Row(
children: [ children: [
@ -41,10 +40,14 @@ class _VolunataryWorkScreenState extends State<VolunataryWorkScreen> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(position), Text(position,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500),),
Text(agency), const SizedBox(height: 5,),
Text("$from to $to"), Text(agency,style: Theme.of(context).textTheme.titleSmall,),
Text("Worked/Involved for: $hours hours"), const Divider(),
const SizedBox(height: 3,),
Text("$duration : $from to $to"),
const SizedBox(height: 5,),
Text("$numberOfHours : $hours hours"),
]), ]),
), ),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert))

View File

@ -1,59 +1,71 @@
import 'package:flutter/material.dart'; 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:intl/intl.dart';
import 'package:unit2/model/profile/work_history.dart'; import 'package:unit2/model/profile/work_history.dart';
import 'package:unit2/theme-data.dart/box_shadow.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/text_container.dart';
import '../../../utils/global.dart'; import '../../../utils/global.dart';
class WorkHistoryScreen extends StatefulWidget { class WorkHistoryScreen extends StatefulWidget {
final List<WorkHistory>workExperiences; final List<WorkHistory> workExperiences;
const WorkHistoryScreen({super.key,required this.workExperiences}); const WorkHistoryScreen({super.key, required this.workExperiences});
@override @override
State<WorkHistoryScreen> createState() => _WorkHistoryScreenState(); State<WorkHistoryScreen> createState() => _WorkHistoryScreenState();
} }
class _WorkHistoryScreenState extends State<WorkHistoryScreen> { class _WorkHistoryScreenState extends State<WorkHistoryScreen> {
DateFormat dteFormat2 = DateFormat.yMMMMd('en_US'); DateFormat dteFormat2 = DateFormat.yMMMMd('en_US');
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text("Work History"),backgroundColor: primary,centerTitle: true,), appBar: AppBar(
title: const Text(workHistoryScreenTitle),
backgroundColor: primary,
centerTitle: true,
),
body: ListView.builder( body: ListView.builder(
itemCount: widget.workExperiences.length, padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
itemBuilder: (BuildContext context, int index){ itemCount: widget.workExperiences.length,
String position = widget.workExperiences[index].position!.title!; itemBuilder: (BuildContext context, int index) {
String agency = widget.workExperiences[index].agency!.name!; String position = widget.workExperiences[index].position!.title!;
String from = dteFormat2.format(widget.workExperiences[index].fromDate!); String agency = widget.workExperiences[index].agency!.name!;
String? to = widget.workExperiences[index].toDate == null? "Present" : dteFormat2.format(widget.workExperiences[index].toDate!); String from =
return Column( dteFormat2.format(widget.workExperiences[index].fromDate!);
mainAxisAlignment: MainAxisAlignment.start, String? to = widget.workExperiences[index].toDate == null
crossAxisAlignment: CrossAxisAlignment.start, ? present.toUpperCase()
children: [ : dteFormat2.format(widget.workExperiences[index].toDate!);
Container( return Column(
width: screenWidth,
decoration: BoxDecoration( children: [
color: Colors.grey[200], Container(
borderRadius: const BorderRadius.all(Radius.circular(12))), width: screenWidth,
padding: const EdgeInsets.symmetric(horizontal: 12,vertical: 8), decoration: box1(),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Row(children: [ child: Row(children: [
Expanded(child: Column( Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(position), Text(position,style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w600),),
Text(agency), const Divider(),
Text("$from to $to"), const SizedBox(height: 8,),
],)), Text(agency,style: Theme.of(context).textTheme.titleSmall!.copyWith(fontWeight: FontWeight.w500),),
IconButton(onPressed: (){}, icon: const Icon(Icons.more_vert)) const SizedBox(height: 5,),
Text("$from to $to",style: Theme.of(context).textTheme.bodyMedium,),
],
)),
IconButton(onPressed: () {}, icon: const Icon(Icons.more_vert,color: Colors.grey,))
]), ]),
), ),
const SizedBox(height: 5,), const SizedBox(
], height: 5,
); ),
],
);
}), }),
); );
} }
} }

View File

@ -10,20 +10,20 @@ import 'package:fluttericon/modern_pictograms_icons.dart';
import 'package:unit2/bloc/profile/profile_bloc.dart'; import 'package:unit2/bloc/profile/profile_bloc.dart';
import 'package:unit2/screens/profile/components/basic_information/address_screen.dart'; import 'package:unit2/screens/profile/components/basic_information/address_screen.dart';
import 'package:unit2/screens/profile/components/basic_information/citizenship_screen.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/contact_information_screen.dart';
import 'package:unit2/screens/profile/components/basic_information/identification_information.dart'; import 'package:unit2/screens/profile/components/basic_information/identification_information_screen.dart';
import 'package:unit2/screens/profile/components/basic_information/primary_information.dart'; import 'package:unit2/screens/profile/components/basic_information/primary_information_screen.dart';
import 'package:unit2/screens/profile/components/education_screen.dart'; import 'package:unit2/screens/profile/components/education_screen.dart';
import 'package:unit2/screens/profile/components/eligibility.dart'; import 'package:unit2/screens/profile/components/eligibility_screen.dart';
import 'package:unit2/screens/profile/components/family_background_screen.dart'; import 'package:unit2/screens/profile/components/family_background_screen.dart';
import 'package:unit2/screens/profile/components/learning_and_development_screen.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/loading_screen.dart';
import 'package:unit2/screens/profile/components/other_information/non_academic_recognition.dart'; import 'package:unit2/screens/profile/components/other_information/non_academic_recognition_screen.dart';
import 'package:unit2/screens/profile/components/other_information/org_membership.dart'; import 'package:unit2/screens/profile/components/other_information/org_membership_screen.dart';
import 'package:unit2/screens/profile/components/other_information/skills_and_hobbies_screen.dart'; import 'package:unit2/screens/profile/components/other_information/skills_and_hobbies_screen.dart';
import 'package:unit2/screens/profile/components/references_screen.dart'; import 'package:unit2/screens/profile/components/references_screen.dart';
import 'package:unit2/screens/profile/components/work_history_screen.dart'; import 'package:unit2/screens/profile/components/work_history_screen.dart';
import 'package:unit2/screens/profile/voluntary_works.dart'; import 'package:unit2/screens/profile/components/voluntary_works_screen.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import '../../bloc/user/user_bloc.dart'; import '../../bloc/user/user_bloc.dart';
import 'components/main_menu.dart'; import 'components/main_menu.dart';
@ -39,227 +39,227 @@ class ProfileInfo extends StatefulWidget {
class _ProfileInfoState extends State<ProfileInfo> { class _ProfileInfoState extends State<ProfileInfo> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return Scaffold(
child: Scaffold( appBar: AppBar(
appBar: AppBar( backgroundColor: primary,
backgroundColor: primary, centerTitle: true,
centerTitle: true, title: const Text('Profile'),
title: const Text('Profile'), ),
), body: ProgressHUD(
body: ProgressHUD( child:
child: BlocBuilder<UserBloc, UserState>(builder: (context, state) {
BlocBuilder<UserBloc, UserState>(builder: (context, state) { if (state is UserLoggedIn) {
if (state is UserLoggedIn) { return BlocConsumer<ProfileBloc, ProfileState>(
return BlocConsumer<ProfileBloc, ProfileState>( listener: (context, state) {
listener: (context, state) { if (state is ProfileLoading) {
if (state is ProfileLoading) { final progress = ProgressHUD.of(context);
final progress = ProgressHUD.of(context); progress?.showWithText(
progress?.showWithText( 'Loading Profile',
'Loading Profile', );
); }
} if (state is ProfileLoaded) {
if (state is ProfileLoaded) { final progress = ProgressHUD.of(context);
final progress = ProgressHUD.of(context); progress?.dismiss();
progress?.dismiss(); }
} },
}, builder: (context, state) {
builder: (context, state) { if (state is ProfileLoaded) {
if (state is ProfileLoaded) {
return Container( return Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
vertical: 12, horizontal: 12), vertical: 12, horizontal: 12),
child: ListView( child: ListView(
children: [ children: [
const Text( Text(
"View and Update your Profile Information"), "View and Update your Profile Information",textAlign: TextAlign.center
ExpandableGroup( ,style: Theme.of(context).textTheme.bodyLarge,),
collapsedIcon: ExpandableGroup(
const Icon(Icons.keyboard_arrow_down), collapsedIcon:
expandedIcon: const Icon(Icons.keyboard_arrow_down),
const Icon(Icons.keyboard_arrow_up), expandedIcon:
header: const ListTile( const Icon(Icons.keyboard_arrow_up),
leading: Icon( header: const ListTile(
Elusive.address_book, leading: Icon(
color: primary, Elusive.address_book,
), color: primary,
title: Text( ),
"Basic Information", title: Text(
style: TextStyle( "Basic Information",
fontWeight: FontWeight.bold), style: TextStyle(
), fontWeight: FontWeight.bold),
), ),
items: [ ),
subMenu(Icons.person, "Primary",(){ items: [
Navigator.push(context,MaterialPageRoute(builder: (BuildContext context){ subMenu(Icons.person, "Primary",(){
return PrimaryInfo(primaryInformation: state.profileInformation.basicInfo.primaryInformation!); Navigator.push(context,MaterialPageRoute(builder: (BuildContext context){
}) ); return PrimaryInfo(primaryInformation: state.profileInformation.basicInfo.primaryInformation!);
}), }) );
subMenu(Icons.home, "Home Addresses",(){ }),
Navigator.push(context,MaterialPageRoute(builder: (BuildContext context){ subMenu(Icons.home, "Home Addresses",(){
return AddressScreen(addresses: state.profileInformation.basicInfo.addresses); Navigator.push(context,MaterialPageRoute(builder: (BuildContext context){
}) ); return AddressScreen(addresses: state.profileInformation.basicInfo.addresses);
}) );
}),
subMenu( }),
Icons.contact_mail, "Identifications",(){ subMenu(
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ Icons.contact_mail, "Identifications",(){
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",(){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return CitizenShipScreen(citizenships: state.profileInformation.basicInfo.citizenships,); return IdentificationsScreen(identities: state.profileInformation.basicInfo.identifications);
})); }));
}), }),
]), subMenu(
const Divider(), Icons.contact_phone, "Contact Info",(){
MainMenu( Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
icon: Elusive.group, return ContactInformationScreen(contacts: state.profileInformation.basicInfo.contactInformation,);
title: "Family", }));
onTap: (){ }),
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ subMenu(Icons.flag, "Citizenships",(){
return FamilyBackgroundScreen(familyBackground: state.profileInformation.families);
}));
},
),
const Divider(),
MainMenu(
icon: FontAwesome5.graduation_cap,
title: "Education",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return EducationScreen(educationBackgrounds: state.profileInformation.educationalBackgrounds);
}));
},
),
const Divider(),
MainMenu(
icon: Icons.stars,
title: "Eligibility",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return EligibiltyScreen(eligibilities: state.profileInformation.eligibilities); return CitizenShipScreen(citizenships: state.profileInformation.basicInfo.citizenships,);
})); }));
}, }),
), ]),
const Divider(), const Divider(),
MainMenu( MainMenu(
icon: FontAwesome5.shopping_bag, icon: Elusive.group,
title: "Work History", title: "Family",
onTap: (){ onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return WorkHistoryScreen(workExperiences: state.profileInformation.workExperiences); return FamilyBackgroundScreen(familyBackground: state.profileInformation.families);
})); }));
}, },
),
const Divider(),
MainMenu(
icon: FontAwesome5.walking,
title: "Voluntary Work & Civic Services",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return VolunataryWorkScreen(voluntaryWorks: state.profileInformation.voluntaryWorks);
}));
},
),
const Divider(),
MainMenu(
icon: Elusive.lightbulb,
title: "Learning & Development",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return LearningAndDevelopmentScreen(learningDevelopments: state.profileInformation.learningsAndDevelopment);
}));
},
),
const Divider(),
MainMenu(
icon: Brandico.codepen,
title: "Personal References",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return ReferencesScreen(references: state.profileInformation.references);
}));
},
),
ExpandableGroup(
collapsedIcon:
const Icon(Icons.keyboard_arrow_down),
expandedIcon:
const Icon(Icons.keyboard_arrow_up),
header: const ListTile(
leading: Icon(
Icons.info,
color: primary,
),
title: Text(
"Other Information",
style: TextStyle(
fontWeight: FontWeight.bold),
),
),
items: [
subMenu(Icons.fitness_center,
"Skills & Hobbies",(){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return SkillHobbiesScreen(skillsHobbies: state.profileInformation.otherInformation.skillsAndHobbies);
}));
}),
subMenu(FontAwesome5.certificate,
"Organization Memberships",(){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return OrgMembershipsScreen(orgMemberships: state.profileInformation.otherInformation.orgMemberships);
}));
}),
subMenu(Entypo.doc_text,
"Non-Academic Recognitions",(){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return NonAcademicRecognitionScreen(nonAcademicRecognitions: state.profileInformation.otherInformation.nonAcademicRecognition);
}));
}),
]),
ExpandableGroup(
collapsedIcon:
const Icon(Icons.keyboard_arrow_down),
expandedIcon:
const Icon(Icons.keyboard_arrow_up),
header: const ListTile(
leading: Icon(
FontAwesome5.laptop_house,
color: primary,
),
title: Text(
"Assets",
style: TextStyle(
fontWeight: FontWeight.bold),
),
),
items: [
subMenu(ModernPictograms.home,
"Real Property Tax",(){}),
]),
],
), ),
); const Divider(),
} MainMenu(
if (state is ProfileLoading) { icon: FontAwesome5.graduation_cap,
return const LoadingScreen(); title: "Education",
} onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return EducationScreen(educationBackgrounds: state.profileInformation.educationalBackgrounds);
}));
},
),
const Divider(),
MainMenu(
icon: Icons.stars,
title: "Eligibility",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return EligibiltyScreen(eligibilities: state.profileInformation.eligibilities);
}));
},
),
const Divider(),
MainMenu(
icon: FontAwesome5.shopping_bag,
title: "Work History",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return WorkHistoryScreen(workExperiences: state.profileInformation.workExperiences);
}));
},
),
const Divider(),
MainMenu(
icon: FontAwesome5.walking,
title: "Voluntary Work & Civic Services",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return VolunataryWorkScreen(voluntaryWorks: state.profileInformation.voluntaryWorks);
}));
},
),
const Divider(),
MainMenu(
icon: Elusive.lightbulb,
title: "Learning & Development",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return LearningAndDevelopmentScreen(learningDevelopments: state.profileInformation.learningsAndDevelopment);
}));
},
),
const Divider(),
MainMenu(
icon: Brandico.codepen,
title: "Personal References",
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return ReferencesScreen(references: state.profileInformation.references);
}));
},
),
ExpandableGroup(
collapsedIcon:
const Icon(Icons.keyboard_arrow_down),
expandedIcon:
const Icon(Icons.keyboard_arrow_up),
header: const ListTile(
leading: Icon(
Icons.info,
color: primary,
),
title: Text(
"Other Information",
style: TextStyle(
fontWeight: FontWeight.bold),
),
),
items: [
subMenu(Icons.fitness_center,
"Skills & Hobbies",(){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return SkillHobbiesScreen(skillsHobbies: state.profileInformation.otherInformation.skillsAndHobbies);
}));
}),
subMenu(FontAwesome5.certificate,
"Organization Memberships",(){
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
return OrgMembershipsScreen(orgMemberships: state.profileInformation.otherInformation.orgMemberships);
}));
}),
subMenu(Entypo.doc_text,
"Non-Academic Recognitions",(){
return Container(); Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
}, return NonAcademicRecognitionScreen(nonAcademicRecognitions: state.profileInformation.otherInformation.nonAcademicRecognition);
); }));
} }),
return Container(); ]),
}), ExpandableGroup(
))); collapsedIcon:
const Icon(Icons.keyboard_arrow_down),
expandedIcon:
const Icon(Icons.keyboard_arrow_up),
header: const ListTile(
leading: Icon(
FontAwesome5.laptop_house,
color: primary,
),
title: Text(
"Assets",
style: TextStyle(
fontWeight: FontWeight.bold),
),
),
items: [
subMenu(ModernPictograms.home,
"Real Property Tax",(){}),
]),
],
),
);
}
if (state is ProfileLoading) {
return const LoadingScreen();
}
return Container();
},
);
}
return Container();
}),
));
} }
} }

View File

@ -0,0 +1,8 @@
import 'package:flutter/material.dart';
BoxDecoration box1(){
return const BoxDecoration(
boxShadow: [BoxShadow(color: Colors.black12,spreadRadius: 5,blurRadius: 5)] ,
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(3)));
}

View File

@ -69,6 +69,50 @@ const String timeoutError = "Internet timeout! Please Check your connection";
const String formatError = "Invalid Error"; const String formatError = "Invalid Error";
const String httpError = "Error getting requested data"; const String httpError = "Error getting requested data";
const String onError = "Something went wrong! Please try again."; const String onError = "Something went wrong! Please try again.";
// const String adressScreenTitle = "Addresses";
const String citizenshipScreenTitle = "Citizenship";
const String contactScreenTitle = "Contact Information";
const String identificationScreenTitle = "Identifications";
const String idNumberText = "ID number";
const String privateText = 'private';
const String governmentText = "government";
const String primaryInformationScreenTitle = "Primary Information";
const String lastname = "lastname";
const String firstname = "firstname";
const String middlename = "middlename";
const String extensionName = 'extension-name';
const String birthDat = 'bday';
const String sex = 'sex';
const String bloodType = 'bloodtype';
const String civilStatus = 'civil-status';
const String gender = 'gender';
const String height = 'height';
const String width = 'width';
const String prefixSuffix = 'prefix&suffix';
const String nonAcademicRecTitle = "Non Academic Recognition";
const String orgMembershipTitle = "Organization Membership";
const String skillAndHobbiesTitle = "Skills and Hobbies";
const String educationScreenTitle = "Educational Background";
const String honorsText = 'Honors';
const String elibilityScreenTitle = "Eligibility";
const String licenseNumber = "LicenseNumber";
const String rating = "Rating";
const String familyBackgroundScreenTitle = "Family Background";
const String fatherText = "Father";
const String fullname = "Full name";
const String incaseOfEmergency = "Incase of emergency";
const String motherText = 'Mother';
const String spouseText = "Spouse";
const String childrenText = "Children";
const String otherRelatedText = "Other related person";
const String learningAndDevelopmentScreenTitle = "Learning and Development";
const String duration = "Duration";
const String type = "Type";
const String referencesScreenTitle = "Personal References";
const String mobileOrPhone = "phone / mobile number";
const String voluntaryScreenTitle = "Voluntary Work & Civic Services";
const String numberOfHours = "Worked/Involved for";
const String workHistoryScreenTitle = "Work History";
const String present = "present";
// //