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