update for travelmode change bug fixes

This commit is contained in:
Mohamed Nouffer
2022-07-10 23:50:43 +05:30
parent ce105a6754
commit 264cd828f4
9 changed files with 121 additions and 62 deletions

View File

@ -132,9 +132,19 @@ class BottomSheetNew extends GetView<BottomSheetController> {
Container(width: 0.0, height: 0,),
),
SizedBox(height: 20.0,),
//Obx(() =>
wantToGo(context),
//),
Obx(() =>
//wantToGo(context),
FutureBuilder<Widget>(
future: wantToGo(context),
builder: (context, snapshot) {
return Container(
child: snapshot.data,
);
},
),
),
SizedBox(height: 60.0,)
],
)
@ -143,25 +153,27 @@ class BottomSheetNew extends GetView<BottomSheetController> {
}
Widget wantToGo(BuildContext context){
return Row(
Future<Widget> wantToGo(BuildContext context)async {
DatabaseHelper db = DatabaseHelper.instance;
bool isAdded = await db.isAlreadyAvailable(indexController.currentFeature[0].properties!["location_id"]);
return
isAdded == true ? Container(child: Text("すでに追加されています"),) :
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: (){
},
child: IconButton(
icon: Icon(Icons.favorite, color: Colors.white, semanticLabel: "want_to_go".tr,),
onPressed: ()
{
child: ElevatedButton(
child: Text("want_to_go".tr),
onPressed: (){
GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint;
LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
print("--- name---- ${indexController.currentFeature[0].properties!["location_name"]} -----");
Destination dest = Destination(
name: indexController.currentFeature[0].properties!["location_name"],
address: indexController.currentFeature[0].properties!["address"],
@ -181,7 +193,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
);
destinationController.addDestinations(dest);
},
)
),
),
],
)