|
|
@@ -84,12 +84,15 @@ class MapPage extends StatelessWidget {
|
|
|
mainAxisSpacing: 10,
|
|
|
childAspectRatio: 1.3),
|
|
|
itemBuilder: (context, i) {
|
|
|
- return Obx((){
|
|
|
+ return Obx(() {
|
|
|
final data = c.mapList[i];
|
|
|
final id = MapWatchService.instance?.id;
|
|
|
final s = id == MapId(data.mapId);
|
|
|
- return GalleryCardWidget(data: data, position: c.position.value, isSelected: s);
|
|
|
- }) ;
|
|
|
+ return GalleryCardWidget(
|
|
|
+ data: data,
|
|
|
+ position: c.position.value,
|
|
|
+ isSelected: s);
|
|
|
+ });
|
|
|
})))
|
|
|
],
|
|
|
),
|
|
|
@@ -104,37 +107,42 @@ class GalleryCardWidget extends StatelessWidget {
|
|
|
final bool isSelected;
|
|
|
final HomeController c = Get.find();
|
|
|
|
|
|
- GalleryCardWidget({
|
|
|
- super.key,
|
|
|
- required this.data,
|
|
|
- required this.position, required this.isSelected});
|
|
|
+ GalleryCardWidget(
|
|
|
+ {super.key,
|
|
|
+ required this.data,
|
|
|
+ required this.position,
|
|
|
+ required this.isSelected});
|
|
|
|
|
|
void onTap(int id) async {
|
|
|
await MapWatchService.setMapById(MapId(id));
|
|
|
- c.selectMapName.value = data.name;
|
|
|
+ c.selectMapName.value = data.name;
|
|
|
+ c.tabController.index = 2;
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
var distance = '--';
|
|
|
- if ( data.hasDistance()) {
|
|
|
+ if (data.hasDistance()) {
|
|
|
distance = Distance(m: data.distance).toString();
|
|
|
}
|
|
|
|
|
|
return GestureDetector(
|
|
|
- onTap: ()=>onTap(data.mapId),
|
|
|
+ onTap: () => onTap(data.mapId),
|
|
|
child: Card(
|
|
|
color: Colors.white,
|
|
|
- shadowColor: isSelected? Colors.red: null,
|
|
|
+ shadowColor: isSelected ? Colors.red : null,
|
|
|
surfaceTintColor: Colors.white,
|
|
|
shape: const RoundedRectangleBorder(
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5.44))),
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
- elevation: isSelected?8:4,
|
|
|
+ elevation: isSelected ? 8 : 4,
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- AspectRatio(aspectRatio: 1.1, child: AppNetImage(netImage: data.image, fit: BoxFit.fitHeight)),
|
|
|
+ AspectRatio(
|
|
|
+ aspectRatio: 1.1,
|
|
|
+ child:
|
|
|
+ AppNetImage(netImage: data.image, fit: BoxFit.fitHeight)),
|
|
|
Expanded(
|
|
|
child: Padding(
|
|
|
padding: const EdgeInsets.all(6),
|
|
|
@@ -175,7 +183,7 @@ class GalleryCardWidget extends StatelessWidget {
|
|
|
Text(' 1:${data.mapScaleNumber}'),
|
|
|
const Spacer(),
|
|
|
Image.asset(Assets.imagesIcLocation,
|
|
|
- height: 9.6),
|
|
|
+ height: 9.6),
|
|
|
Text(' $distance'),
|
|
|
],
|
|
|
))
|
|
|
@@ -192,8 +200,7 @@ class GalleryCardWidget extends StatelessWidget {
|
|
|
children: [
|
|
|
SizedBox(
|
|
|
height: double.infinity,
|
|
|
- child: AppNetImage(netImage: data.image, fit: BoxFit.fitHeight)
|
|
|
- ),
|
|
|
+ child: AppNetImage(netImage: data.image, fit: BoxFit.fitHeight)),
|
|
|
],
|
|
|
);
|
|
|
}
|