feat: Add overridden banner for geofence check with justification and update localization strings
This commit is contained in:
@@ -954,7 +954,9 @@
|
|||||||
"override_title": "Justification Required",
|
"override_title": "Justification Required",
|
||||||
"override_desc": "Your location could not be verified. Please explain why you are clocking in without location verification.",
|
"override_desc": "Your location could not be verified. Please explain why you are clocking in without location verification.",
|
||||||
"override_hint": "Enter your justification...",
|
"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": {
|
"availability": {
|
||||||
|
|||||||
@@ -949,7 +949,9 @@
|
|||||||
"override_title": "Justificación Requerida",
|
"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_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_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": {
|
"availability": {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import '../../bloc/geofence_state.dart';
|
|||||||
import 'permission_denied_banner.dart';
|
import 'permission_denied_banner.dart';
|
||||||
import 'permission_denied_forever_banner.dart';
|
import 'permission_denied_forever_banner.dart';
|
||||||
import 'service_disabled_banner.dart';
|
import 'service_disabled_banner.dart';
|
||||||
|
import 'overridden_banner.dart';
|
||||||
import 'timeout_banner.dart';
|
import 'timeout_banner.dart';
|
||||||
import 'too_far_banner.dart';
|
import 'too_far_banner.dart';
|
||||||
import 'verified_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.
|
/// Determines which banner variant to display based on the current state.
|
||||||
Widget _buildBannerForState(GeofenceState state) {
|
Widget _buildBannerForState(GeofenceState state) {
|
||||||
// If the worker overrode the geofence check, show the verified banner
|
// If the worker overrode the geofence check, show a warning banner
|
||||||
// instead of any failure state — the justification has been recorded.
|
// indicating location was not verified but justification was recorded.
|
||||||
if (state.isGeofenceOverridden) {
|
if (state.isGeofenceOverridden) {
|
||||||
return const VerifiedBanner();
|
return const OverriddenBanner();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. Location services disabled.
|
// 1. Location services disabled.
|
||||||
|
|||||||
@@ -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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user