fix: Correct formatting and improve comments in various files for clarity
This commit is contained in:
@@ -59,7 +59,7 @@ class CoreBlocObserver extends BlocObserver {
|
||||
super.onChange(bloc, change);
|
||||
if (logStateChanges) {
|
||||
developer.log(
|
||||
'State: ${change.currentState.runtimeType} → ${change.nextState.runtimeType}',
|
||||
'State: ${change.currentState.runtimeType}’ ${change.nextState.runtimeType}',
|
||||
name: bloc.runtimeType.toString(),
|
||||
);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class CoreBlocObserver extends BlocObserver {
|
||||
super.onTransition(bloc, transition);
|
||||
if (logStateChanges) {
|
||||
developer.log(
|
||||
'Transition: ${transition.event.runtimeType} → ${transition.nextState.runtimeType}',
|
||||
'Transition: ${transition.event.runtimeType}’ ${transition.nextState.runtimeType}',
|
||||
name: bloc.runtimeType.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ class _NoShowReportPageState extends State<NoShowReportPage> {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
// ── Header ──────────────────────────────────────────
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 60,
|
||||
@@ -151,7 +150,6 @@ class _NoShowReportPageState extends State<NoShowReportPage> {
|
||||
),
|
||||
),
|
||||
|
||||
// ── Content ─────────────────────────────────────────
|
||||
Transform.translate(
|
||||
offset: const Offset(0, -16),
|
||||
child: Padding(
|
||||
@@ -241,7 +239,7 @@ class _NoShowReportPageState extends State<NoShowReportPage> {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Summary chip (top 3 stats) ───────────────────────────────────────────────
|
||||
// Summary chip (top 3 stats)
|
||||
class _SummaryChip extends StatelessWidget {
|
||||
|
||||
const _SummaryChip({
|
||||
@@ -305,7 +303,7 @@ class _SummaryChip extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Worker card with risk badge + latest incident ────────────────────────────
|
||||
// ” Worker card with risk badge + latest incident ””””””””””””””
|
||||
class _WorkerCard extends StatelessWidget {
|
||||
|
||||
const _WorkerCard({required this.worker});
|
||||
@@ -448,5 +446,5 @@ class _WorkerCard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Insight line ─────────────────────────────────────────────────────────────
|
||||
// Insight line
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ class _PerformanceReportPageState extends State<PerformanceReportPage> {
|
||||
if (state is PerformanceLoaded) {
|
||||
final PerformanceReport report = state.report;
|
||||
|
||||
// Compute overall score (0–100) from the 4 KPIs
|
||||
// Compute overall score (0 - 100) from the 4 KPIs
|
||||
final double overallScore = ((report.fillRate * 0.3) +
|
||||
(report.completionRate * 0.3) +
|
||||
(report.onTimeRate * 0.25) +
|
||||
// avg fill time: 3h target → invert to score
|
||||
// avg fill time: 3h target invert to score
|
||||
((report.avgFillTimeHours <= 3
|
||||
? 100
|
||||
: (3 / report.avgFillTimeHours) * 100) *
|
||||
@@ -107,7 +107,7 @@ class _PerformanceReportPageState extends State<PerformanceReportPage> {
|
||||
iconColor: const Color(0xFFF39C12),
|
||||
label: context.t.client_reports.performance_report.kpis.avg_fill_time,
|
||||
target: context.t.client_reports.performance_report.kpis.target_hours(hours: '3'),
|
||||
// invert: lower is better — show as % of target met
|
||||
// invert: lower is better show as % of target met
|
||||
value: report.avgFillTimeHours == 0
|
||||
? 100
|
||||
: (3 / report.avgFillTimeHours * 100).clamp(0, 100),
|
||||
@@ -122,7 +122,7 @@ class _PerformanceReportPageState extends State<PerformanceReportPage> {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
// ── Header ───────────────────────────────────────────
|
||||
// Header
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 60,
|
||||
@@ -225,14 +225,14 @@ class _PerformanceReportPageState extends State<PerformanceReportPage> {
|
||||
),
|
||||
),
|
||||
|
||||
// ── Content ──────────────────────────────────────────
|
||||
// ” Content ”””””””””””””””””””””
|
||||
Transform.translate(
|
||||
offset: const Offset(0, -16),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
// ── Overall Score Hero Card ───────────────────
|
||||
// Overall Score Hero Card
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -299,7 +299,7 @@ class _PerformanceReportPageState extends State<PerformanceReportPage> {
|
||||
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// ── KPI List ─────────────────────────────────
|
||||
// KPI List
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
@@ -349,7 +349,7 @@ class _PerformanceReportPageState extends State<PerformanceReportPage> {
|
||||
}
|
||||
}
|
||||
|
||||
// ── KPI data model ────────────────────────────────────────────────────────────
|
||||
// ” KPI data model ””””””””””””””””””””””””””””””
|
||||
class _KpiData {
|
||||
|
||||
const _KpiData({
|
||||
@@ -367,14 +367,14 @@ class _KpiData {
|
||||
final Color iconColor;
|
||||
final String label;
|
||||
final String target;
|
||||
final double value; // 0–100 for bar
|
||||
final double value; // 0-100 for bar
|
||||
final String displayValue;
|
||||
final Color barColor;
|
||||
final bool met;
|
||||
final bool close;
|
||||
}
|
||||
|
||||
// ── KPI row widget ────────────────────────────────────────────────────────────
|
||||
// ” KPI row widget ””””””””””””””””””””””””””””””
|
||||
class _KpiRow extends StatelessWidget {
|
||||
|
||||
const _KpiRow({required this.kpi});
|
||||
|
||||
@@ -180,7 +180,7 @@ class _ClockInPageState extends State<ClockInPage> {
|
||||
style: UiTypography.body2b,
|
||||
),
|
||||
Text(
|
||||
"${shift.clientName} • ${shift.location}",
|
||||
"${shift.clientName} ${shift.location}",
|
||||
style: UiTypography
|
||||
.body3r
|
||||
.textSecondary,
|
||||
|
||||
@@ -136,7 +136,7 @@ class PersonalInfoBloc extends Bloc<PersonalInfoEvent, PersonalInfoState>
|
||||
PersonalInfoAddressSelected event,
|
||||
Emitter<PersonalInfoState> emit,
|
||||
) {
|
||||
// Legacy address selected – no-op; use PersonalInfoLocationAdded instead.
|
||||
// Legacy address selected no-op; use PersonalInfoLocationAdded instead.
|
||||
}
|
||||
|
||||
/// Adds a location to the preferredLocations list (max 5, no duplicates).
|
||||
|
||||
@@ -109,7 +109,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
// ── Description
|
||||
// ” Description
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
UiConstants.space5,
|
||||
@@ -123,7 +123,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
|
||||
),
|
||||
),
|
||||
|
||||
// ── Search autocomplete field
|
||||
// ” Search autocomplete field
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: UiConstants.space5,
|
||||
@@ -137,7 +137,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
|
||||
),
|
||||
),
|
||||
|
||||
// ── "Max reached" banner
|
||||
// ” "Max reached" banner
|
||||
if (atMax)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
@@ -164,7 +164,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
|
||||
|
||||
const SizedBox(height: UiConstants.space5),
|
||||
|
||||
// ── Section label
|
||||
// ” Section label
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: UiConstants.space5,
|
||||
|
||||
Reference in New Issue
Block a user