feat(garage): show real motorcycle photos on garage cards

This commit is contained in:
bponders12-cell 2026-09-01 12:10:42 -04:00
parent 4ed4a24813
commit aae1b5fca1
1 changed files with 13 additions and 18 deletions

View File

@ -6,6 +6,7 @@ import '../../database/database.dart';
import '../../models/motorcycle_models.dart';
import '../../core/theme/evolution_theme_config.dart';
import 'garage_providers.dart';
import 'widgets/motorcycle_photo.dart';
class GarageScreen extends ConsumerWidget {
const GarageScreen({super.key});
@ -39,15 +40,12 @@ class GarageScreen extends ConsumerWidget {
loading: () => const Center(child: CircularProgressIndicator()),
error: (err, stack) => Center(child: Text('Error loading garage: $err')),
data: (bikes) {
if (bikes.isEmpty) {
return _buildEmptyState(context);
}
if (bikes.isEmpty) return _buildEmptyState(context);
return ListView.builder(
padding: const EdgeInsets.all(16.0),
itemCount: bikes.length,
itemBuilder: (context, index) {
final bike = bikes[index];
return _buildMotorcycleCard(context, ref, bike, themeMode);
return _buildMotorcycleCard(context, ref, bikes[index], themeMode);
},
);
},
@ -112,7 +110,6 @@ class GarageScreen extends ConsumerWidget {
final displayName = bike.nickname != null && bike.nickname!.isNotEmpty
? '${bike.nickname} (${bike.year} ${bike.makeName} ${bike.modelName})'
: '${bike.year} ${bike.makeName} ${bike.modelName}';
final isEvolution = themeMode == DashboardThemeMode.evolution;
return Container(
@ -133,23 +130,21 @@ class GarageScreen extends ConsumerWidget {
borderRadius: BorderRadius.circular(isEvolution ? 14 : 12),
onTap: () => context.push('/garage/${bike.id}'),
child: Padding(
padding: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MotorcyclePhoto(
year: bike.year,
make: bike.makeName,
model: bike.modelName,
height: 190,
borderRadius: BorderRadius.circular(isEvolution ? 10 : 8),
),
const SizedBox(height: 14),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: isEvolution ? const Color(0xFF141414) : Colors.white10,
borderRadius: BorderRadius.circular(10),
border: isEvolution ? Border.all(color: const Color(0xFF222222)) : null,
),
child: const Icon(Icons.two_wheeler, size: 36, color: Color(0xFF00E5FF)),
),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -205,7 +200,7 @@ class GarageScreen extends ConsumerWidget {
),
],
),
const SizedBox(height: 16),
const SizedBox(height: 12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [