2023-01-26 02:15:00 +00:00
|
|
|
import 'package:expandable_group/expandable_group_widget.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
2023-02-01 08:03:05 +00:00
|
|
|
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
2023-01-26 02:15:00 +00:00
|
|
|
import 'package:fluttericon/brandico_icons.dart';
|
|
|
|
import 'package:fluttericon/elusive_icons.dart';
|
|
|
|
import 'package:fluttericon/entypo_icons.dart';
|
|
|
|
import 'package:fluttericon/font_awesome5_icons.dart';
|
|
|
|
import 'package:fluttericon/modern_pictograms_icons.dart';
|
2023-02-01 08:03:05 +00:00
|
|
|
import 'package:unit2/bloc/profile/profile_bloc.dart';
|
2023-02-03 03:34:09 +00:00
|
|
|
import 'package:unit2/screens/profile/components/basic_information/citizenship_screen.dart';
|
2023-02-01 08:03:05 +00:00
|
|
|
import 'package:unit2/screens/profile/components/basic_information/contact_information.dart';
|
2023-02-03 03:34:09 +00:00
|
|
|
import 'package:unit2/screens/profile/components/basic_information/identification_information.dart';
|
2023-02-01 08:03:05 +00:00
|
|
|
import 'package:unit2/screens/profile/components/basic_information/primary_information.dart';
|
2023-02-03 03:34:09 +00:00
|
|
|
import 'package:unit2/screens/profile/components/eligibility.dart';
|
|
|
|
import 'package:unit2/screens/profile/components/learning_and_development_screen.dart';
|
2023-02-01 08:03:05 +00:00
|
|
|
import 'package:unit2/screens/profile/components/loading_screen.dart';
|
2023-02-03 03:34:09 +00:00
|
|
|
import 'package:unit2/screens/profile/components/references_screen.dart';
|
2023-01-26 02:15:00 +00:00
|
|
|
import 'package:unit2/theme-data.dart/colors.dart';
|
2023-02-01 08:03:05 +00:00
|
|
|
import '../../bloc/user/user_bloc.dart';
|
2023-01-26 02:15:00 +00:00
|
|
|
import 'components/main_menu.dart';
|
|
|
|
import 'components/submenu.dart';
|
|
|
|
|
|
|
|
class ProfileInfo extends StatefulWidget {
|
|
|
|
const ProfileInfo({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<ProfileInfo> createState() => _ProfileInfoState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _ProfileInfoState extends State<ProfileInfo> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return SafeArea(
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
backgroundColor: primary,
|
|
|
|
centerTitle: true,
|
|
|
|
title: const Text('Profile'),
|
|
|
|
),
|
2023-02-01 08:03:05 +00:00
|
|
|
body: ProgressHUD(
|
|
|
|
child:
|
|
|
|
BlocBuilder<UserBloc, UserState>(builder: (context, state) {
|
2023-01-26 02:15:00 +00:00
|
|
|
if (state is UserLoggedIn) {
|
2023-02-01 08:03:05 +00:00
|
|
|
return BlocConsumer<ProfileBloc, ProfileState>(
|
|
|
|
listener: (context, state) {
|
|
|
|
if (state is ProfileLoading) {
|
|
|
|
final progress = ProgressHUD.of(context);
|
|
|
|
progress?.showWithText(
|
|
|
|
'Loading Profile',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if (state is ProfileLoaded) {
|
|
|
|
final progress = ProgressHUD.of(context);
|
|
|
|
progress?.dismiss();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
builder: (context, state) {
|
|
|
|
if (state is ProfileLoaded) {
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
vertical: 12, horizontal: 12),
|
|
|
|
child: ListView(
|
|
|
|
children: [
|
|
|
|
const Text(
|
|
|
|
"View and Update your Profile Information"),
|
|
|
|
ExpandableGroup(
|
|
|
|
collapsedIcon:
|
|
|
|
const Icon(Icons.keyboard_arrow_down),
|
|
|
|
expandedIcon:
|
|
|
|
const Icon(Icons.keyboard_arrow_up),
|
|
|
|
header: const ListTile(
|
|
|
|
leading: Icon(
|
|
|
|
Elusive.address_book,
|
|
|
|
color: primary,
|
|
|
|
),
|
|
|
|
title: Text(
|
|
|
|
"Basic Information",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
items: [
|
|
|
|
subMenu(Icons.person, "Primary",(){
|
|
|
|
Navigator.push(context,MaterialPageRoute(builder: (BuildContext context){
|
|
|
|
return PrimaryInfo(primaryInformation: state.profileInformation.basicInfo.primaryInformation);
|
|
|
|
}) );
|
|
|
|
}),
|
|
|
|
subMenu(Icons.home, "Home Addresses",(){}),
|
|
|
|
subMenu(
|
2023-02-03 03:34:09 +00:00
|
|
|
Icons.contact_mail, "Identifications",(){
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
|
|
|
|
return IdentificationInformations(identities: state.profileInformation.basicInfo.identifications);
|
|
|
|
}));
|
|
|
|
}),
|
2023-02-01 08:03:05 +00:00
|
|
|
subMenu(
|
|
|
|
Icons.contact_phone, "Contact Info",(){
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
|
|
|
|
return ContactInformation(contacts: state.profileInformation.basicInfo.contactInformation,);
|
|
|
|
}));
|
|
|
|
}),
|
2023-02-03 03:34:09 +00:00
|
|
|
subMenu(Icons.flag, "Citizenships",(){
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
|
|
|
|
return CitizenShipScreen(citizenships: state.profileInformation.basicInfo.citizenships,);
|
|
|
|
}));
|
|
|
|
}),
|
2023-02-01 08:03:05 +00:00
|
|
|
]),
|
|
|
|
const Divider(),
|
2023-02-03 03:34:09 +00:00
|
|
|
MainMenu(
|
2023-02-01 08:03:05 +00:00
|
|
|
icon: Elusive.group,
|
|
|
|
title: "Family",
|
2023-02-03 03:34:09 +00:00
|
|
|
onTap: (){},
|
2023-01-26 02:15:00 +00:00
|
|
|
),
|
2023-02-01 08:03:05 +00:00
|
|
|
const Divider(),
|
2023-02-03 03:34:09 +00:00
|
|
|
MainMenu(
|
2023-02-01 08:03:05 +00:00
|
|
|
icon: FontAwesome5.graduation_cap,
|
|
|
|
title: "Education",
|
2023-02-03 03:34:09 +00:00
|
|
|
onTap: (){},
|
2023-01-26 02:15:00 +00:00
|
|
|
),
|
2023-02-01 08:03:05 +00:00
|
|
|
const Divider(),
|
2023-02-03 03:34:09 +00:00
|
|
|
MainMenu(
|
2023-02-01 08:03:05 +00:00
|
|
|
icon: Icons.stars,
|
|
|
|
title: "Eligibility",
|
2023-02-03 03:34:09 +00:00
|
|
|
onTap: (){
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
|
|
|
|
return EligibiltyScreen(eligibilities: state.profileInformation.eligibilities);
|
|
|
|
}));
|
|
|
|
},
|
2023-01-26 02:15:00 +00:00
|
|
|
),
|
2023-02-01 08:03:05 +00:00
|
|
|
const Divider(),
|
2023-02-03 03:34:09 +00:00
|
|
|
MainMenu(
|
2023-02-01 08:03:05 +00:00
|
|
|
icon: FontAwesome5.shopping_bag,
|
|
|
|
title: "Work History",
|
2023-02-03 03:34:09 +00:00
|
|
|
onTap: (){},
|
2023-01-26 02:15:00 +00:00
|
|
|
),
|
2023-02-01 08:03:05 +00:00
|
|
|
const Divider(),
|
2023-02-03 03:34:09 +00:00
|
|
|
MainMenu(
|
2023-02-01 08:03:05 +00:00
|
|
|
icon: FontAwesome5.walking,
|
|
|
|
title: "Voluntary Work & Civic Services",
|
2023-02-03 03:34:09 +00:00
|
|
|
onTap: (){},
|
2023-01-26 02:15:00 +00:00
|
|
|
),
|
2023-02-01 08:03:05 +00:00
|
|
|
const Divider(),
|
2023-02-03 03:34:09 +00:00
|
|
|
MainMenu(
|
2023-02-01 08:03:05 +00:00
|
|
|
icon: Elusive.lightbulb,
|
|
|
|
title: "Learning & Development",
|
2023-02-03 03:34:09 +00:00
|
|
|
onTap: (){
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
|
|
|
|
return LearningAndDevelopmentScreen(learningDevelopments: state.profileInformation.learningsAndDevelopment);
|
|
|
|
}));
|
|
|
|
},
|
2023-01-26 02:15:00 +00:00
|
|
|
),
|
2023-02-01 08:03:05 +00:00
|
|
|
const Divider(),
|
2023-02-03 03:34:09 +00:00
|
|
|
MainMenu(
|
2023-02-01 08:03:05 +00:00
|
|
|
icon: Brandico.codepen,
|
|
|
|
title: "Personal References",
|
2023-02-03 03:34:09 +00:00
|
|
|
onTap: (){
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
|
|
|
|
return ReferencesScreen(references: state.profileInformation.references);
|
|
|
|
}));
|
|
|
|
},
|
2023-02-01 08:03:05 +00:00
|
|
|
),
|
|
|
|
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",(){}),
|
|
|
|
subMenu(FontAwesome5.certificate,
|
|
|
|
"Organization Memberships",(){}),
|
|
|
|
subMenu(Entypo.doc_text,
|
|
|
|
"Non-Academic Recognitions",(){}),
|
|
|
|
]),
|
|
|
|
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();
|
|
|
|
},
|
2023-01-26 02:15:00 +00:00
|
|
|
);
|
|
|
|
}
|
2023-02-01 08:03:05 +00:00
|
|
|
return Container();
|
|
|
|
}),
|
2023-01-26 02:15:00 +00:00
|
|
|
)));
|
|
|
|
}
|
|
|
|
}
|