Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
map_details_card.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:go_router/go_router.dart';
3
4import '../../../../../../core/common/entities/collection_entity.dart';
5import '../../../../../../core/router/routes.dart';
6import '../../../../../../core/ui/theme/color_palette.dart';
7
8class MapDetailsCard extends StatelessWidget {
10 final int index;
11
13 super.key,
14 required this.collection,
15 required this.index,
16 });
17
18 @override
19 Widget build(BuildContext context) {
20 return Card(
21 elevation: 4,
22 shape: RoundedRectangleBorder(
23 borderRadius: BorderRadius.circular(16),
24 ),
25 child: InkWell(
26 borderRadius: BorderRadius.circular(16),
27 onTap: () {
28 context.push(
29 Routes.collectionDetailsScreen.route,
30 extra: collection,
31 );
32 },
33 child: Padding(
34 padding: const EdgeInsets.all(16.0),
36 crossAxisAlignment: CrossAxisAlignment.start,
37 mainAxisSize: MainAxisSize.min,
38 children: [
39 Row(
40 children: [
41 Container(
42 width: 40,
43 height: 40,
44 decoration: BoxDecoration(
46 shape: BoxShape.circle,
47 border: Border.all(color: Colors.white, width: 2),
48 boxShadow: [
49 BoxShadow(
50 color: Colors.black.withValues(alpha: 0.2),
51 blurRadius: 4,
52 offset: const Offset(0, 2),
53 ),
54 ],
55 ),
56 child: Center(
57 child: Text(
58 '$index',
59 style: const TextStyle(
60 color: Colors.white,
61 fontWeight: FontWeight.bold,
62 fontSize: 16,
63 ),
64 ),
65 ),
66 ),
67 const SizedBox(width: 12),
68 Expanded(
70 crossAxisAlignment: CrossAxisAlignment.start,
71 children: [
72 Text(
73 collection.restaurant ?? 'Collection $index',
74 style: const TextStyle(
75 fontWeight: FontWeight.bold,
76 fontSize: 16,
77 ),
78 maxLines: 1,
79 overflow: TextOverflow.ellipsis,
80 ),
81 if (collection.address != null)
82 Padding(
83 padding: const EdgeInsets.only(top: 4.0),
84 child: Text(
85 collection.address!,
86 style: TextStyle(
87 color: Colors.grey[600],
88 fontSize: 14,
89 ),
90 maxLines: 2,
91 overflow: TextOverflow.ellipsis,
92 ),
93 ),
94 ],
95 ),
96 ),
97 ],
98 ),
99 const SizedBox(height: 12),
100 Row(
101 mainAxisAlignment: MainAxisAlignment.spaceBetween,
102 children: [
103 ElevatedButton(
104 onPressed: () {
105 context.push(
106 Routes.collectionDetailsScreen.route,
107 extra: collection,
108 );
109 },
110 style: ElevatedButton.styleFrom(
111 backgroundColor: ColorPalette.lightGreen,
112 foregroundColor: Colors.white,
113 shape: RoundedRectangleBorder(
114 borderRadius: BorderRadius.circular(8),
115 ),
116 padding: const EdgeInsets.symmetric(horizontal: 16),
117 ),
118 child: const Text('View Details'),
119 ),
120 ],
121 ),
122 ],
123 ),
124 ),
125 ),
126 );
127 }
128}
static const lightGreen
const MapDetailsCard({ super.key, required this.collection, required this.index, })
final VoidCallback onPressed
final VoidCallback onTap
final Widget child
override Widget build(BuildContext context)
final CollectionEntity collection
final EdgeInsets padding
class GetCollectionsParams extends Equatable CollectionEntity
Routes
Definition routes.dart:30
class SearchWeeklyCollectionsEvent extends WeeklyCollectionsEvent collection
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)