added goal feature

This commit is contained in:
Mohamed Nouffer
2022-10-12 21:46:17 +05:30
parent 0470e1f27f
commit 8e30ee6ba7
29 changed files with 876 additions and 481 deletions

View File

@ -9,6 +9,7 @@ import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
import 'package:rogapp/utils/database_helper.dart';
import 'package:rogapp/utils/text_util.dart';
import 'package:rogapp/widgets/bottom_sheet_controller.dart';
import 'package:url_launcher/url_launcher.dart';
@ -127,27 +128,21 @@ class BottomSheetNew extends GetView<BottomSheetController> {
child: Container(
alignment: Alignment.center,
child: Obx(() =>
Text(indexController.currentDestinationFeature[0].name!, style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
)
indexController.currentUser.length > 0 ?
Text("${TextUtils.getDisplayText(indexController.currentDestinationFeature[0].cp.toString())} : ${TextUtils.getDisplayText(indexController.currentDestinationFeature[0].checkin_point.toString())} : ${indexController.currentDestinationFeature[0].name!}", style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
)
:
Text("${indexController.currentDestinationFeature[0].name!}", style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
)
),
),
),
// MaterialButton(
// onPressed: () {
// destinationController.makeNext(indexController.currentDestinationFeature[0]);
// },
// color: Colors.blue,
// textColor: Colors.white,
// child: Icon(
// Icons.arrow_forward_ios,
// size: 14,
// ),
// padding: EdgeInsets.all(16),
// shape: CircleBorder(),
// ),
],
),
),
@ -248,20 +243,6 @@ class BottomSheetNew extends GetView<BottomSheetController> {
),
),
),
// MaterialButton(
// onPressed: () {
// //print("----- next is ${indexController.currentFeature[0]} ------");
// indexController.makeNext(indexController.currentFeature[0]);
// },
// color: Colors.blue,
// textColor: Colors.white,
// child: Icon(
// Icons.arrow_forward_ios,
// size: 14,
// ),
// padding: EdgeInsets.all(16),
// shape: CircleBorder(),
// ),
],
),
),
@ -302,16 +283,6 @@ class BottomSheetNew extends GetView<BottomSheetController> {
],
),
),
// Expanded(
// child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Icon(Icons.thumb_up_alt_sharp, color: Colors.blue,),
// SizedBox(width: 10.0,),
// Text("Like"),
// ],
// ),
// ),
],
),
SizedBox(height: 8.0,),
@ -379,7 +350,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
],
),
),
Text('${indexController.currentFeature[0].properties!["cp"].toString()} - id: ${indexController.currentFeature[0].properties!["checkin_point"].toString()}'),
// Text('${TextUtils.getDisplayText(indexController.currentFeature[0].properties!["cp"].toString())} - id: ${TextUtils.getDisplayText(indexController.currentFeature[0].properties!["checkin_point"].toString())}'),
],
),
)
@ -391,6 +362,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
}
Future<Widget> wantToGo(BuildContext context)async {
bool _selected = false;
print('---target-- ${indexController.currentFeature[0].properties!["location_id"]}----');
for(Destination d in destinationController.destinations){
@ -413,15 +385,49 @@ class BottomSheetNew extends GetView<BottomSheetController> {
IconButton(
icon: Icon(Icons.pin_drop_sharp, size: 32, color: _selected == true ? Colors.amber : Colors.blue,),
onPressed: (){
if(_selected){return;}
if(_selected){
// show remove from destination
Get.defaultDialog(
title: "本当にこのポイントを通過順から外しますか?",
middleText: "場所は目的地リストから削除されます",
backgroundColor: Colors.blue.shade300,
titleStyle: TextStyle(color: Colors.white),
middleTextStyle: TextStyle(color: Colors.white),
textConfirm: "はい",
textCancel: "いいえ",
cancelTextColor: Colors.white,
confirmTextColor: Colors.blue,
buttonColor: Colors.white,
barrierDismissible: false,
radius: 10,
content: Column(
children: [
],
),
onConfirm: (){
int _id = indexController.currentFeature[0].properties!["location_id"];
Destination? d = destinationController.destinationById(_id);
print('--- des id is : ${d} -----');
if(d != null) {
//print('--- des id is : ${d.location_id} -----');
destinationController.deleteDestination(d);
Get.back();
Get.back();
Get.snackbar("追加した", "場所が削除されました");
}
}
);
return;
}
// show add to destination
Get.defaultDialog(
title: "この場所を登録してもよろしいですか",
middleText: "ロケーションがロガニング リストに追加されます",
backgroundColor: Colors.blue.shade300,
titleStyle: TextStyle(color: Colors.white),
middleTextStyle: TextStyle(color: Colors.white),
textConfirm: "確認",
textCancel: "キャンセル",
textConfirm: "はい",
textCancel: "いいえ",
cancelTextColor: Colors.white,
confirmTextColor: Colors.blue,
buttonColor: Colors.white,
@ -459,6 +465,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
);
destinationController.addDestinations(dest);
Get.back();
Get.back();
Get.snackbar("追加した", "場所が追加されました");
}
);
@ -581,13 +588,16 @@ class BottomSheetNew extends GetView<BottomSheetController> {
}
},
child: Text(text,
style: TextStyle(
color: Colors.blue,
),
overflow: TextOverflow.ellipsis,
maxLines: 5,
child: Container(
width: MediaQuery.of(context).size.width - 160,
child: Expanded(
child: Text(text,
style: TextStyle(
color: isurl ? Colors.blue : Colors.black,
),
),
),
),
),
],
);