Display of Sectors of Interest
parent
78b9f1bc7b
commit
d0ad8d6745
|
@ -4,7 +4,7 @@ class Constants {
|
|||
/// Title of the app
|
||||
static const String appTitle = 'Cofounderella';
|
||||
static const String appVersion = '1.0.1';
|
||||
static const String appCompilationDate = '2024-06-19';
|
||||
static const String appCompilationDate = '2024-06-20';
|
||||
|
||||
static const String dbCollectionFeedbacks = 'feedbacks';
|
||||
static const String dbCollectionUsers = 'Users';
|
||||
|
|
|
@ -256,33 +256,47 @@ enum RiskTolerance {
|
|||
enum SectorOption {
|
||||
agriculture,
|
||||
ai,
|
||||
vr,
|
||||
ar,
|
||||
automotive,
|
||||
beauty,
|
||||
bigdata,
|
||||
blockchain,
|
||||
cloud,
|
||||
construction,
|
||||
consulting,
|
||||
crypto,
|
||||
cybersecurity,
|
||||
ecommerce,
|
||||
education,
|
||||
energy,
|
||||
fashion,
|
||||
finance,
|
||||
food,
|
||||
gaming,
|
||||
hardware,
|
||||
healthcare,
|
||||
home,
|
||||
industry,
|
||||
insurance,
|
||||
iot,
|
||||
it,
|
||||
legal,
|
||||
ml,
|
||||
marketing,
|
||||
media,
|
||||
mobility,
|
||||
pharma,
|
||||
retail,
|
||||
robotics,
|
||||
saas,
|
||||
sports,
|
||||
travel;
|
||||
software,
|
||||
telecommunication,
|
||||
transport,
|
||||
travel,
|
||||
vr,
|
||||
web,
|
||||
other;
|
||||
|
||||
String get displayName {
|
||||
switch (this) {
|
||||
|
@ -290,20 +304,28 @@ enum SectorOption {
|
|||
return 'Agriculture';
|
||||
case SectorOption.ai:
|
||||
return 'Artificial Intelligence';
|
||||
case SectorOption.vr:
|
||||
return 'Augmented/Virtual Reality';
|
||||
case SectorOption.ar:
|
||||
return 'Augmented Reality';
|
||||
case SectorOption.automotive:
|
||||
return 'Automotive';
|
||||
case SectorOption.beauty:
|
||||
return 'Beauty and Personal Care';
|
||||
case SectorOption.bigdata:
|
||||
return 'Big Data';
|
||||
case SectorOption.blockchain:
|
||||
return 'Blockchain';
|
||||
case SectorOption.cloud:
|
||||
return 'Cloud Computing';
|
||||
case SectorOption.construction:
|
||||
return 'Construction and Real Estate';
|
||||
case SectorOption.consulting:
|
||||
return 'Consulting and Agency';
|
||||
case SectorOption.crypto:
|
||||
return 'Cryptocurrencies/Digital Assets';
|
||||
return 'Cryptocurrencies and Digital Assets';
|
||||
case SectorOption.cybersecurity:
|
||||
return 'Cybersecurity';
|
||||
case SectorOption.ecommerce:
|
||||
return 'E-Commerce';
|
||||
case SectorOption.education:
|
||||
return 'Education';
|
||||
case SectorOption.energy:
|
||||
|
@ -316,6 +338,8 @@ enum SectorOption {
|
|||
return 'Food and Beverage';
|
||||
case SectorOption.gaming:
|
||||
return 'Gaming';
|
||||
case SectorOption.hardware:
|
||||
return 'Hardware';
|
||||
case SectorOption.healthcare:
|
||||
return 'Healthcare';
|
||||
case SectorOption.home:
|
||||
|
@ -326,12 +350,18 @@ enum SectorOption {
|
|||
return 'Insurance';
|
||||
case SectorOption.iot:
|
||||
return 'Internet of Things';
|
||||
case SectorOption.it:
|
||||
return 'IT';
|
||||
case SectorOption.legal:
|
||||
return 'Legal and Compliance';
|
||||
case SectorOption.ml:
|
||||
return 'Machine Learning';
|
||||
case SectorOption.marketing:
|
||||
return 'Marketing and Advertising';
|
||||
case SectorOption.media:
|
||||
return 'Media and Entertainment';
|
||||
case SectorOption.mobility:
|
||||
return 'Mobility';
|
||||
case SectorOption.pharma:
|
||||
return 'Pharma';
|
||||
case SectorOption.retail:
|
||||
|
@ -342,8 +372,20 @@ enum SectorOption {
|
|||
return 'SaaS';
|
||||
case SectorOption.sports:
|
||||
return 'Sports and Fitness';
|
||||
case SectorOption.software:
|
||||
return 'Software';
|
||||
case SectorOption.telecommunication:
|
||||
return 'Telecommunications';
|
||||
case SectorOption.transport:
|
||||
return 'Transport and Logistics';
|
||||
case SectorOption.travel:
|
||||
return 'Travel';
|
||||
case SectorOption.vr:
|
||||
return 'Virtual Reality';
|
||||
case SectorOption.web:
|
||||
return 'Web';
|
||||
case SectorOption.other:
|
||||
return 'Other';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ class UserProfile {
|
|||
CommunicationPreference communication;
|
||||
List<SkillOption> skills;
|
||||
List<SkillOption> skillsSought;
|
||||
List<SectorOption> sectors;
|
||||
List<VisionOption> visions;
|
||||
List<WorkValueOption> workValues;
|
||||
List<Language> languages;
|
||||
|
@ -41,6 +42,7 @@ class UserProfile {
|
|||
required this.communication,
|
||||
required this.skills,
|
||||
required this.skillsSought,
|
||||
required this.sectors,
|
||||
required this.visions,
|
||||
required this.workValues,
|
||||
required this.languages,
|
||||
|
|
|
@ -14,6 +14,7 @@ import '../models/user_profile.dart';
|
|||
import '../services/auth/auth_service.dart';
|
||||
import '../services/user_service.dart';
|
||||
import '../utils/helper.dart';
|
||||
import '../utils/list_utils.dart';
|
||||
import '../utils/math.dart';
|
||||
import 'chat_page.dart';
|
||||
|
||||
|
@ -326,7 +327,7 @@ class UserMatchingPageState extends State<UserMatchingPage> {
|
|||
return Container(
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
color: Colors.blue,
|
||||
),
|
||||
child: Stack(
|
||||
|
@ -356,6 +357,7 @@ class UserMatchingPageState extends State<UserMatchingPage> {
|
|||
String? profileImageUrl = userProfile.profilePictureUrl;
|
||||
|
||||
String pronoun = getPronoun(userProfile.gender);
|
||||
String possAdjective = getPossessiveAdjective(userProfile.gender);
|
||||
|
||||
String location =
|
||||
userProfile.locations[Constants.dbDocMainLocation]?.toString() ?? 'N/A';
|
||||
|
@ -445,10 +447,31 @@ class UserMatchingPageState extends State<UserMatchingPage> {
|
|||
'${userProfile.availability.commitmentText}.',
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Row(
|
||||
Row(
|
||||
children: [
|
||||
Text('Spoken languages '),
|
||||
Expanded(child: Divider()),
|
||||
Text(
|
||||
'$possAdjective Sectors of Interest ',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
const Expanded(child: Divider()),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(sortSectorsList(userProfile.sectors)
|
||||
.map((x) => x.displayName)
|
||||
.join(' \u25CF ')),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'Spoken languages ',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
const Expanded(child: Divider()),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
|
|
|
@ -7,10 +7,12 @@ import '../constants.dart';
|
|||
import '../enumerations.dart';
|
||||
import '../forms/corporate_culture_form.dart';
|
||||
import '../forms/risks_form.dart';
|
||||
import '../forms/sectors_form.dart';
|
||||
import '../forms/skills_form.dart';
|
||||
import '../models/user_profile.dart';
|
||||
import '../services/user_service.dart';
|
||||
import '../utils/helper.dart';
|
||||
import '../utils/list_utils.dart';
|
||||
import '../utils/math.dart';
|
||||
import 'edit_profile_page.dart';
|
||||
import 'user_data_page.dart';
|
||||
|
@ -132,6 +134,27 @@ class _UserProfilePageState extends State<UserProfilePage> {
|
|||
_editSkills(skillsSought: true);
|
||||
}
|
||||
|
||||
void editUserSectorsInfo() async {
|
||||
final updatedUserData = await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SectorsForm(
|
||||
isRegProcess: false,
|
||||
isEditMode: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if (updatedUserData != null) {
|
||||
setState(() {
|
||||
// above Type of updatedUserData is dynamic, so convert
|
||||
List<dynamic> dynamicList =
|
||||
updatedUserData[Constants.dbFieldUsersSectors];
|
||||
myData.sectors = dynamicList.map((e) => e as SectorOption).toList();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void editUserVisionInfo() async {
|
||||
final updatedUserData = await Navigator.push(
|
||||
context,
|
||||
|
@ -227,6 +250,11 @@ class _UserProfilePageState extends State<UserProfilePage> {
|
|||
if (isOwner)
|
||||
Divider(color: Theme.of(context).colorScheme.primary),
|
||||
if (isOwner) const SizedBox(height: 16),
|
||||
_buildSectors(context),
|
||||
const SizedBox(height: 16),
|
||||
if (isOwner)
|
||||
Divider(color: Theme.of(context).colorScheme.primary),
|
||||
if (isOwner) const SizedBox(height: 16),
|
||||
_buildVision(context),
|
||||
const SizedBox(height: 16),
|
||||
if (isOwner)
|
||||
|
@ -434,6 +462,47 @@ class _UserProfilePageState extends State<UserProfilePage> {
|
|||
);
|
||||
}
|
||||
|
||||
Widget _buildSectors(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Sectors of Interest',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
sortSectorsList(myData.sectors)
|
||||
.map((x) => x.displayName)
|
||||
.join('\n'),
|
||||
style: const TextStyle(fontSize: 16)),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (isOwner) _editButton(context, editUserSectorsInfo),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSkills(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
|
@ -511,7 +580,7 @@ class _UserProfilePageState extends State<UserProfilePage> {
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Locations',
|
||||
myData.locations.length > 1 ? 'Locations' : 'Location',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
|
|
|
@ -70,6 +70,17 @@ class UserService {
|
|||
return [];
|
||||
}
|
||||
|
||||
static List<SectorOption> convertSectorStringToEnum(List<dynamic>? sectors) {
|
||||
if (sectors != null && sectors.isNotEmpty) {
|
||||
List<SectorOption> userSectors = sectors
|
||||
.map((sector) =>
|
||||
SectorOption.values.firstWhere((x) => x.toString() == sector))
|
||||
.toList();
|
||||
return userSectors;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
static List<VisionOption> convertVisionStringToEnum(List<dynamic>? visions) {
|
||||
if (visions != null && visions.isNotEmpty) {
|
||||
List<VisionOption> userVisions = visions
|
||||
|
@ -126,6 +137,8 @@ class UserService {
|
|||
data[Constants.dbFieldUsersSkills]);
|
||||
List<SkillOption> skillsSought = UserService.convertSkillStringToEnum(
|
||||
data[Constants.dbFieldUsersSkillsSought]);
|
||||
List<SectorOption> sectors = UserService.convertSectorStringToEnum(
|
||||
data[Constants.dbFieldUsersSectors]);
|
||||
List<VisionOption> visions = UserService.convertVisionStringToEnum(
|
||||
data[Constants.dbFieldUsersVisions]);
|
||||
List<WorkValueOption> works = UserService.convertWorkValuesStringToEnum(
|
||||
|
@ -178,6 +191,7 @@ class UserService {
|
|||
lastName: data[Constants.dbFieldUsersLastName] ?? '',
|
||||
skills: skillsOffered,
|
||||
skillsSought: skillsSought,
|
||||
sectors: sectors,
|
||||
visions: visions,
|
||||
risk: risk,
|
||||
availability: availability,
|
||||
|
|
|
@ -75,6 +75,19 @@ String getPronoun(Gender? userGender) {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get possessive adjective for given [userGender].
|
||||
/// Returns [His] if male, [Her] if female, else [His/Her].
|
||||
String getPossessiveAdjective(Gender? userGender) {
|
||||
switch (userGender) {
|
||||
case Gender.male:
|
||||
return 'His';
|
||||
case Gender.female:
|
||||
return 'Her';
|
||||
default:
|
||||
return 'His/Her';
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the [displayName] of our own Enumerations.
|
||||
String getDisplayText(dynamic option) {
|
||||
// Check if the option is an enum and has a displayName property
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:collection/collection.dart';
|
||||
import '../enumerations.dart';
|
||||
import '../models/language.dart';
|
||||
|
||||
/// Compare two lists by their content ignoring their elements order.
|
||||
|
@ -6,7 +7,8 @@ bool equalContent(List<dynamic> list1, List<dynamic> list2) {
|
|||
return const DeepCollectionEquality.unordered().equals(list1, list2);
|
||||
}
|
||||
|
||||
/// Sort the given list of languages so that German appears first, English second, and all other languages follow in alphabetical order.
|
||||
/// Sort the given list of languages so that German appears first,
|
||||
/// English second, and all other languages follow in alphabetical order.
|
||||
List<Language> sortLanguageList(List<Language> langList) {
|
||||
List<Language> sortedLanguages = List.from(langList);
|
||||
sortedLanguages.sort((a, b) {
|
||||
|
@ -21,3 +23,16 @@ List<Language> sortLanguageList(List<Language> langList) {
|
|||
});
|
||||
return sortedLanguages;
|
||||
}
|
||||
|
||||
/// Sort the given list of sectors of interest, placing [SectorOption.other] at the end.
|
||||
List<SectorOption> sortSectorsList(List<SectorOption> sectorList) {
|
||||
List<SectorOption> sortedSectors = List.from(sectorList);
|
||||
sortedSectors.sort((a, b) {
|
||||
// other last
|
||||
if (a.name == 'other') return 1;
|
||||
if (b.name == 'other') return -1;
|
||||
// All others by name ascending
|
||||
return a.name.compareTo(b.name);
|
||||
});
|
||||
return sortedSectors;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue