diff --git a/assets/images/Zoo.png b/assets/images/Zoo.png new file mode 100644 index 0000000..dc31e2d Binary files /dev/null and b/assets/images/Zoo.png differ diff --git a/assets/images/dora.png b/assets/images/dora.png new file mode 100644 index 0000000..33f2395 Binary files /dev/null and b/assets/images/dora.png differ diff --git a/assets/images/japanese_fun.jpeg b/assets/images/japanese_fun.jpeg new file mode 100644 index 0000000..fc0156e Binary files /dev/null and b/assets/images/japanese_fun.jpeg differ diff --git a/assets/images/⾷事処.png b/assets/images/⾷事処.png new file mode 100644 index 0000000..b9cb187 Binary files /dev/null and b/assets/images/⾷事処.png differ diff --git a/assets/images/⾷材店.png b/assets/images/⾷材店.png new file mode 100644 index 0000000..dbcba80 Binary files /dev/null and b/assets/images/⾷材店.png differ diff --git a/assets/images/おみやげ.png b/assets/images/おみやげ.png new file mode 100644 index 0000000..09c0a63 Binary files /dev/null and b/assets/images/おみやげ.png differ diff --git a/assets/images/コンビニ.png b/assets/images/コンビニ.png index 5cbc8ae..df70b0e 100644 Binary files a/assets/images/コンビニ.png and b/assets/images/コンビニ.png differ diff --git a/assets/images/サービスエリア.png b/assets/images/サービスエリア.png index eb21d9d..38575f6 100644 Binary files a/assets/images/サービスエリア.png and b/assets/images/サービスエリア.png differ diff --git a/assets/images/ショッピング.png b/assets/images/ショッピング.png new file mode 100644 index 0000000..baa272a Binary files /dev/null and b/assets/images/ショッピング.png differ diff --git a/assets/images/スイーツ.png b/assets/images/スイーツ.png index 8940a33..adc48cb 100644 Binary files a/assets/images/スイーツ.png and b/assets/images/スイーツ.png differ diff --git a/assets/images/スイーツ2.png b/assets/images/スイーツ2.png new file mode 100644 index 0000000..08dfb18 Binary files /dev/null and b/assets/images/スイーツ2.png differ diff --git a/assets/images/スキー.png b/assets/images/スキー.png new file mode 100644 index 0000000..52e2fee Binary files /dev/null and b/assets/images/スキー.png differ diff --git a/assets/images/タクシー.png b/assets/images/タクシー.png index a9253f6..ce54e9b 100644 Binary files a/assets/images/タクシー.png and b/assets/images/タクシー.png differ diff --git a/assets/images/テニス.png b/assets/images/テニス.png new file mode 100644 index 0000000..46ff410 Binary files /dev/null and b/assets/images/テニス.png differ diff --git a/assets/images/トイレ.png b/assets/images/トイレ.png index 1f0cf95..8c0d516 100644 Binary files a/assets/images/トイレ.png and b/assets/images/トイレ.png differ diff --git a/assets/images/バス.png b/assets/images/バス.png index 80eca30..99d914c 100644 Binary files a/assets/images/バス.png and b/assets/images/バス.png differ diff --git a/assets/images/パーキング.png b/assets/images/パーキング.png new file mode 100644 index 0000000..1d4cc5f Binary files /dev/null and b/assets/images/パーキング.png differ diff --git a/assets/images/ファストフード.png b/assets/images/ファストフード.png index f43fef2..539d1b4 100644 Binary files a/assets/images/ファストフード.png and b/assets/images/ファストフード.png differ diff --git a/assets/images/レンタカー.png b/assets/images/レンタカー.png index 3cf09f7..19d1bf6 100644 Binary files a/assets/images/レンタカー.png and b/assets/images/レンタカー.png differ diff --git a/assets/images/レンタサイクル.png b/assets/images/レンタサイクル.png index 8bb107e..e190196 100644 Binary files a/assets/images/レンタサイクル.png and b/assets/images/レンタサイクル.png differ diff --git a/assets/images/レース.png b/assets/images/レース.png index 38fa718..a59f62f 100644 Binary files a/assets/images/レース.png and b/assets/images/レース.png differ diff --git a/assets/images/仏閣.png b/assets/images/仏閣.png index fadc192..7d88078 100644 Binary files a/assets/images/仏閣.png and b/assets/images/仏閣.png differ diff --git a/assets/images/体験.png b/assets/images/体験.png index b665158..1c63dc0 100644 Binary files a/assets/images/体験.png and b/assets/images/体験.png differ diff --git a/assets/images/博物館.png b/assets/images/博物館.png index f753709..7c691ad 100644 Binary files a/assets/images/博物館.png and b/assets/images/博物館.png differ diff --git a/assets/images/史跡.png b/assets/images/史跡.png index 38c7bd2..505bb64 100644 Binary files a/assets/images/史跡.png and b/assets/images/史跡.png differ diff --git a/assets/images/名所.png b/assets/images/名所.png index c106f8c..cf2fd5f 100644 Binary files a/assets/images/名所.png and b/assets/images/名所.png differ diff --git a/assets/images/喫茶店.png b/assets/images/喫茶店.png index 82da8cc..b99b247 100644 Binary files a/assets/images/喫茶店.png and b/assets/images/喫茶店.png differ diff --git a/assets/images/学校.png b/assets/images/学校.png index 06db1b6..9308f50 100644 Binary files a/assets/images/学校.png and b/assets/images/学校.png differ diff --git a/assets/images/射撃.png b/assets/images/射撃.png index 06d4069..3b03947 100644 Binary files a/assets/images/射撃.png and b/assets/images/射撃.png differ diff --git a/assets/images/役所.png b/assets/images/役所.png new file mode 100644 index 0000000..6abf632 Binary files /dev/null and b/assets/images/役所.png differ diff --git a/assets/images/文化.png b/assets/images/文化.png index bdea2fe..4c1551f 100644 Binary files a/assets/images/文化.png and b/assets/images/文化.png differ diff --git a/assets/images/文化2.png b/assets/images/文化2.png new file mode 100644 index 0000000..db77fff Binary files /dev/null and b/assets/images/文化2.png differ diff --git a/assets/images/景勝地.png b/assets/images/景勝地.png index bc85189..4a7456e 100644 Binary files a/assets/images/景勝地.png and b/assets/images/景勝地.png differ diff --git a/assets/images/植物園.png b/assets/images/植物園.png index 7b8ea1b..1045b34 100644 Binary files a/assets/images/植物園.png and b/assets/images/植物園.png differ diff --git a/assets/images/水族館.png b/assets/images/水族館.png index 7219866..ca83471 100644 Binary files a/assets/images/水族館.png and b/assets/images/水族館.png differ diff --git a/assets/images/温泉.png b/assets/images/温泉.png index 9e7a25d..168740e 100644 Binary files a/assets/images/温泉.png and b/assets/images/温泉.png differ diff --git a/assets/images/用品.png b/assets/images/用品.png new file mode 100644 index 0000000..578ba35 Binary files /dev/null and b/assets/images/用品.png differ diff --git a/assets/images/発電所.png b/assets/images/発電所.png index db42a53..af1459f 100644 Binary files a/assets/images/発電所.png and b/assets/images/発電所.png differ diff --git a/assets/images/発電所2.png b/assets/images/発電所2.png new file mode 100644 index 0000000..e47a5ab Binary files /dev/null and b/assets/images/発電所2.png differ diff --git a/assets/images/神社.png b/assets/images/神社.png index 3f2416a..7db5046 100644 Binary files a/assets/images/神社.png and b/assets/images/神社.png differ diff --git a/assets/images/競馬場.png b/assets/images/競馬場.png new file mode 100644 index 0000000..3df67ba Binary files /dev/null and b/assets/images/競馬場.png differ diff --git a/assets/images/競馬場2.png b/assets/images/競馬場2.png new file mode 100644 index 0000000..9114c28 Binary files /dev/null and b/assets/images/競馬場2.png differ diff --git a/assets/images/競馬場3.png b/assets/images/競馬場3.png new file mode 100644 index 0000000..bf31a1d Binary files /dev/null and b/assets/images/競馬場3.png differ diff --git a/assets/images/美術館.png b/assets/images/美術館.png index 354ef58..49633f4 100644 Binary files a/assets/images/美術館.png and b/assets/images/美術館.png differ diff --git a/assets/images/観光案内所.png b/assets/images/観光案内所.png index a2ab234..5290def 100644 Binary files a/assets/images/観光案内所.png and b/assets/images/観光案内所.png differ diff --git a/assets/images/買い物.png b/assets/images/買い物.png new file mode 100644 index 0000000..7557c3e Binary files /dev/null and b/assets/images/買い物.png differ diff --git a/assets/images/遊園地.png b/assets/images/遊園地.png index 8c8fcac..e9686ef 100644 Binary files a/assets/images/遊園地.png and b/assets/images/遊園地.png differ diff --git a/assets/images/酒蔵.png b/assets/images/酒蔵.png index c1ac80e..3a4d223 100644 Binary files a/assets/images/酒蔵.png and b/assets/images/酒蔵.png differ diff --git a/assets/images/銀行.png b/assets/images/銀行.png index 8f0f12f..4d553cf 100644 Binary files a/assets/images/銀行.png and b/assets/images/銀行.png differ diff --git a/assets/images/駅.png b/assets/images/駅.png index 6deb46d..12356a2 100644 Binary files a/assets/images/駅.png and b/assets/images/駅.png differ diff --git a/lib/pages/destination/destination_controller.dart b/lib/pages/destination/destination_controller.dart index dd5c852..69fb798 100644 --- a/lib/pages/destination/destination_controller.dart +++ b/lib/pages/destination/destination_controller.dart @@ -21,6 +21,7 @@ class DestinationController extends GetxController { late LocationSettings locationSettings; + var destinationCount = 0.obs; List destinations = [].obs; List> destination_index_data = >[].obs; @@ -101,58 +102,57 @@ class DestinationController extends GetxController { @override void onInit() { + super.onInit(); PopulateDestinations(); print("------ in iniit"); - if (defaultTargetPlatform == TargetPlatform.android) { - locationSettings = AndroidSettings( - accuracy: LocationAccuracy.high, - distanceFilter: 30, - forceLocationManager: true, - intervalDuration: const Duration(seconds: 10), - //(Optional) Set foreground notification config to keep the app alive - //when going to the background - foregroundNotificationConfig: const ForegroundNotificationConfig( - notificationText: - "Example app will continue to receive your location even when you aren't using it", - notificationTitle: "Running in Background", - enableWakeLock: true, - ) - ); - } else if (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.macOS) { - locationSettings = AppleSettings( - accuracy: LocationAccuracy.high, - activityType: ActivityType.fitness, - distanceFilter: 1, - pauseLocationUpdatesAutomatically: false, - // Only set to true if our app will be started up in the background. - showBackgroundLocationIndicator: true - ); - } else { - locationSettings = LocationSettings( - accuracy: LocationAccuracy.high, - distanceFilter: 30, - ); - } + // if (defaultTargetPlatform == TargetPlatform.android) { + // locationSettings = AndroidSettings( + // accuracy: LocationAccuracy.high, + // distanceFilter: 30, + // forceLocationManager: true, + // intervalDuration: const Duration(seconds: 10), + // //(Optional) Set foreground notification config to keep the app alive + // //when going to the background + // foregroundNotificationConfig: const ForegroundNotificationConfig( + // notificationText: + // "Example app will continue to receive your location even when you aren't using it", + // notificationTitle: "Running in Background", + // enableWakeLock: true, + // ) + // ); + // } else if (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.macOS) { + // locationSettings = AppleSettings( + // accuracy: LocationAccuracy.high, + // activityType: ActivityType.fitness, + // distanceFilter: 1, + // pauseLocationUpdatesAutomatically: false, + // // Only set to true if our app will be started up in the background. + // showBackgroundLocationIndicator: true + // ); + // } else { + // locationSettings = LocationSettings( + // accuracy: LocationAccuracy.high, + // distanceFilter: 30, + // ); + // } - StreamSubscription positionStream = Geolocator.getPositionStream(locationSettings: locationSettings).listen( - (Position? position) { - if(isSelected[0]){ - String user_id = indexController.currentUser[0]["user"]["id"].toString(); - TrackingService.addTrack(user_id, position!.latitude, position.longitude).then((val){ - //checkForCheckin(position!.latitude, position.longitude); - }); + // StreamSubscription positionStream = Geolocator.getPositionStream(locationSettings: locationSettings).listen( + // (Position? position) { + // if(isSelected[0]){ + // String user_id = indexController.currentUser[0]["user"]["id"].toString(); + // TrackingService.addTrack(user_id, position!.latitude, position.longitude).then((val){ + // //checkForCheckin(position!.latitude, position.longitude); + // }); - } - print(position == null ? 'Unknown' : 'current position is ${position.latitude.toString()}, ${position.longitude.toString()}'); - }); + // } + // print(position == null ? 'Unknown' : 'current position is ${position.latitude.toString()}, ${position.longitude.toString()}'); + // }); - - super.onInit(); } void deleteDestination(int index){ @@ -165,18 +165,20 @@ class DestinationController extends GetxController { } void PopulateDestinations(){ + print("--------- populsting destinations -----------"); if(indexController.currentUser.isNotEmpty){ int user_id = indexController.currentUser[0]["user"]["id"]; print(user_id); DestinationService.getDestinations(user_id).then((value){ + destinations.clear(); + destinations = value; + destinationCount.value = 0; + destinationCount.value = destinations.length; MatrixService.getDestinations(value).then((mat){ print(mat); matrix = mat; - destinations.clear(); - destinations = value; - }); //var val = value[2]["location"]["id"]; diff --git a/lib/pages/destination/destination_page.dart b/lib/pages/destination/destination_page.dart index 86ddf88..ff4c2f7 100644 --- a/lib/pages/destination/destination_page.dart +++ b/lib/pages/destination/destination_page.dart @@ -49,6 +49,7 @@ class _DestinationPageState extends State { @override void initState() { destinationController.context = context; + destinationController.PopulateDestinations(); super.initState(); } diff --git a/lib/pages/index/index_controller.dart b/lib/pages/index/index_controller.dart index bcb8cd5..b563f84 100644 --- a/lib/pages/index/index_controller.dart +++ b/lib/pages/index/index_controller.dart @@ -164,7 +164,15 @@ void login(String email, String password, BuildContext context){ Get.toNamed(AppPages.INITIAL); }else{ is_loading.value = false; - Get.snackbar("Failed", "User login failed, please try again."); + Get.snackbar( + "Failed", + "User login failed, please try again.", + icon: Icon(Icons.error, size: 40.0, color: Colors.blue), + snackPosition: SnackPosition.TOP, + duration: Duration(milliseconds: 800), + backgroundColor: Colors.yellow, + //icon:Image(image:AssetImage("assets/images/dora.png")) + ); } }); @@ -181,7 +189,15 @@ void login(String email, String password, BuildContext context){ Get.toNamed(AppPages.INITIAL); }else{ is_loading.value = false; - Get.snackbar("Failed", "User registration failed, please try again."); + Get.snackbar( + "Failed", + "User registration failed, please try again.", + icon: Icon(Icons.error, size: 40.0, color: Colors.blue), + snackPosition: SnackPosition.TOP, + duration: Duration(milliseconds: 800), + backgroundColor: Colors.yellow, + //icon:Image(image:AssetImage("assets/images/dora.png")) + ); } }); } @@ -331,6 +347,8 @@ void login(String email, String password, BuildContext context){ void loadLocationsBound(){ String cat = currentCat.isNotEmpty ? currentCat[0] : ""; LatLngBounds bounds = mapController!.bounds!; + currentBound.clear(); + currentBound.add(bounds); //print(currentCat); if(bounds.southEast != null && bounds.southWest != null && bounds.northEast != null && bounds.southEast != null ){ LocationService.loadLocationsBound(bounds.southWest!.latitude, bounds.southWest!.longitude, bounds.northWest.latitude, bounds.northWest.longitude, bounds.northEast!.latitude, bounds.northEast!.longitude, bounds.southEast.latitude, bounds.southEast.longitude, cat).then((value){ @@ -338,20 +356,21 @@ void login(String email, String password, BuildContext context){ if(value == null){ return; } + locations.clear(); if(value != null && value.collection.isEmpty){ Get.snackbar( "Too many Points", "please zoom in", - icon: Icon(Icons.person, color: Colors.white), - snackPosition: SnackPosition.BOTTOM, + icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue), + snackPosition: SnackPosition.TOP, duration: Duration(milliseconds: 800), backgroundColor: Colors.yellow, + //icon:Image(image:AssetImage("assets/images/dora.png")) ); //Get.showSnackbar(GetSnackBar(message: "Too many points, please zoom in",)); } if(value != null && value.collection.isNotEmpty){ //print("---- added---"); - locations.clear(); locations.add(value); loadCatsv2(); } diff --git a/lib/pages/login/login_page.dart b/lib/pages/login/login_page.dart index 039b281..4fab71d 100644 --- a/lib/pages/login/login_page.dart +++ b/lib/pages/login/login_page.dart @@ -89,7 +89,15 @@ class LoginPage extends StatelessWidget { height:60, onPressed: (){ if(emailController.text.isEmpty || passwordController.text.isEmpty){ - Get.snackbar("No values", "Email and password required"); + Get.snackbar( + "No values", + "Email and password required", + icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue), + snackPosition: SnackPosition.TOP, + duration: Duration(milliseconds: 800), + backgroundColor: Colors.yellow, + //icon:Image(image:AssetImage("assets/images/dora.png")) + ); return; } indexController.is_loading.value = true; diff --git a/lib/pages/register/register_page.dart b/lib/pages/register/register_page.dart index ba64e17..32693b8 100644 --- a/lib/pages/register/register_page.dart +++ b/lib/pages/register/register_page.dart @@ -82,10 +82,26 @@ class RegisterPage extends StatelessWidget { height:60, onPressed: (){ if(passwordController.text != confirmPasswordController.text){ - Get.snackbar("No match", "Passwords does not match"); + Get.snackbar( + "No match", + "Passwords does not match", + icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue), + snackPosition: SnackPosition.TOP, + duration: Duration(milliseconds: 800), + backgroundColor: Colors.yellow, + //icon:Image(image:AssetImage("assets/images/dora.png")) + ); } if(emailController.text.isEmpty || passwordController.text.isEmpty){ - Get.snackbar("No values", "Email and password required"); + Get.snackbar( + "No values", + "Email and password required", + icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue), + snackPosition: SnackPosition.TOP, + duration: Duration(milliseconds: 800), + backgroundColor: Colors.yellow, + //icon:Image(image:AssetImage("assets/images/dora.png")) + ); return; } indexController.is_loading.value = true; diff --git a/lib/services/action_service.dart b/lib/services/action_service.dart index bfe5980..f6ccfaa 100644 --- a/lib/services/action_service.dart +++ b/lib/services/action_service.dart @@ -11,6 +11,7 @@ class ActionService{ String server_url = ConstValues.currentServer(); String url = "${server_url}/api/makeaction/?user_id=${user_id}&location_id=${location_id}&wanttogo=${wanttogo}&like=${like}&checkin=${checkin}"; //String url = "http://localhost:8100/api/makeaction/?user_id=${user_id}&location_id=${location_id}&wanttogo=${wanttogo}&like=${like}&checkin=${checkin}"; + print("url is ------ ${url}"); final http.Response response = await http.get( Uri.parse(url), headers: { @@ -29,6 +30,7 @@ class ActionService{ List cats = []; String server_url = ConstValues.currentServer(); String url = '${server_url}/api/useraction/?user_id=${user_id}&location_id=${location_id}'; + print("url is ------ ${url}"); //String url = 'http://localhost:8100/api/useraction/?user_id=${user_id}&location_id=${location_id}'; final response = await http.get(Uri.parse(url), headers: { diff --git a/lib/utils/const.dart b/lib/utils/const.dart index fb2bd57..5636713 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 server_uri; + return dev_ip_server; } } \ No newline at end of file diff --git a/lib/widgets/destination_widget.dart b/lib/widgets/destination_widget.dart index 71dfd4d..ae48731 100644 --- a/lib/widgets/destination_widget.dart +++ b/lib/widgets/destination_widget.dart @@ -58,7 +58,6 @@ class DestinationWidget extends StatelessWidget { //print(element["index"]); int action_id = destinationController.destinations[element["index"]]["id"] as int; destinationController.makeOrder(action_id, (element["index"] as int) - 1, "up"); - }); } @@ -67,7 +66,6 @@ class DestinationWidget extends StatelessWidget { //print(element["index"]); int action_id = destinationController.destinations[element["index"]]["id"] as int; destinationController.makeOrder(action_id, (element["index"] as int) + 1, "up"); - }); } @@ -90,7 +88,8 @@ class DestinationWidget extends StatelessWidget { Padding( padding: const EdgeInsets.only(top:45.0), child: ListView.builder( - itemCount: destinationController.destinations.length, + itemCount: destinationController.destinationCount.value, + //itemCount: destinationController.destinations.length, // onReorder: (int oldIndex, int newIndex){ // int action_id = destinationController.destinations[oldIndex]["id"] as int; // //print(action_id); @@ -165,13 +164,17 @@ class DestinationWidget extends StatelessWidget { ), ), ), - startChild: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Text(destinationController.matrix["rows"][0]["elements"][index]["distance"]["text"].toString()), - Text(destinationController.matrix["rows"][0]["elements"][index]["duration"]["text"].toString()) - ], - ), + startChild: + destinationController.matrix["rows"] != null ? + Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Text(destinationController.matrix["rows"][0]["elements"][index]["distance"]["text"].toString()), + Text(destinationController.matrix["rows"][0]["elements"][index]["duration"]["text"].toString()) + ], + ): + Container() + , ); } diff --git a/lib/widgets/map_widget.dart b/lib/widgets/map_widget.dart index 0c57023..1b13274 100644 --- a/lib/widgets/map_widget.dart +++ b/lib/widgets/map_widget.dart @@ -161,14 +161,15 @@ class MapWidget extends StatelessWidget { print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}"); return Marker( anchorPos: AnchorPos.align(AnchorAlign.center), - height: 70.0, - width: 70.0, + height: 22.0, + width: 22.0, point: LatLng(p.geoSerie!.geoPoints[0].latitude, p.geoSerie!.geoPoints[0].longitude), builder: (ctx) => Icon(Icons.pin_drop), // builder: (ctx) => i.properties!["category"] != null ? // ImageIcon( // AssetImage("assets/images/${i.properties!["category"]}.png"), // color: Color(0xFF3A5A98), + // size:12.0, // ) // : Icon(Icons.pin_drop), diff --git a/pubspec.lock b/pubspec.lock index 7278602..639bec0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -253,7 +253,7 @@ packages: name: get url: "https://pub.dartlang.org" source: hosted - version: "4.6.1" + version: "4.6.5" google_api_availability: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index b00d868..8d29b16 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 sqflite: ^2.0.1 - get: ^4.6.1 + get: ^4.6.5 flutter_map: any geolocator: ^8.0.1 permission_handler: ^8.3.0 @@ -94,6 +94,7 @@ flutter: - assets/images/ - assets/images/empty_image.png - assets/gradient_japanese_temple.jpg + - assets/images/japanese_fun.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see