Remote sync of webdav
This commit is contained in:
parent
f01186df79
commit
483fbeafb6
44 changed files with 4842 additions and 975 deletions
|
|
@ -59,18 +59,20 @@ class _VehicleCard extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final hasNickname = vehicle.nickname?.trim().isNotEmpty ?? false;
|
||||
final gallonsLine = '${totalGallons.toStringAsFixed(3)} gallons logged';
|
||||
|
||||
return Card(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
leading: CircleAvatar(
|
||||
child: Text(vehicle.make.isNotEmpty ? vehicle.make[0].toUpperCase() : '?'),
|
||||
),
|
||||
title: Text('${vehicle.color} ${vehicle.make} ${vehicle.model}'),
|
||||
subtitle: Text(
|
||||
'Plate: ${vehicle.licensePlate}\n${totalGallons.toStringAsFixed(3)} gallons logged',
|
||||
),
|
||||
isThreeLine: true,
|
||||
leading: const CircleAvatar(child: Icon(Icons.directions_car_outlined)),
|
||||
title: Text(vehicle.displayLabel),
|
||||
// Only repeat the VIN here when the title is already showing the
|
||||
// nickname instead — otherwise the title (falling back to the VIN
|
||||
// when there's no nickname) would show it twice.
|
||||
subtitle: Text(hasNickname ? 'VIN: ${vehicle.vin}\n$gallonsLine' : gallonsLine),
|
||||
isThreeLine: hasNickname,
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => VehicleDetailScreen(vehicleId: vehicle.id)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue