feat: Add overridden banner for geofence check with justification and update localization strings

This commit is contained in:
Achintha Isuru
2026-03-13 20:47:59 -04:00
parent c92138a573
commit 6f57cae247
4 changed files with 37 additions and 5 deletions

View File

@@ -954,7 +954,9 @@
"override_title": "Justification Required",
"override_desc": "Your location could not be verified. Please explain why you are clocking in without location verification.",
"override_hint": "Enter your justification...",
"override_submit": "Clock In"
"override_submit": "Clock In",
"overridden_title": "Location Not Verified",
"overridden_desc": "You are clocking in without location verification. Your justification has been recorded."
}
},
"availability": {

View File

@@ -949,7 +949,9 @@
"override_title": "Justificación Requerida",
"override_desc": "No se pudo verificar su ubicación. Explique por qué registra entrada sin verificación de ubicación.",
"override_hint": "Ingrese su justificación...",
"override_submit": "Registrar Entrada"
"override_submit": "Registrar Entrada",
"overridden_title": "Ubicación No Verificada",
"overridden_desc": "Está registrando entrada sin verificación de ubicación. Su justificación ha sido registrada."
}
},
"availability": {

View File

@@ -7,6 +7,7 @@ import '../../bloc/geofence_state.dart';
import 'permission_denied_banner.dart';
import 'permission_denied_forever_banner.dart';
import 'service_disabled_banner.dart';
import 'overridden_banner.dart';
import 'timeout_banner.dart';
import 'too_far_banner.dart';
import 'verified_banner.dart';
@@ -35,10 +36,10 @@ class GeofenceStatusBanner extends StatelessWidget {
/// Determines which banner variant to display based on the current state.
Widget _buildBannerForState(GeofenceState state) {
// If the worker overrode the geofence check, show the verified banner
// instead of any failure state — the justification has been recorded.
// If the worker overrode the geofence check, show a warning banner
// indicating location was not verified but justification was recorded.
if (state.isGeofenceOverridden) {
return const VerifiedBanner();
return const OverriddenBanner();
}
// 1. Location services disabled.

View File

@@ -0,0 +1,27 @@
import 'package:core_localization/core_localization.dart';
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
/// Banner shown when the worker has overridden the geofence check with a
/// justification note. Displays a warning indicating location was not verified.
class OverriddenBanner extends StatelessWidget {
/// Creates an [OverriddenBanner].
const OverriddenBanner({super.key});
@override
Widget build(BuildContext context) {
final TranslationsStaffClockInGeofenceEn i18n = Translations.of(
context,
).staff.clock_in.geofence;
return UiNoticeBanner(
backgroundColor: UiColors.tagPending,
icon: UiIcons.warning,
iconColor: UiColors.textWarning,
title: i18n.overridden_title,
titleColor: UiColors.textWarning,
description: i18n.overridden_desc,
descriptionColor: UiColors.textWarning,
);
}
}