diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart index 3300bb1..9478d11 100644 --- a/lib/widgets/bottom_sheet_new.dart +++ b/lib/widgets/bottom_sheet_new.dart @@ -238,49 +238,99 @@ class BottomSheetNew extends GetView { ), ], ), - Obx(() => - indexController.currentFeature[0].properties!["address"] != null && (indexController.currentFeature[0].properties!["address"] as String).isNotEmpty ? - getDetails(context, "address".tr, indexController.currentFeature[0].properties!["address"] ?? '') - : - Container(width: 0.0, height: 0,), - ), - Obx(() => - indexController.currentFeature[0].properties!["phone"] != null && (indexController.currentFeature[0].properties!["phone"] as String).isNotEmpty ? - getDetails(context, "telephone".tr, indexController.currentFeature[0].properties!["phone"] ?? '') - : - Container(width: 0.0, height: 0,), - ), - Obx(() => - indexController.currentFeature[0].properties!["email"] != null && (indexController.currentFeature[0].properties!["email"] as String).isNotEmpty ? - getDetails(context, "email".tr, indexController.currentFeature[0].properties!["email"] ?? '') - : - Container(width: 0.0, height: 0,), - ), - Obx(() => - indexController.currentFeature[0].properties!["webcontents"] != null && (indexController.currentFeature[0].properties!["webcontents"] as String).isNotEmpty ? - getDetails(context, "web".tr, indexController.currentFeature[0].properties!["webcontents"] ?? '', isurl: true) - : - Container(width: 0.0, height: 0,), - ), - Obx(() => - indexController.currentFeature[0].properties!["videos"] !=null && (indexController.currentFeature[0].properties!["videos"] as String).isNotEmpty ? - getDetails(context, "video".tr, indexController.currentFeature[0].properties!["videos"] ?? '', isurl: true) - : - Container(width: 0.0, height: 0,), - ), - SizedBox(height: 20.0,), - Obx(() => - //wantToGo(context), - - FutureBuilder( - future: wantToGo(context), - builder: (context, snapshot) { - return Container( - child: snapshot.data, - ); - }, - ), - + Obx(() => + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + FutureBuilder( + future: wantToGo(context), + builder: (context, snapshot) { + return Container( + child: snapshot.data, + ); + }, + ), + indexController.currentFeature[0].properties!["location_name"] != null && (indexController.currentFeature[0].properties!["address"] as String).isNotEmpty ? + Flexible(child: Text(indexController.currentFeature[0].properties!["location_name"])) + : + Container(width: 0.0, height: 0,), + ], + ), + ), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon(Icons.thumb_up_alt_sharp), + Text("Like"), + ], + ), + ), + ], + ), + SizedBox(height: 8.0,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Icon(Icons.roundabout_left), + SizedBox(width: 8.0,), + indexController.currentFeature[0].properties!["address"] != null && (indexController.currentFeature[0].properties!["address"] as String).isNotEmpty ? + getDetails(context, "address".tr, indexController.currentFeature[0].properties!["address"] ?? '') + : + Container(width: 0.0, height: 0,), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Icon(Icons.phone), + SizedBox(width: 8.0,), + indexController.currentFeature[0].properties!["phone"] != null && (indexController.currentFeature[0].properties!["phone"] as String).isNotEmpty ? + getDetails(context, "telephone".tr, indexController.currentFeature[0].properties!["phone"] ?? '') + : + Container(width: 0.0, height: 0,), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Icon(Icons.email), + SizedBox(width: 8.0,), + indexController.currentFeature[0].properties!["email"] != null && (indexController.currentFeature[0].properties!["email"] as String).isNotEmpty ? + getDetails(context, "email".tr, indexController.currentFeature[0].properties!["email"] ?? '') + : + Container(width: 0.0, height: 0,), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Icon(Icons.language), + SizedBox(width: 8.0,), + indexController.currentFeature[0].properties!["webcontents"] != null && (indexController.currentFeature[0].properties!["webcontents"] as String).isNotEmpty ? + getDetails(context, "web".tr, indexController.currentFeature[0].properties!["webcontents"] ?? '', isurl: true) + : + Container(width: 0.0, height: 0,), + ], + ), + ) + ], + ), + ) ), SizedBox(height: 60.0,) ], @@ -292,9 +342,7 @@ class BottomSheetNew extends GetView { Future 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: [ @@ -302,8 +350,9 @@ class BottomSheetNew extends GetView { mainAxisAlignment: MainAxisAlignment.center, children: [ indexController.rog_mode == 0 ? - ElevatedButton( - child: Text("want_to_go".tr), + IconButton( + icon: Icon(Icons.pin_drop_sharp, size: 32,), + onPressed: (){ GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint; LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude); @@ -331,7 +380,7 @@ class BottomSheetNew extends GetView { }, ): Container(), - SizedBox(width: 20.0,) , + SizedBox(width: 8.0,) , Obx((() => indexController.rog_mode == 1 ? @@ -426,121 +475,6 @@ class BottomSheetNew extends GetView { ); } - Widget getSingleAction(){ - return Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - TextButton( - onPressed: (){ - Get.toNamed(AppPages.LOGIN); - }, - child: Text("その他のオプションについてはログインしてください")) - ], - ) - ], - ); - } - - Widget getDoubleAction(BuildContext context){ - return Container( - color: Colors.black12, - child: Padding( - padding: const EdgeInsets.symmetric(vertical:8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Flexible( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - indexController.currentAction[0][0]["wanttogo"] == false ? - ElevatedButton( - onPressed: (){ - if(indexController.currentAction.isNotEmpty){ - print(indexController.currentAction[0]); - indexController.currentAction[0][0]["wanttogo"] = true; - Map temp = Map.from(indexController.currentAction[0][0]); - indexController.currentAction.clear(); - print("---temp---${temp}"); - indexController.currentAction.add([temp]); - } - indexController.makeAction(context); - }, - child: Text("want_to_go".tr) - ) : - ElevatedButton( - onPressed: (){ - if(indexController.currentAction.isNotEmpty){ - print(indexController.currentAction[0]); - indexController.currentAction[0][0]["wanttogo"] = false; - Map temp = Map.from(indexController.currentAction[0][0]); - indexController.currentAction.clear(); - print("---temp---${temp}"); - indexController.currentAction.add([temp]); - } - indexController.makeAction(context); - }, - - child: IconButton( - icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "want_to_go".tr,), onPressed: () { - - }, - - ) - ), - ], - ), - ), - Flexible( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - indexController.currentAction[0][0]["like"] == false ? - ElevatedButton( - onPressed: (){ - if(indexController.currentAction.isNotEmpty){ - print(indexController.currentAction[0]); - indexController.currentAction[0][0]["like"] = true; - Map temp = Map.from(indexController.currentAction[0][0]); - indexController.currentAction.clear(); - print("---temp---${temp}"); - indexController.currentAction.add([temp]); - } - indexController.makeAction(context); - }, - child: Text("like".tr) - ) : - ElevatedButton( - onPressed: (){ - if(indexController.currentAction.isNotEmpty){ - print(indexController.currentAction[0]); - indexController.currentAction[0][0]["like"] = false; - Map temp = Map.from(indexController.currentAction[0][0]); - indexController.currentAction.clear(); - print("---temp---${temp}"); - indexController.currentAction.add([temp]); - } - indexController.makeAction(context); - }, - - child: IconButton( - icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "like".tr,), onPressed: () { - - }, - - ) - ), - ], - ), - ) - ], - ), - ), - ); - } Widget getDetails(BuildContext context, String label, String text, {bool isurl=false}){