feat: localization, file restriction banners, test credentials, edit icon fix

- #553: Audit and verify localizations (en/es), replace hardcoded strings
- #549: Incomplete profile banner in Find Shifts (staff app)
- #550: File restriction banner on document upload page
- #551: File restriction banner on certificate upload page
- #552: File restriction banner on attire upload page
- #492: Hide edit icon for past/completed orders (client app)
- #524: Display worker benefits in staff app
- Add test credentials to seed: testclient@gmail.com, staff +1-555-555-1234
- Fix document upload validation (context arg in _validatePdfFile on submit)
- Add PR_LOCALIZATION.md

Made-with: Cursor
This commit is contained in:
2026-02-27 13:48:04 +05:30
parent 66ffce413a
commit 34afe09963
26 changed files with 865 additions and 132 deletions

View File

@@ -123,10 +123,12 @@ class HomeRepositoryImpl
return response.data.benefitsDatas.map((data) {
final plan = data.vendorBenefitPlan;
final total = plan.total?.toDouble() ?? 0.0;
final remaining = data.current.toDouble();
return Benefit(
title: plan.title,
entitlementHours: plan.total?.toDouble() ?? 0.0,
usedHours: data.current.toDouble(),
entitlementHours: total,
usedHours: (total - remaining).clamp(0.0, total),
);
}).toList();
});

View File

@@ -46,7 +46,7 @@ class BenefitsOverviewPage extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(UiConstants.space6),
child: Text(
t.staff.home.benefits.overview.subtitle,
t.staff.home.benefits.overview.empty_state,
style: UiTypography.body1r.textSecondary,
textAlign: TextAlign.center,
),
@@ -143,21 +143,17 @@ class BenefitsOverviewPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
benefit.title,
style: UiTypography.body1b.textPrimary,
),
const Icon(UiIcons.info, size: 18, color: Color(0xFFE2E8F0)),
],
Text(
benefit.title,
style: UiTypography.body1b.textPrimary,
),
const SizedBox(height: 4),
Text(
_getSubtitle(benefit.title),
style: UiTypography.footnote2r.textSecondary,
),
const SizedBox(height: UiConstants.space4),
_buildStatsRow(),
],
),
),
@@ -231,6 +227,56 @@ class BenefitsOverviewPage extends StatelessWidget {
);
}
Widget _buildStatsRow() {
final i18n = t.staff.home.benefits.overview;
return Row(
children: [
_buildStatChip(
i18n.entitlement,
'${benefit.entitlementHours.toInt()}',
),
const SizedBox(width: 8),
_buildStatChip(
i18n.used,
'${benefit.usedHours.toInt()}',
),
const SizedBox(width: 8),
_buildStatChip(
i18n.remaining,
'${benefit.remainingHours.toInt()}',
),
],
);
}
Widget _buildStatChip(String label, String value) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: const Color(0xFFF1F5F9),
borderRadius: BorderRadius.circular(6),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
label,
style: UiTypography.footnote2r.textTertiary.copyWith(
fontSize: 10,
),
),
Text(
'$value ${t.staff.home.benefits.overview.hours}',
style: UiTypography.footnote2b.textPrimary.copyWith(
fontSize: 12,
),
),
],
),
);
}
String _getSubtitle(String title) {
final i18n = t.staff.home.benefits.overview;
if (title.toLowerCase().contains('sick')) {