diff --git a/android/app/build.gradle b/android/app/build.gradle index 5fc2e4d..39b8e94 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -48,6 +48,7 @@ android { targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + multiDexEnabled true } buildTypes { diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index d40e1b6..f407620 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -1,59 +1,61 @@ - - - - - io.flutter.embedded_views_preview - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Rogapp - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - rogapp - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - NSLocationWhenInUseUsageDescription - This app needs access to location when open. - NSLocationAlwaysUsageDescription - This app needs access to location when in the background. - NSPhotoLibraryUsageDescription - Photo Library Access Warning - NSCameraUsageDescription - Camera access to take photo - NSMicrophoneUsageDescription - Post videos to profile - - + + + + + io.flutter.embedded_views_preview + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Rogapp + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + rogapp + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + NSLocationWhenInUseUsageDescription + This app needs access to location when open. + NSLocationAlwaysUsageDescription + This app needs access to location when in the background. + NSPhotoLibraryUsageDescription + Photo Library Access Warning + NSCameraUsageDescription + Camera access to take photo + NSMicrophoneUsageDescription + Post videos to profile + CADisableMinimumFrameDurationOnPhone + + + diff --git a/lib/pages/destination/destination_controller.dart b/lib/pages/destination/destination_controller.dart index 967611a..dd5c852 100644 --- a/lib/pages/destination/destination_controller.dart +++ b/lib/pages/destination/destination_controller.dart @@ -103,6 +103,8 @@ class DestinationController extends GetxController { void onInit() { PopulateDestinations(); + print("------ in iniit"); + if (defaultTargetPlatform == TargetPlatform.android) { @@ -165,7 +167,7 @@ class DestinationController extends GetxController { void PopulateDestinations(){ if(indexController.currentUser.isNotEmpty){ int user_id = indexController.currentUser[0]["user"]["id"]; - //print(user_id); + print(user_id); DestinationService.getDestinations(user_id).then((value){ MatrixService.getDestinations(value).then((mat){ diff --git a/lib/pages/destination/destination_page.dart b/lib/pages/destination/destination_page.dart index 93c3d48..86ddf88 100644 --- a/lib/pages/destination/destination_page.dart +++ b/lib/pages/destination/destination_page.dart @@ -57,67 +57,73 @@ class _DestinationPageState extends State { final ColorScheme colorScheme = Theme.of(context).colorScheme; final Color oddItemColor = colorScheme.primary.withOpacity(0.05); final Color evenItemColor = colorScheme.primary.withOpacity(0.15); - return Scaffold( - bottomNavigationBar: BottomAppBar( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded(child: IconButton(icon: const Icon(Icons.camera_enhance), onPressed: (){},),), - const Expanded(child: Text('')), - Expanded(child: IconButton(icon: const Icon(Icons.travel_explore), onPressed: (){ - if(indexController.currentUser.isNotEmpty){ - Get.toNamed(AppPages.TRAVEL); - } - else{ - Get.toNamed(AppPages.LOGIN); - } - }),), + return WillPopScope( + onWillPop: () async { + indexController.switchPage(AppPages.INITIAL); + return false; + }, + child: Scaffold( + bottomNavigationBar: BottomAppBar( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: IconButton(icon: const Icon(Icons.camera_enhance), onPressed: (){},),), + const Expanded(child: Text('')), + Expanded(child: IconButton(icon: const Icon(Icons.travel_explore), onPressed: (){ + if(indexController.currentUser.isNotEmpty){ + Get.toNamed(AppPages.TRAVEL); + } + else{ + Get.toNamed(AppPages.LOGIN); + } + }),), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: (){ + //print("######"); + indexController.toggleDestinationMode(); + }, + tooltip: 'Increment', + child: const Icon(Icons.document_scanner), + elevation: 4.0, + ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + appBar:AppBar( + title: Text("Iternery"), + leading: IconButton( + icon: Icon(Icons.arrow_back_ios), + onPressed: (){ + indexController.switchPage(AppPages.INITIAL); + }, + ), + actions: [ + ToggleButtons( + disabledColor: Colors.grey.shade200, + selectedColor: Colors.red, + children: [ + Icon(Icons.explore + )], + onPressed: (int index) { + setState(() { + destinationController.isSelected[index] = !destinationController.isSelected[index]; + }); + }, + isSelected: destinationController.isSelected, + ), + IconButton(onPressed: (){ + showCurrentPosition(); + }, + icon: Icon(Icons.location_on_outlined)) ], ), + body: Obx(() => + indexController.desination_mode.value == 0 ? + DestinationWidget(): + DestinationMapPage() + ) ), - floatingActionButton: FloatingActionButton( - onPressed: (){ - //print("######"); - indexController.toggleDestinationMode(); - }, - tooltip: 'Increment', - child: const Icon(Icons.document_scanner), - elevation: 4.0, - ), - floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - appBar:AppBar( - title: Text("Iternery"), - leading: IconButton( - icon: Icon(Icons.arrow_back_ios), - onPressed: (){ - indexController.switchPage(AppPages.INITIAL); - }, - ), - actions: [ - ToggleButtons( - disabledColor: Colors.grey.shade200, - selectedColor: Colors.red, - children: [ - Icon(Icons.explore - )], - onPressed: (int index) { - setState(() { - destinationController.isSelected[index] = !destinationController.isSelected[index]; - }); - }, - isSelected: destinationController.isSelected, - ), - IconButton(onPressed: (){ - showCurrentPosition(); - }, - icon: Icon(Icons.location_on_outlined)) - ], - ), - body: Obx(() => - indexController.desination_mode.value == 0 ? - DestinationWidget(): - DestinationMapPage() - ) ); } diff --git a/lib/pages/destination_map/destination_map_page.dart b/lib/pages/destination_map/destination_map_page.dart index 9584672..83173d9 100644 --- a/lib/pages/destination_map/destination_map_page.dart +++ b/lib/pages/destination_map/destination_map_page.dart @@ -14,6 +14,7 @@ import 'package:rogapp/pages/destination/destination_controller.dart'; //import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:rogapp/pages/index/index_controller.dart'; import 'package:rogapp/services/destination_service.dart'; +import 'package:rogapp/widgets/bottom_sheet_new.dart'; import 'package:rogapp/widgets/bottom_sheet_widget.dart'; class DestinationMapPage extends StatefulWidget { @@ -69,30 +70,6 @@ class _DestinationMapPageState extends State { } - - - final List _markerPositions = [ - LatLng(35.728728732933455, 137.06878077038706), - LatLng(35.958218259568305, 137.06187578986646), - LatLng(35.76795686324816, 137.08949571194879), - ]; - - - - List get _markers => _markerPositions - .map( - (markerPosition) => Marker( - point: markerPosition, - width: 40, - height: 40, - builder: (_) => const Icon(Icons.location_on, size: 40), - anchorPos: AnchorPos.align(AnchorAlign.top), - ), - ) - .toList(); - - - List? getPoints(){ //print("##### --- route point ${indexController.routePoints.length}"); List pts = []; @@ -123,7 +100,8 @@ class _DestinationMapPageState extends State { indexController.getAction(); showModalBottomSheet(context: context, isScrollControlled: true, - builder:((context) => BottomSheetWidget()) + //builder:((context) => BottomSheetWidget()) + builder:((context) => BottomSheetNew()) ); } }, diff --git a/lib/pages/index/index_controller.dart b/lib/pages/index/index_controller.dart index 15d35bb..bcb8cd5 100644 --- a/lib/pages/index/index_controller.dart +++ b/lib/pages/index/index_controller.dart @@ -7,6 +7,9 @@ import 'package:flutter_polyline_points/flutter_polyline_points.dart'; import 'package:geojson/geojson.dart'; import 'package:get/get.dart'; import 'package:latlong2/latlong.dart'; +import 'package:rogapp/pages/destination/destination_binding.dart'; +import 'package:rogapp/pages/destination/destination_page.dart'; +import 'package:rogapp/pages/destination_map/destination_map_page.dart'; import 'package:rogapp/routes/app_pages.dart'; import 'package:rogapp/services/action_service.dart'; import 'package:rogapp/services/auth_service.dart'; @@ -77,6 +80,8 @@ class IndexController extends GetxController { case AppPages.TRAVEL : { rog_mode.value = 1; Get.toNamed(page); + //Get.off(DestinationPage(), binding: DestinationBinding()); + } break; case AppPages.LOGIN :{ @@ -334,7 +339,15 @@ void login(String email, String password, BuildContext context){ return; } if(value != null && value.collection.isEmpty){ - Get.showSnackbar(GetSnackBar(message: "Too many points, please zoom in",)); + Get.snackbar( + "Too many Points", + "please zoom in", + icon: Icon(Icons.person, color: Colors.white), + snackPosition: SnackPosition.BOTTOM, + duration: Duration(milliseconds: 800), + backgroundColor: Colors.yellow, + ); + //Get.showSnackbar(GetSnackBar(message: "Too many points, please zoom in",)); } if(value != null && value.collection.isNotEmpty){ //print("---- added---"); diff --git a/lib/services/destination_service.dart b/lib/services/destination_service.dart index 7fdfd95..9ecc2cd 100644 --- a/lib/services/destination_service.dart +++ b/lib/services/destination_service.dart @@ -1,5 +1,4 @@ import 'dart:convert'; -import 'dart:ffi'; import 'package:flutter_polyline_points/flutter_polyline_points.dart'; //import 'package:google_maps_webservice/directions.dart'; import 'package:http/http.dart' as http; diff --git a/lib/utils/const.dart b/lib/utils/const.dart index 5636713..fb2bd57 100644 --- a/lib/utils/const.dart +++ b/lib/utils/const.dart @@ -7,6 +7,6 @@ class ConstValues{ static const dev_ip_server = "http://192.168.8.100:8100"; static String currentServer(){ - return dev_ip_server; + return server_uri; } } \ No newline at end of file diff --git a/lib/utils/string_values.dart b/lib/utils/string_values.dart index f3c77aa..7d2edc0 100644 --- a/lib/utils/string_values.dart +++ b/lib/utils/string_values.dart @@ -28,7 +28,7 @@ class StringValues extends Translations{ 'app_title': '旅行工程表', 'address':'住所', 'email':'Eメール', - 'web':'Eメール', + 'web':'ウェブ', 'wikipedia':'ウィキペディア', 'video':'ビデオ', 'description':'説明', diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart new file mode 100644 index 0000000..1a18e10 --- /dev/null +++ b/lib/widgets/bottom_sheet_new.dart @@ -0,0 +1,371 @@ +import 'package:flutter/material.dart'; +import 'package:geojson/geojson.dart'; +import 'package:get/get.dart'; +import 'package:get/get_state_manager/get_state_manager.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:rogapp/widgets/bottom_sheet_controller.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class BottomSheetNew extends GetView { + BottomSheetNew({ Key? key }) : super(key: key); + + final IndexController indexController = Get.find(); + + Image getImage(GeoJsonFeature? gf){ + if(gf!.properties!["photos"] == null || gf.properties!["photos"] == ""){ + 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"); + }, + ); + } + } + + void _launchURL(url) async { + if (!await launch(url)) throw 'Could not launch $url'; + } + + @override + Widget build(BuildContext context) { + return Wrap( + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Row( + children: [ + MaterialButton( + onPressed: () { + indexController.makePrevious(indexController.currentFeature[0]); + }, + color: Colors.blue, + textColor: Colors.white, + child: Icon( + Icons.arrow_back_ios, + size: 14, + ), + padding: EdgeInsets.all(16), + shape: CircleBorder(), + ), + Expanded( + child: Container( + alignment: Alignment.center, + child: Obx(() => + Text(indexController.currentFeature[0].properties!["location_name"], style: TextStyle( + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + ), + ), + ), + MaterialButton( + onPressed: () { + 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(), + ), + ], + ), + ), + ), + Row( + children: [ + Expanded( + child: SizedBox( + height: 260.0, + child: Obx(() => getImage(indexController.currentFeature[0])), + ) + ), + ], + ), + Obx(() => + (indexController.currentFeature[0].properties!["address"] as String).isNotEmpty ? + getDetails("address".tr, indexController.currentFeature[0].properties!["address"] ?? '') + : + Container(width: 0.0, height: 0,), + ), + Obx(() => + (indexController.currentFeature[0].properties!["phone"] as String).isNotEmpty ? + getDetails("telephone".tr, indexController.currentFeature[0].properties!["phone"] ?? '') + : + Container(width: 0.0, height: 0,), + ), + Obx(() => + (indexController.currentFeature[0].properties!["email"] as String).isNotEmpty ? + getDetails("email".tr, indexController.currentFeature[0].properties!["email"] ?? '') + : + Container(width: 0.0, height: 0,), + ), + Obx(() => + (indexController.currentFeature[0].properties!["webcontents"] as String).isNotEmpty ? + getDetails("web".tr, indexController.currentFeature[0].properties!["webcontents"] ?? '', isurl: true) + : + Container(width: 0.0, height: 0,), + ), + Obx(() => + (indexController.currentFeature[0].properties!["videos"] as String).isNotEmpty ? + getDetails("video".tr, indexController.currentFeature[0].properties!["videos"] ?? '', isurl: true) + : + Container(width: 0.0, height: 0,), + ), + Obx(() => + indexController.rog_mode.value == 0 ? + indexController.currentAction.isNotEmpty ? + getDoubleAction(context) + : + getSingleAction() + : + getCheckin(context), + ), + SizedBox(height: 60.0,) + ], + ) + ], + ); + } + + Widget getCheckin(BuildContext context){ + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Flexible( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + indexController.currentAction[0][0]["checkin"] == false ? + 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 temp = Map.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){ + print(indexController.currentAction[0]); + indexController.currentAction[0][0]["checkin"] = false; + Map temp = Map.from(indexController.currentAction[0][0]); + indexController.currentAction.clear(); + print("---temp---${temp}"); + indexController.currentAction.add([temp]); + } + indexController.makeAction(context); + }, + + child: Icon( + Icons.favorite, color: Colors.red) + + , + ) + ], + ), + ) + ], + ); + } + + 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(String label, String text, {bool isurl=false}){ + return Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Flexible( + flex: 1, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text(label), + ], + ), + ), + SizedBox(width: 10.0,), + Flexible( + flex: 3, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: InkWell( + onTap: (){ + if(isurl){ + _launchURL(indexController.currentFeature[0].properties!["webcontents"]); + } + }, + child: Text(text, + style: TextStyle( + color: Colors.blue, + ), + softWrap: true, + overflow: TextOverflow.fade, + ), + ), + ), + ], + ), + ), + ], + ); + } + + + + +} \ No newline at end of file diff --git a/lib/widgets/bottom_sheet_widget.dart b/lib/widgets/bottom_sheet_widget.dart index 77d4f36..40c2698 100644 --- a/lib/widgets/bottom_sheet_widget.dart +++ b/lib/widgets/bottom_sheet_widget.dart @@ -18,7 +18,13 @@ class BottomSheetWidget extends StatelessWidget { return Image(image: AssetImage('assets/images/empty_image.png')); } else{ - return Image(image: NetworkImage(gf.properties!["photos"])); + return Image(image: NetworkImage( + gf.properties!["photos"], + ), + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + return Image.asset("assets/images/empty_image.png"); + }, + ); } } @@ -31,7 +37,7 @@ class BottomSheetWidget extends StatelessWidget { return SingleChildScrollView( child: Column( children: [ - SizedBox(height: 8.0,), + SizedBox(height: 5.0,), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -43,9 +49,9 @@ class BottomSheetWidget extends StatelessWidget { textColor: Colors.white, child: Icon( Icons.arrow_back_ios, - size: 10, + size: 14, ), - padding: EdgeInsets.all(16), + padding: EdgeInsets.all(14), shape: CircleBorder(), ), Expanded( @@ -68,9 +74,9 @@ class BottomSheetWidget extends StatelessWidget { textColor: Colors.white, child: Icon( Icons.arrow_forward_ios, - size: 10, + size: 14, ), - padding: EdgeInsets.all(16), + padding: EdgeInsets.all(14), shape: CircleBorder(), ), ], @@ -79,7 +85,7 @@ class BottomSheetWidget extends StatelessWidget { children: [ Expanded( child: SizedBox( - height: 360.0, + height: 260.0, child: Obx(() => getImage(indexController.currentFeature[0])), ) ), @@ -89,7 +95,7 @@ class BottomSheetWidget extends StatelessWidget { children: [ Expanded( child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 24.0), + padding: const EdgeInsets.symmetric(horizontal: 10.0), child: Column( children: [ indexController.currentFeature[0].properties!["address"] != null ? @@ -208,7 +214,7 @@ class BottomSheetWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - indexController.rog_mode == 0 ? + indexController.rog_mode.value == 0 ? @@ -218,7 +224,7 @@ class BottomSheetWidget extends StatelessWidget { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.end, children: [ - indexController.currentAction[0][0]["wanttogo"] == false ? + indexController.currentAction[0][0]["wanttogo"] == false ? ElevatedButton( onPressed: (){ if(indexController.currentAction.isNotEmpty){ @@ -297,7 +303,7 @@ class BottomSheetWidget extends StatelessWidget { : Container(width: 0, height: 0,), - indexController.rog_mode == 1 ? + indexController.rog_mode.value == 1 ? indexController.currentAction[0][0]["checkin"] == false ? Column( children: [ diff --git a/lib/widgets/destination_widget.dart b/lib/widgets/destination_widget.dart index 7b3ddd0..71dfd4d 100644 --- a/lib/widgets/destination_widget.dart +++ b/lib/widgets/destination_widget.dart @@ -5,6 +5,7 @@ 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_new.dart'; import 'package:rogapp/widgets/bottom_sheet_widget.dart'; import 'package:timeline_tile/timeline_tile.dart'; @@ -22,7 +23,12 @@ class DestinationWidget extends StatelessWidget { return Image(image: AssetImage('assets/images/empty_image.png')); } else{ - return Image(image: NetworkImage(destinationController.destinations[index]["location"]["properties"]["photos"])); + return Image(image: NetworkImage( + destinationController.destinations[index]["location"]["properties"]["photos"]), + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + return Image.asset("assets/images/empty_image.png"); + }, + ); } } @@ -126,7 +132,8 @@ class DestinationWidget extends StatelessWidget { indexController.getAction(); showModalBottomSheet(context: context, isScrollControlled: true, - builder:((context) => BottomSheetWidget()) + //builder:((context) => BottomSheetWidget()) + builder:((context) => BottomSheetNew()) ); } }; diff --git a/lib/widgets/list_widget.dart b/lib/widgets/list_widget.dart index d5b9d2d..c88ff17 100644 --- a/lib/widgets/list_widget.dart +++ b/lib/widgets/list_widget.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:geojson/geojson.dart'; import 'package:get/get.dart'; import 'package:rogapp/pages/index/index_controller.dart'; +import 'package:rogapp/widgets/bottom_sheet_new.dart'; import 'package:rogapp/widgets/bottom_sheet_widget.dart'; class ListWidget extends StatelessWidget { @@ -14,7 +15,12 @@ class ListWidget extends StatelessWidget { return Image(image: AssetImage('assets/images/empty_image.png')); } else{ - return Image(image: NetworkImage(indexController.locations[0].collection[index].properties!["photos"])); + return Image( + image: NetworkImage(indexController.locations[0].collection[index].properties!["photos"]), + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + return Image.asset("assets/images/empty_image.png"); + }, + ); } } @@ -41,7 +47,8 @@ class ListWidget extends StatelessWidget { showModalBottomSheet( isScrollControlled: true, context: context, - builder: (context) => BottomSheetWidget(), + //builder: (context) => BottomSheetWidget(), + builder:((context) => BottomSheetNew()) ); }, leading: getImage(index), diff --git a/lib/widgets/map_widget.dart b/lib/widgets/map_widget.dart index 6aa99be..0c57023 100644 --- a/lib/widgets/map_widget.dart +++ b/lib/widgets/map_widget.dart @@ -1,6 +1,4 @@ import 'dart:async'; -import 'dart:ffi'; - import 'package:flutter/material.dart'; import 'package:flutter_map/plugin_api.dart'; import 'package:flutter_map_location_marker/flutter_map_location_marker.dart'; @@ -11,6 +9,7 @@ import 'package:get/get_state_manager/get_state_manager.dart'; import 'package:latlong2/latlong.dart'; import 'package:rogapp/pages/index/index_controller.dart'; import 'package:rogapp/widgets/base_layer_widget.dart'; +import 'package:rogapp/widgets/bottom_sheet_new.dart'; import 'package:rogapp/widgets/bottom_sheet_widget.dart'; class MapWidget extends StatelessWidget { @@ -139,8 +138,12 @@ class MapWidget extends StatelessWidget { indexController.currentFeature.add(fs); indexController.getAction(); - showModalBottomSheet(context: context, isScrollControlled: true, - builder:((context) => BottomSheetWidget()) + showModalBottomSheet( + context: context, + isScrollControlled: true, + isDismissible: true, + builder:((context) => BottomSheetNew()) + //builder:((context) => BottomSheetWidget()) ); } diff --git a/pubspec.lock b/pubspec.lock index ade5f5b..7278602 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -49,7 +49,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cross_file: dependency: transitive description: @@ -84,7 +84,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: @@ -358,7 +358,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" latlong2: dependency: "direct main" description: @@ -393,7 +393,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" material_design_icons_flutter: dependency: "direct main" description: @@ -421,7 +421,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" path_provider: dependency: "direct main" description: @@ -559,7 +559,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" sqflite: dependency: "direct main" description: @@ -622,7 +622,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" timeline_tile: dependency: "direct main" description: @@ -720,7 +720,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" win32: dependency: transitive description: @@ -743,5 +743,5 @@ packages: source: hosted version: "0.2.0+1" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=2.10.0" diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index c9e02ad..f0bcafd 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -7,6 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST url_launcher_windows ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -15,3 +18,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin)