updated and fix checking, buy point

This commit is contained in:
Mohamed Nouffer
2023-09-14 22:53:51 +05:30
parent aa7b13b76a
commit b54c29eb4b
10 changed files with 247 additions and 95 deletions

View File

@ -17,11 +17,12 @@ import 'package:rogapp/widgets/bottom_sheet_controller.dart';
import 'package:url_launcher/url_launcher.dart';
class BottomSheetNew extends GetView<BottomSheetController> {
BottomSheetNew({Key? key}) : super(key: key);
BottomSheetNew({Key? key, required this.destination}) : super(key: key);
final IndexController indexController = Get.find<IndexController>();
final DestinationController destinationController =
Get.find<DestinationController>();
Destination destination;
Image getImage() {
String serverUrl = ConstValues.currentServer();
@ -108,7 +109,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
print('---- rog_mode ----- ${indexController.rog_mode} -----');
return indexController.rog_mode == 0
? detailsSheet(context)
: Container(width: 200, height: 250, color: Colors.purple,); //destinationSheet(context);
: destinationSheet(context);
}
// Show destination detais
@ -555,22 +556,18 @@ class BottomSheetNew extends GetView<BottomSheetController> {
backgroundColor:
Theme.of(context).colorScheme.secondary),
onPressed: () async {
final Destination dd =
destinationController.festuretoDestination(
indexController.currentFeature[0]);
print("----- name of dest ${dd.name} ----");
if (dd.cp == -1) {
if (destination.cp == -1) {
destinationController.is_in_rog.value = true;
destinationController.addToRogaining(
destinationController.current_lat,
destinationController.current_lon,
dd.location_id!);
destination.location_id!);
saveGameState();
ExternalService()
.StartRogaining()
.then((value) => Get.back());
} else {
destinationController.CallforCheckin(dd);
await destinationController.CallforCheckin(destination);
}
},
child: Text(

View File

@ -198,7 +198,7 @@ class DestinationWidget extends StatelessWidget {
context: context,
isScrollControlled: true,
//builder:((context) => BottomSheetWidget())
builder: ((context) => BottomSheetNew()));
builder: ((context) => BottomSheetNew(destination: fs,)));
}
},
onLongPress: () {

View File

@ -115,6 +115,7 @@ class _ListWidgetState extends State<ListWidget> {
onTap: () {
GeoJsonFeature gf =
indexController.locations[0].collection[index];
Destination des = destinationController.festuretoDestination(gf);
changeCurrentFeature(gf);
showModalBottomSheet(
constraints: BoxConstraints.loose(
@ -122,7 +123,7 @@ class _ListWidgetState extends State<ListWidget> {
isScrollControlled: true,
context: context,
//builder: (context) => BottomSheetWidget(),
builder: ((context) => BottomSheetNew()));
builder: ((context) => BottomSheetNew(destination: des,)));
},
leading: getImage(index),
title: indexController.locations[0].collection[index]

View File

@ -7,6 +7,7 @@ import 'package:flutter_polyline_points/flutter_polyline_points.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:latlong2/latlong.dart';
import 'package:rogapp/model/destination.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/utils/text_util.dart';
@ -41,13 +42,15 @@ class MapWidget extends StatelessWidget {
//print("----- fs is ${fs.properties!['photos']}");
indexController.getAction();
Destination des = destinationController.festuretoDestination(fs);
showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: context,
isScrollControlled: true,
isDismissible: true,
builder: ((context) => BottomSheetNew())
builder: ((context) => BottomSheetNew(destination: des,))
//builder:((context) => BottomSheetWidget())
).whenComplete(() {
destinationController.skip_gps = false;