feat: add new skills to localization files and update experience repository methods

This commit is contained in:
Achintha Isuru
2026-01-27 15:07:43 -05:00
parent 93779c21bb
commit 47ecad5a63
9 changed files with 141 additions and 106 deletions

View File

@@ -79,7 +79,12 @@
"cleaning": "Cleaning",
"security": "Security",
"driving": "Driving",
"cooking": "Cooking"
"cooking": "Cooking",
"cashier": "Cashier",
"server": "Server",
"barista": "Barista",
"host_hostess": "Host/Hostess",
"busser": "Busser"
},
"industries": {
"hospitality": "Hospitality",
@@ -577,7 +582,8 @@
"server": "Server",
"barista": "Barista",
"host_hostess": "Host/Hostess",
"busser": "Busser"
"busser": "Busser",
"driving": "Driving"
}
}
}

View File

@@ -79,7 +79,12 @@
"cleaning": "Limpieza",
"security": "Seguridad",
"driving": "Conducción",
"cooking": "Cocina"
"cooking": "Cocina",
"cashier": "Cajero",
"server": "Mesero",
"barista": "Barista",
"host_hostess": "Anfitrión",
"busser": "Ayudante de mesero"
},
"industries": {
"hospitality": "Hostelería",
@@ -576,7 +581,8 @@
"server": "Server",
"barista": "Barista",
"host_hostess": "Host/Hostess",
"busser": "Busser"
"busser": "Busser",
"driving": "Driving"
}
}
}

View File

@@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 2
/// Strings: 1026 (513 per locale)
/// Strings: 1038 (519 per locale)
///
/// Built on 2026-01-27 at 16:42 UTC
/// Built on 2026-01-27 at 19:37 UTC
// coverage:ignore-file
// ignore_for_file: type=lint, unused_import

View File

@@ -2420,6 +2420,21 @@ class TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEn {
/// en: 'Cooking'
String get cooking => 'Cooking';
/// en: 'Cashier'
String get cashier => 'Cashier';
/// en: 'Server'
String get server => 'Server';
/// en: 'Barista'
String get barista => 'Barista';
/// en: 'Host/Hostess'
String get host_hostess => 'Host/Hostess';
/// en: 'Busser'
String get busser => 'Busser';
}
// Path: staff_authentication.profile_setup_page.experience.industries
@@ -2589,6 +2604,9 @@ class TranslationsStaffOnboardingExperienceSkillsEn {
/// en: 'Busser'
String get busser => 'Busser';
/// en: 'Driving'
String get driving => 'Driving';
}
// Path: staff.home.improve.items.training
@@ -2724,6 +2742,11 @@ extension on Translations {
'staff_authentication.profile_setup_page.experience.skills.security' => 'Security',
'staff_authentication.profile_setup_page.experience.skills.driving' => 'Driving',
'staff_authentication.profile_setup_page.experience.skills.cooking' => 'Cooking',
'staff_authentication.profile_setup_page.experience.skills.cashier' => 'Cashier',
'staff_authentication.profile_setup_page.experience.skills.server' => 'Server',
'staff_authentication.profile_setup_page.experience.skills.barista' => 'Barista',
'staff_authentication.profile_setup_page.experience.skills.host_hostess' => 'Host/Hostess',
'staff_authentication.profile_setup_page.experience.skills.busser' => 'Busser',
'staff_authentication.profile_setup_page.experience.industries.hospitality' => 'Hospitality',
'staff_authentication.profile_setup_page.experience.industries.food_service' => 'Food Service',
'staff_authentication.profile_setup_page.experience.industries.warehouse' => 'Warehouse',
@@ -3090,6 +3113,7 @@ extension on Translations {
'staff.onboarding.experience.skills.barista' => 'Barista',
'staff.onboarding.experience.skills.host_hostess' => 'Host/Hostess',
'staff.onboarding.experience.skills.busser' => 'Busser',
'staff.onboarding.experience.skills.driving' => 'Driving',
'staff_documents.title' => 'Documents',
'staff_documents.verification_card.title' => 'Document Verification',
'staff_documents.verification_card.progress' => ({required Object completed, required Object total}) => '${completed}/${total} Complete',
@@ -3171,14 +3195,14 @@ extension on Translations {
'staff_time_card.hours_worked' => 'Hours Worked',
'staff_time_card.total_earnings' => 'Total Earnings',
'staff_time_card.shift_history' => 'Shift History',
_ => null,
} ?? switch (path) {
'staff_time_card.no_shifts' => 'No shifts for this month',
'staff_time_card.hours' => 'hours',
'staff_time_card.per_hr' => '/hr',
'staff_time_card.status.approved' => 'Approved',
'staff_time_card.status.disputed' => 'Disputed',
'staff_time_card.status.paid' => 'Paid',
_ => null,
} ?? switch (path) {
'staff_time_card.status.pending' => 'Pending',
_ => null,
};

View File

@@ -1463,6 +1463,11 @@ class _TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEs impleme
@override String get security => 'Seguridad';
@override String get driving => 'Conducción';
@override String get cooking => 'Cocina';
@override String get cashier => 'Cajero';
@override String get server => 'Mesero';
@override String get barista => 'Barista';
@override String get host_hostess => 'Anfitrión';
@override String get busser => 'Ayudante de mesero';
}
// Path: staff_authentication.profile_setup_page.experience.industries
@@ -1564,6 +1569,7 @@ class _TranslationsStaffOnboardingExperienceSkillsEs implements TranslationsStaf
@override String get barista => 'Barista';
@override String get host_hostess => 'Host/Hostess';
@override String get busser => 'Busser';
@override String get driving => 'Driving';
}
// Path: staff.home.improve.items.training
@@ -1679,6 +1685,11 @@ extension on TranslationsEs {
'staff_authentication.profile_setup_page.experience.skills.security' => 'Seguridad',
'staff_authentication.profile_setup_page.experience.skills.driving' => 'Conducción',
'staff_authentication.profile_setup_page.experience.skills.cooking' => 'Cocina',
'staff_authentication.profile_setup_page.experience.skills.cashier' => 'Cajero',
'staff_authentication.profile_setup_page.experience.skills.server' => 'Mesero',
'staff_authentication.profile_setup_page.experience.skills.barista' => 'Barista',
'staff_authentication.profile_setup_page.experience.skills.host_hostess' => 'Anfitrión',
'staff_authentication.profile_setup_page.experience.skills.busser' => 'Ayudante de mesero',
'staff_authentication.profile_setup_page.experience.industries.hospitality' => 'Hostelería',
'staff_authentication.profile_setup_page.experience.industries.food_service' => 'Servicio de comida',
'staff_authentication.profile_setup_page.experience.industries.warehouse' => 'Almacén',
@@ -2045,6 +2056,7 @@ extension on TranslationsEs {
'staff.onboarding.experience.skills.barista' => 'Barista',
'staff.onboarding.experience.skills.host_hostess' => 'Host/Hostess',
'staff.onboarding.experience.skills.busser' => 'Busser',
'staff.onboarding.experience.skills.driving' => 'Driving',
'staff_documents.title' => 'Documents',
'staff_documents.verification_card.title' => 'Document Verification',
'staff_documents.verification_card.progress' => ({required Object completed, required Object total}) => '${completed}/${total} Complete',
@@ -2126,14 +2138,14 @@ extension on TranslationsEs {
'staff_time_card.hours_worked' => 'Horas trabajadas',
'staff_time_card.total_earnings' => 'Ganancias totales',
'staff_time_card.shift_history' => 'Historial de turnos',
_ => null,
} ?? switch (path) {
'staff_time_card.no_shifts' => 'No hay turnos para este mes',
'staff_time_card.hours' => 'horas',
'staff_time_card.per_hr' => '/hr',
'staff_time_card.status.approved' => 'Aprobado',
'staff_time_card.status.disputed' => 'Disputado',
'staff_time_card.status.paid' => 'Pagado',
_ => null,
} ?? switch (path) {
'staff_time_card.status.pending' => 'Pendiente',
_ => null,
};

View File

@@ -1 +1 @@
# include: package:flutter_lints/flutter.yaml
include: package:flutter_lints/flutter.yaml

View File

@@ -15,16 +15,16 @@ class ExperienceRepositoryImpl implements ExperienceRepositoryInterface {
}) : _dataConnect = dataConnect,
_firebaseAuth = firebaseAuth;
Future<dc.GetStaffByIdStaff> _getStaff() async {
Future<dc.GetStaffByUserIdStaffs> _getStaff() async {
final user = _firebaseAuth.currentUser;
if (user == null) {
throw Exception('User not authenticated');
}
final result = await _dataConnect.getStaffById(id: user.uid).execute();
if (result.data.staff == null) {
if (user == null) throw Exception('User not authenticated');
final result =
await _dataConnect.getStaffByUserId(userId: user.uid).execute();
if (result.data.staffs.isEmpty) {
throw Exception('Staff profile not found');
}
return result.data.staff!;
return result.data.staffs.first;
}
@override

View File

@@ -111,6 +111,8 @@ class ExperienceBloc extends Bloc<ExperienceEvent, ExperienceState> {
on<ExperienceSkillToggled>(_onSkillToggled);
on<ExperienceCustomSkillAdded>(_onCustomSkillAdded);
on<ExperienceSubmitted>(_onSubmitted);
add(ExperienceLoaded());
}
Future<void> _onLoaded(

View File

@@ -4,25 +4,13 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_domain/krow_domain.dart';
import '../blocs/experience_bloc.dart';
import '../widgets/experience_custom_input.dart';
import '../widgets/experience_section_title.dart';
class ExperiencePage extends StatelessWidget {
const ExperiencePage({super.key});
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (_) => Modular.get<ExperienceBloc>()..add(ExperienceLoaded()),
child: const _ExperienceView(),
);
}
}
class _ExperienceView extends StatelessWidget {
const _ExperienceView();
String _getIndustryLabel(dynamic node, Industry industry) {
switch (industry) {
case Industry.hospitality: return node.hospitality;
@@ -61,86 +49,83 @@ class _ExperienceView extends StatelessWidget {
final i18n = t.staff.onboarding.experience;
return Scaffold(
backgroundColor: UiColors.background,
appBar: UiAppBar(
title: i18n.title,
onLeadingPressed: () => Modular.to.pop(),
),
body: BlocConsumer<ExperienceBloc, ExperienceState>(
listener: (context, state) {
if (state.status == ExperienceStatus.success) {
Modular.to.pop();
}
},
builder: (context, state) {
return Column(
children: [
Expanded(
child: SingleChildScrollView(
padding: EdgeInsets.all(UiConstants.space5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ExperienceSectionTitle(title: i18n.industries_title),
Text(
i18n.industries_subtitle,
style: UiTypography.body2m.copyWith(color: UiColors.textSecondary),
),
SizedBox(height: UiConstants.space3),
Wrap(
spacing: UiConstants.space2,
runSpacing: UiConstants.space2,
children: state.availableIndustries
.map(
(i) => UiChip(
label: _getIndustryLabel(i18n.industries, i),
isSelected: state.selectedIndustries.contains(i),
onTap: () => BlocProvider.of<ExperienceBloc>(context)
.add(ExperienceIndustryToggled(i)),
variant: state.selectedIndustries.contains(i)
? UiChipVariant.primary
: UiChipVariant.secondary,
),
)
.toList(),
),
SizedBox(height: UiConstants.space6),
ExperienceSectionTitle(title: i18n.skills_title),
Text(
i18n.skills_subtitle,
style: UiTypography.body2m.copyWith(color: UiColors.textSecondary),
),
SizedBox(height: UiConstants.space3),
Wrap(
spacing: UiConstants.space2,
runSpacing: UiConstants.space2,
children: state.availableSkills
.map(
(s) => UiChip(
label: _getSkillLabel(i18n.skills, s),
isSelected: state.selectedSkills.contains(s.value),
onTap: () => BlocProvider.of<ExperienceBloc>(context)
.add(ExperienceSkillToggled(s.value)),
variant: state.selectedSkills.contains(s.value)
? UiChipVariant.primary
: UiChipVariant.secondary,
),
)
.toList(),
),
SizedBox(height: UiConstants.space4),
const ExperienceCustomInput(),
SizedBox(height: UiConstants.space4),
_buildCustomSkillsList(state, i18n),
SizedBox(height: UiConstants.space10),
],
),
body: BlocProvider<ExperienceBloc>(
create: (context) => Modular.get<ExperienceBloc>(),
child: BlocConsumer<ExperienceBloc, ExperienceState>(
listener: (context, state) {
if (state.status == ExperienceStatus.success) {
Modular.to.pop();
}
},
builder: (context, state) {
return Column(
children: [
Expanded(
child: SingleChildScrollView(
padding: EdgeInsets.all(UiConstants.space5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ExperienceSectionTitle(title: i18n.industries_title),
Text(
i18n.industries_subtitle,
style: UiTypography.body2m.copyWith(color: UiColors.textSecondary),
),
SizedBox(height: UiConstants.space3),
Wrap(
spacing: UiConstants.space2,
runSpacing: UiConstants.space2,
children: state.availableIndustries
.map(
(i) => UiChip(
label: _getIndustryLabel(i18n.industries, i),
isSelected: state.selectedIndustries.contains(i),
onTap: () => BlocProvider.of<ExperienceBloc>(context)
.add(ExperienceIndustryToggled(i)),
variant: state.selectedIndustries.contains(i)
? UiChipVariant.primary
: UiChipVariant.secondary,
),
)
.toList(),
),
SizedBox(height: UiConstants.space6),
ExperienceSectionTitle(title: i18n.skills_title),
Text(
i18n.skills_subtitle,
style: UiTypography.body2m.copyWith(color: UiColors.textSecondary),
),
SizedBox(height: UiConstants.space3),
Wrap(
spacing: UiConstants.space2,
runSpacing: UiConstants.space2,
children: state.availableSkills
.map(
(s) => UiChip(
label: _getSkillLabel(i18n.skills, s),
isSelected: state.selectedSkills.contains(s.value),
onTap: () => BlocProvider.of<ExperienceBloc>(context)
.add(ExperienceSkillToggled(s.value)),
variant: state.selectedSkills.contains(s.value)
? UiChipVariant.primary
: UiChipVariant.secondary,
),
)
.toList(),
),
],
),
),
),
),
_buildSaveButton(context, state, i18n),
],
);
},
_buildSaveButton(context, state, i18n),
],
);
},
),
),
);
}