fix compilations

This commit is contained in:
2026-02-19 13:41:58 +05:30
parent 3b7715a382
commit 9234c26dad
10 changed files with 36 additions and 473 deletions

View File

@@ -179,7 +179,7 @@ class ClientCreateOrderRepositoryImpl implements ClientCreateOrderRepositoryInte
.date(orderTimestamp)
.startDate(startTimestamp)
.endDate(endTimestamp)
.recurringDays(order.recurringDays)
.recurringDays(fdc.AnyValue(order.recurringDays))
.execute();
final String orderId = orderResult.data.order_insert.id;
@@ -299,7 +299,7 @@ class ClientCreateOrderRepositoryImpl implements ClientCreateOrderRepositoryInte
.status(dc.OrderStatus.POSTED)
.date(orderTimestamp)
.startDate(startTimestamp)
.permanentDays(order.permanentDays)
.permanentDays(fdc.AnyValue(order.permanentDays))
.execute();
final String orderId = orderResult.data.order_insert.id;

View File

@@ -332,8 +332,8 @@ class _DailyOpsReportPageState extends State<DailyOpsReportPage> {
// Shift List
if (report.shifts.isEmpty)
const Padding(
padding: EdgeInsets.symmetric(vertical: 40),
Padding(
padding: const EdgeInsets.symmetric(vertical: 40),
child: Center(
child: Text(context.t.client_reports.daily_ops_report.no_shifts_today),
),

View File

@@ -216,53 +216,7 @@ class _NoShowReportPageState extends State<NoShowReportPage> {
(worker) => _WorkerCard(worker: worker),
),
const SizedBox(height: 24),
// ── Reliability Insights box (matches prototype) ──
Container(
width: double.infinity,
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: const Color(0xFFFFF8E1),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: UiColors.textWarning.withOpacity(0.3),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'💡 ${context.t.client_reports.no_show_report.insights.title}',
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: UiColors.textPrimary,
),
),
const SizedBox(height: 12),
_InsightLine(
text:
'· ${context.t.client_reports.no_show_report.insights.insight_1.prefix}${context.t.client_reports.no_show_report.insights.insight_1.highlight(rate: report.noShowRate.toStringAsFixed(1))}${context.t.client_reports.no_show_report.insights.insight_1.suffix(comparison: report.noShowRate < 5 ? 'below' : 'above')}',
),
if (report.flaggedWorkers.any(
(w) => w.noShowCount > 1,
))
_InsightLine(
text:
'· ${context.t.client_reports.no_show_report.insights.insight_2.highlight(count: report.flaggedWorkers.where((w) => w.noShowCount > 1).length.toString())} ${context.t.client_reports.no_show_report.insights.insight_2.suffix}',
bold: true,
),
_InsightLine(
text:
'· ${context.t.client_reports.no_show_report.insights.insight_3.prefix}${context.t.client_reports.no_show_report.insights.insight_3.highlight}${context.t.client_reports.no_show_report.insights.insight_3.suffix}',
bold: true,
),
],
),
),
const SizedBox(height: 100),
const SizedBox(height: 40),
],
),
),
@@ -349,7 +303,7 @@ class _WorkerCard extends StatelessWidget {
const _WorkerCard({required this.worker});
String _riskLabel(int count) {
String _riskLabel(BuildContext context, int count) {
if (count >= 3) return context.t.client_reports.no_show_report.risks.high;
if (count == 2) return context.t.client_reports.no_show_report.risks.medium;
return context.t.client_reports.no_show_report.risks.low;
@@ -369,7 +323,7 @@ class _WorkerCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final riskLabel = _riskLabel(worker.noShowCount);
final riskLabel = _riskLabel(context, worker.noShowCount);
final riskColor = _riskColor(worker.noShowCount);
final riskBg = _riskBg(worker.noShowCount);
@@ -487,25 +441,3 @@ class _WorkerCard extends StatelessWidget {
}
// ── Insight line ─────────────────────────────────────────────────────────────
class _InsightLine extends StatelessWidget {
final String text;
final bool bold;
const _InsightLine({required this.text, this.bold = false});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(bottom: 6),
child: Text(
text,
style: TextStyle(
fontSize: 13,
color: UiColors.textPrimary,
fontWeight: bold ? FontWeight.w600 : FontWeight.normal,
height: 1.4,
),
),
);
}
}

View File

@@ -316,6 +316,7 @@ class _ReportsPageState extends State<ReportsPage>
color: UiColors.textPrimary,
),
),
/*
TextButton.icon(
onPressed: () {},
icon: const Icon(UiIcons.download, size: 16),
@@ -328,6 +329,7 @@ class _ReportsPageState extends State<ReportsPage>
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
),
*/
],
),
@@ -392,89 +394,7 @@ class _ReportsPageState extends State<ReportsPage>
const SizedBox(height: 24),
// AI Insights
Container(
width: double.infinity,
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: UiColors.tagInProgress.withOpacity(0.3),
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: UiColors.black.withOpacity(0.02),
blurRadius: 2,
offset: const Offset(0, 1),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'💡 ${context.t.client_reports.ai_insights.title}',
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: UiColors.textPrimary,
),
),
const SizedBox(height: 12),
_InsightRow(
children: [
TextSpan(
text: context.t.client_reports.ai_insights
.insight_1.prefix),
TextSpan(
text: context.t.client_reports.ai_insights
.insight_1.highlight,
style: const TextStyle(
fontWeight: FontWeight.bold),
),
TextSpan(
text: context.t.client_reports.ai_insights
.insight_1.suffix,
),
],
),
_InsightRow(
children: [
TextSpan(
text: context.t.client_reports.ai_insights
.insight_2.prefix),
TextSpan(
text: context.t.client_reports.ai_insights
.insight_2.highlight,
style: const TextStyle(
fontWeight: FontWeight.bold),
),
TextSpan(
text: context.t.client_reports.ai_insights
.insight_2.suffix,
),
],
),
_InsightRow(
children: [
TextSpan(
text: context.t.client_reports.ai_insights
.insight_3.prefix,
),
TextSpan(
text: context.t.client_reports.ai_insights
.insight_3.highlight,
style: const TextStyle(
fontWeight: FontWeight.bold),
),
TextSpan(
text: context.t.client_reports.ai_insights
.insight_3.suffix),
],
),
],
),
),
const SizedBox(height: 100),
const SizedBox(height: 40),
],
),
),
@@ -661,36 +581,3 @@ class _ReportCard extends StatelessWidget {
}
}
class _InsightRow extends StatelessWidget {
final List<InlineSpan> children;
const _InsightRow({required this.children});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'',
style: TextStyle(color: UiColors.textSecondary, fontSize: 14),
),
Expanded(
child: Text.rich(
TextSpan(
style: const TextStyle(
fontSize: 14,
color: UiColors.textSecondary,
height: 1.4,
),
children: children,
),
),
),
],
),
);
}
}