59 lines
1.6 KiB
Dart
59 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hl_lieferservice/model/car.dart';
|
|
|
|
class CarSelectionCard extends StatelessWidget {
|
|
final Car car;
|
|
final bool isSelected;
|
|
final VoidCallback onTap;
|
|
|
|
const CarSelectionCard({
|
|
super.key,
|
|
required this.car,
|
|
required this.isSelected,
|
|
required this.onTap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final color = Theme.of(context).primaryColor;
|
|
|
|
return Card(
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
side: isSelected
|
|
? BorderSide(color: color, width: 2)
|
|
: BorderSide.none,
|
|
),
|
|
color: isSelected
|
|
? color.withValues(alpha: 0.08)
|
|
: null,
|
|
child: InkWell(
|
|
borderRadius: BorderRadius.circular(8),
|
|
onTap: onTap,
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
|
child: Row(
|
|
children: [
|
|
Icon(
|
|
Icons.local_shipping,
|
|
size: 32,
|
|
color: isSelected ? color : Colors.grey,
|
|
),
|
|
const SizedBox(width: 16),
|
|
Expanded(
|
|
child: Text(
|
|
car.plate,
|
|
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
|
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
|
|
),
|
|
),
|
|
),
|
|
if (isSelected)
|
|
Icon(Icons.check_circle, color: color),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |