autoreplace service operation

This commit is contained in:
2026-05-01 09:51:42 +02:00
parent 87b4661d33
commit 9c8576ada5
26 changed files with 136 additions and 134 deletions

View File

@@ -70,7 +70,7 @@ class _LatestServicesCardContent extends StatelessWidget {
const SizedBox(width: 12),
Expanded(
child: TextButton(
onPressed: () => context.push('/services'),
onPressed: () => context.push('/operations'),
child: Text(
context.l10n.homeLatestServices,
style: TextStyle(
@@ -105,7 +105,7 @@ class _LatestServicesCardContent extends StatelessWidget {
);
}
if (state.services.isEmpty) {
if (state.operations.isEmpty) {
return Center(
child: Text(
"Nessun servizio recente.",
@@ -118,16 +118,16 @@ class _LatestServicesCardContent extends StatelessWidget {
}
return ListView.separated(
itemCount: state.services.length,
itemCount: state.operations.length,
separatorBuilder: (context, index) => Divider(
height: 1,
color: theme.dividerColor.withValues(alpha: 0.3),
),
itemBuilder: (context, index) {
final service = state.services[index];
final operation = state.operations[index];
return InkWell(
onTap: () =>
context.push('/service-form', extra: service),
context.push('/operation-form', extra: operation),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Row(
@@ -136,7 +136,7 @@ class _LatestServicesCardContent extends StatelessWidget {
Expanded(
flex: 5,
child: Text(
service.customerDisplayName ??
operation.customerDisplayName ??
'Cliente sconosciuto',
style: TextStyle(
fontWeight: FontWeight.w700,
@@ -147,7 +147,7 @@ class _LatestServicesCardContent extends StatelessWidget {
Expanded(
flex: 5,
child: Text(
service.number,
operation.number,
style: TextStyle(
fontWeight: FontWeight.w600,
color: context.primaryText,
@@ -157,7 +157,7 @@ class _LatestServicesCardContent extends StatelessWidget {
),
),
Text(
"${service.createdAt?.day}/${service.createdAt?.month}",
"${operation.createdAt?.day}/${operation.createdAt?.month}",
style: TextStyle(
color: context.secondaryText,
fontSize: 12,