fix: Correct formatting and improve comments in various files for clarity
This commit is contained in:
@@ -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});
|
||||
|
||||
Reference in New Issue
Block a user