From 0ca322e2784f516a10522d07367b8aba83aefef4 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Tue, 27 Sep 2022 17:52:54 +0530 Subject: [PATCH] update for release1 --- lib/pages/drawer/drawer_page.dart | 2 +- lib/utils/const.dart | 4 +- lib/widgets/bottom_sheet_new.dart | 89 +++++++++++++++++++++---------- lib/widgets/map_widget.dart | 57 +++++++++++++------- 4 files changed, 101 insertions(+), 51 deletions(-) diff --git a/lib/pages/drawer/drawer_page.dart b/lib/pages/drawer/drawer_page.dart index f502f2c..bfa0876 100644 --- a/lib/pages/drawer/drawer_page.dart +++ b/lib/pages/drawer/drawer_page.dart @@ -95,7 +95,7 @@ class DrawerPage extends StatelessWidget { leading: const Icon(Icons.featured_video), title: Text("rog_web".tr), onTap: (){ - _launchURL("https://www.gifuai.net/?page_id=4425"); + _launchURL("https://www.gifuai.net/?page_id=17397"); }, ) : Container(width: 0, height: 0,), diff --git a/lib/utils/const.dart b/lib/utils/const.dart index 77df041..fa0903a 100644 --- a/lib/utils/const.dart +++ b/lib/utils/const.dart @@ -5,9 +5,9 @@ class ConstValues{ static const server_uri = "http://container.intranet.sumasen.net:8100"; static const dev_server = "http://localhost:8100"; static const dev_ip_server = "http://192.168.8.100:8100"; - static const dev_home_ip_server = "http://192.168.1.10:8100"; + static const dev_home_ip_server = "http://172.20.10.9:8100"; static String currentServer(){ - return server_uri; + return dev_home_ip_server; } } diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart index bae45b4..b55187c 100644 --- a/lib/widgets/bottom_sheet_new.dart +++ b/lib/widgets/bottom_sheet_new.dart @@ -21,18 +21,31 @@ class BottomSheetNew extends GetView { Image getImage(){ if(indexController.rog_mode == 1){ + //print("----- rogaining mode 1"); if(indexController.currentDestinationFeature.length <= 0 || indexController.currentDestinationFeature[0].photos! == ""){ return Image(image: AssetImage('assets/images/empty_image.png')); } else{ - //print("@@@@@@@@@@@@@ rog mode -------------------- ${indexController.currentDestinationFeature[0].photos} @@@@@@@@@@@"); - return Image(image: NetworkImage( - indexController.currentDestinationFeature[0].photos!, - ), - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { - return Image.asset("assets/images/empty_image.png"); - }, + //print("@@@@@@@@@@@@@ rog mode -------------------- ${indexController.currentDestinationFeature[0].photos} @@@@@@@@@@@"); + String _photo = indexController.currentDestinationFeature[0].photos!; + if(_photo.contains('http')){ + return Image(image: NetworkImage( + indexController.currentDestinationFeature[0].photos!, + ), + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + return Image.asset("assets/images/empty_image.png"); + }, ); + } + else { + return Image(image: NetworkImage( + 'http://container.intranet.sumasen.net:8100/media/' + indexController.currentDestinationFeature[0].photos!, + ), + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + return Image.asset("assets/images/empty_image.png"); + }, + ); + } } } else{ @@ -41,13 +54,25 @@ class BottomSheetNew extends GetView { return Image(image: AssetImage('assets/images/empty_image.png')); } else{ - return Image(image: NetworkImage( - gf.properties!["photos"], - ), - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { - return Image.asset("assets/images/empty_image.png"); - }, - ); + String _photo = gf!.properties!["photos"]; + if(_photo.contains('http')){ + return Image(image: NetworkImage( + gf.properties!["photos"], + ), + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + return Image.asset("assets/images/empty_image.png"); + }, + ); + } + else { + return Image(image: NetworkImage( + 'http://container.intranet.sumasen.net:8100/media/' + gf.properties!["photos"], + ), + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + return Image.asset("assets/images/empty_image.png"); + }, + ); + } } } @@ -275,16 +300,16 @@ class BottomSheetNew extends GetView { ], ), ), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Icon(Icons.thumb_up_alt_sharp, color: Colors.blue,), - SizedBox(width: 10.0,), - Text("Like"), - ], - ), - ), + // 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,), @@ -340,7 +365,7 @@ class BottomSheetNew extends GetView { ], ), ), - Text(indexController.currentFeature[0].properties!["cp"].toString()), + Text('id: ${indexController.currentFeature[0].properties!["location_id"].toString()}, cp : ${indexController.currentFeature[0].properties!["cp"].toString()}'), ], ), ) @@ -351,8 +376,16 @@ class BottomSheetNew extends GetView { ); } - Future wantToGo(BuildContext context)async { + bool _selected = false; + print('---target-- ${indexController.currentFeature[0].properties!["location_id"]}----'); + for(Destination d in destinationController.destinations){ + print('---- ${d.location_id.toString()} ----'); + if(d.location_id == indexController.currentFeature[0].properties!["location_id"]){ + _selected = true; + break; + } + } DatabaseHelper db = DatabaseHelper.instance; return @@ -364,9 +397,9 @@ class BottomSheetNew extends GetView { children: [ indexController.rog_mode == 0 ? IconButton( - icon: Icon(Icons.pin_drop_sharp, size: 32, color: Colors.blue,), + icon: Icon(Icons.pin_drop_sharp, size: 32, color: _selected == true ? Colors.amber : Colors.blue,), onPressed: (){ - + if(_selected){return;} Get.defaultDialog( title: "この場所を登録してもよろしいですか", middleText: "ロケーションがロガニング リストに追加されます", diff --git a/lib/widgets/map_widget.dart b/lib/widgets/map_widget.dart index 967cb1e..aa83fb2 100644 --- a/lib/widgets/map_widget.dart +++ b/lib/widgets/map_widget.dart @@ -20,6 +20,42 @@ class MapWidget extends StatelessWidget { StreamSubscription? subscription; + Widget getMarkerShape(GeoJsonFeature i){ + RegExp regex = RegExp(r'([.]*0)(?!.*\d)'); + return Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: 32, + width: 32, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.transparent, + border: Border.all( + color: i.properties!['buy_point'] > 0 ? Colors.blue : Colors.red, + width: 3, + style: BorderStyle.solid + ) + ), + child: Stack( + alignment: Alignment.center, + children: [ + Icon(Icons.circle,size: 6.0,), + i.properties!['cp'] == -1 ? + Transform.rotate( + alignment: Alignment.center, + origin: Offset.fromDirection(0, 6), + angle: 90 * pi / 180, + child: Icon(Icons.play_arrow_outlined, color: Colors.red, size: 40,)): + Container(color: Colors.transparent,), + ], + ) + ), + Container(color: Colors.white, child: Text(i.properties!['cp'] > 0 ? "${i.properties!['cp'].toString().replaceAll(regex, '')}{${i.properties!['checkin_point'].toString()}}" : "", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,))), + ], + ); + } + @override Widget build(BuildContext context) { @@ -142,26 +178,7 @@ class MapWidget extends StatelessWidget { // ) // : Icon(Icons.pin_drop), builder: (ctx){ - return Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - height: 32, - width: 32, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.transparent, - border: Border.all( - color: Colors.red, - width: 3, - style: BorderStyle.solid - ) - ), - child: Icon(Icons.circle,size: 6.0,) - ), - Container(color: Colors.white, child: Text(i.properties!['cp'] > 0 ? "${i.properties!['cp'].toString().replaceAll(regex, '')}{${i.properties!['checkin_point'].toString()}}" : "", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,))), - ], - ); + return getMarkerShape(i); }, ); }).toList(),