refactor: update billing module routes to use ClientPaths.childRoute and refactor PendingInvoicesPage to use UiAppBar and ListView.builder.

This commit is contained in:
Achintha Isuru
2026-02-26 14:37:20 -05:00
parent 94e15ae05d
commit f9c2d822e6
6 changed files with 110 additions and 128 deletions

View File

@@ -86,7 +86,7 @@ class _ActionCard extends StatelessWidget {
decoration: BoxDecoration(
color: color,
borderRadius: UiConstants.radiusLg,
border: Border.all(color: borderColor),
border: Border.all(color: borderColor, width: 0.5),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,

View File

@@ -3,13 +3,13 @@ import 'package:flutter/material.dart';
/// A dashboard widget that displays today's coverage status.
class CoverageDashboard extends StatelessWidget {
/// Creates a [CoverageDashboard].
const CoverageDashboard({
super.key,
required this.shifts,
required this.applications,
});
/// The list of shifts for today.
final List<dynamic> shifts;
@@ -23,7 +23,8 @@ class CoverageDashboard extends StatelessWidget {
double todayCost = 0;
for (final dynamic s in shifts) {
final int needed = (s as Map<String, dynamic>)['workersNeeded'] as int? ?? 0;
final int needed =
(s as Map<String, dynamic>)['workersNeeded'] as int? ?? 0;
final int confirmed = s['filled'] as int? ?? 0;
final double rate = s['hourlyRate'] as double? ?? 0.0;
final double hours = s['hours'] as double? ?? 0.0;
@@ -39,7 +40,9 @@ class CoverageDashboard extends StatelessWidget {
final int unfilledPositions = totalNeeded - totalConfirmed;
final int checkedInCount = applications
.where((dynamic a) => (a as Map<String, dynamic>)['checkInTime'] != null)
.where(
(dynamic a) => (a as Map<String, dynamic>)['checkInTime'] != null,
)
.length;
final int lateWorkersCount = applications
.where((dynamic a) => (a as Map<String, dynamic>)['status'] == 'LATE')
@@ -58,7 +61,7 @@ class CoverageDashboard extends StatelessWidget {
decoration: BoxDecoration(
color: UiColors.white,
borderRadius: UiConstants.radiusLg,
border: Border.all(color: UiColors.border),
border: Border.all(color: UiColors.border, width: 0.5),
boxShadow: <BoxShadow>[
BoxShadow(
color: UiColors.black.withValues(alpha: 0.02),
@@ -145,7 +148,6 @@ class CoverageDashboard extends StatelessWidget {
}
class _StatusCard extends StatelessWidget {
const _StatusCard({
required this.label,
required this.value,

View File

@@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
/// A widget that displays the daily coverage metrics.
class CoverageWidget extends StatelessWidget {
/// Creates a [CoverageWidget].
const CoverageWidget({
super.key,
@@ -13,6 +12,7 @@ class CoverageWidget extends StatelessWidget {
this.coveragePercent = 0,
this.subtitle,
});
/// The total number of shifts needed.
final int totalNeeded;
@@ -65,8 +65,10 @@ class CoverageWidget extends StatelessWidget {
color: backgroundColor,
borderRadius: UiConstants.radiusLg,
),
child: Text(
t.client_home.dashboard.percent_covered(percent: coveragePercent),
child: Text(
t.client_home.dashboard.percent_covered(
percent: coveragePercent,
),
style: UiTypography.footnote2b.copyWith(color: textColor),
),
),
@@ -115,7 +117,6 @@ class CoverageWidget extends StatelessWidget {
}
class _MetricCard extends StatelessWidget {
const _MetricCard({
required this.icon,
required this.iconColor,
@@ -136,7 +137,7 @@ class _MetricCard extends StatelessWidget {
decoration: BoxDecoration(
color: UiColors.cardViewBackground,
borderRadius: UiConstants.radiusLg,
border: Border.all(color: UiColors.border),
border: Border.all(color: UiColors.border, width: 0.5),
boxShadow: <BoxShadow>[
BoxShadow(
color: UiColors.black.withValues(alpha: 0.02),