This commit is contained in:
Mohamed Nouffer
2022-06-14 14:37:59 +05:30
parent 3d9f20fd66
commit ba70fa0080
22 changed files with 640 additions and 115 deletions

View File

@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
import 'package:url_launcher/url_launcher.dart';
@ -207,7 +208,17 @@ class BottomSheetWidget extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
indexController.currentAction[0][0]["wanttogo"] == false ?
indexController.rog_mode == 0 ?
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: [
indexController.currentAction[0][0]["wanttogo"] == false ?
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
@ -277,21 +288,49 @@ class BottomSheetWidget extends StatelessWidget {
)
),
],
)
:
Container(width: 0, height: 0,),
indexController.rog_mode == 1 ?
indexController.currentAction[0][0]["checkin"] == false ?
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["checkin"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Text("checkin".tr)
) :
Column(
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: [
ElevatedButton(
child: Text("Image"), onPressed: (){
final ImagePicker _picker = ImagePicker();
_picker.pickImage(source: ImageSource.camera).then((value){
print("----- image---- ${value!.path}");
});
},
)
],
),
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["checkin"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Text("checkin".tr)
)
],
)
:
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
@ -309,7 +348,8 @@ class BottomSheetWidget extends StatelessWidget {
Icons.favorite, color: Colors.red)
,
)
):
Container(width: 0, height: 0,),
],
): Row(
mainAxisAlignment: MainAxisAlignment.center,

View File

@ -1,9 +1,11 @@
import 'dart:ffi';
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
import 'package:timeline_tile/timeline_tile.dart';
class DestinationWidget extends StatelessWidget {
@ -110,6 +112,25 @@ class DestinationWidget extends StatelessWidget {
minHeight: 80,
),
child: ListTile(
onTap: () async {
{
double lat = destinationController.destinations[index]["location"]["geometry"]["coordinates"][0][1] as double;
double lon = destinationController.destinations[index]["location"]["geometry"]["coordinates"][0][0] as double;
GeoJsonFeature? fs = await destinationController.getDEstinationForLatLong(lat, lon);
print("----fsf-----${fs}");
if(fs != null){
if(indexController.currentFeature.length > 0) {
indexController.currentFeature.clear();
}
indexController.currentFeature.add(fs);
indexController.getAction();
showModalBottomSheet(context: context, isScrollControlled: true,
builder:((context) => BottomSheetWidget())
);
}
};
},
onLongPress: (){
print("#### long press #### ${destinationController.destination_index_data.length}");

View File

@ -18,6 +18,14 @@ class PerfectureWidget extends StatefulWidget {
}
class _PerfectureWidgetState extends State<PerfectureWidget> {
bool isNumeric(String s) {
if (s == null) {
return false;
}
return double.tryParse(s) != null;
}
List<DropdownMenuItem<String>> getDropdownItems() {
@ -64,7 +72,22 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
dropDownItems.add(newDropdown);
}
}
if(widget.indexController.customAreas.isNotEmpty){
for (Map<String, dynamic> currency in widget.indexController.customAreas[0]) {
var newDropdown = DropdownMenuItem(
child: Text(currency["event_name"].toString()),
value: currency["event_name"].toString(),
);
dropDownItems.add(newDropdown);
}
}
return dropDownItems;
}
@ -94,7 +117,7 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
items: getDropdownItems()
),
// Custom events area
// Gifu areas
widget.indexController.areas.isNotEmpty ?
DropdownButton<String>(
value: widget.indexController.areaDropdownValue,
@ -107,10 +130,17 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
color: Colors.deepPurpleAccent,
),
onChanged: (String? newValue) {
if (isNumeric(newValue!)){
}
else{
widget.indexController.loadCustomLocation(newValue);
}
setState(() {
if(newValue != null){
widget.indexController.is_loading.value = true;
widget.indexController.populateForCustomArea(newValue, widget.mapController);
widget.indexController.areaDropdownValue = newValue;
widget.indexController.populateSubPerForArea(newValue, widget.mapController);
}
});
},