diff --git a/ios/Podfile.lock b/ios/Podfile.lock index dad702c..4b322f3 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -16,6 +16,8 @@ PODS: - sqflite (0.0.2): - Flutter - FMDB (>= 2.7.5) + - url_launcher_ios (0.0.1): + - Flutter DEPENDENCIES: - Flutter (from `Flutter`) @@ -25,6 +27,7 @@ DEPENDENCIES: - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) SPEC REPOS: trunk: @@ -45,6 +48,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/permission_handler/ios" sqflite: :path: ".symlinks/plugins/sqflite/ios" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" SPEC CHECKSUMS: Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a @@ -55,6 +60,7 @@ SPEC CHECKSUMS: path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 + url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c diff --git a/lib/main.dart b/lib/main.dart index 9ace2d5..72bf70b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,7 +7,7 @@ import 'package:rogapp/utils/string_values.dart'; import 'package:rogapp/utils/util_controller.dart'; void main() { - WidgetsFlutterBinding.ensureInitialized(); + //WidgetsFlutterBinding.ensureInitialized(); runApp(const MyApp()); } diff --git a/lib/pages/drawer/drawer_page.dart b/lib/pages/drawer/drawer_page.dart index 25fd82a..b15e1bd 100644 --- a/lib/pages/drawer/drawer_page.dart +++ b/lib/pages/drawer/drawer_page.dart @@ -8,23 +8,62 @@ class DrawerPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Drawer( - // Add a ListView to the drawer. This ensures the user can scroll - // through the options in the drawer if there isn't enough vertical - // space to fit everything. - child: ListView.builder( - itemCount: 10, - itemBuilder: (context, i){ - return Obx(() => - CheckboxListTile( - value: true, - title: Text("Title"), - onChanged: (val){ - } + return SafeArea( + child: Drawer( + // Add a ListView to the drawer. This ensures the user can scroll + // through the options in the drawer if there isn't enough vertical + // space to fit everything. + child: Container( + child: Column( + children: [ + Container( + height: 100, + color: Colors.amber, + ), + ListTile( + leading: Icon(Icons.login), + title: Text("login".tr), + onTap: (){}, + ), + ListTile( + leading: Icon(Icons.password), + title: Text("change_password".tr), + onTap: (){}, + ), + ListTile( + leading: Icon(Icons.person), + title: Text("profile".tr), + onTap: (){}, + ), + ListTile( + leading: Icon(Icons.route), + title: Text("recommended_route".tr), + onTap: (){}, + ), + ListTile( + leading: Icon(Icons.favorite_rounded), + title: Text("point_rank".tr), + onTap: (){}, + ), + ListTile( + leading: Icon(Icons.featured_video), + title: Text("game_rank".tr), + onTap: (){}, + ), + ListTile( + leading: Icon(Icons.router), + title: Text("my_route".tr), + onTap: (){}, + ), + ListTile( + leading: Icon(Icons.history_sharp), + title: Text("visit_history".tr), + onTap: (){}, + ), + ], ), - ); - }, - ) + ), + ), ); } } \ No newline at end of file diff --git a/lib/pages/home/home_controller.dart b/lib/pages/home/home_controller.dart index daffbc4..6e2545c 100644 --- a/lib/pages/home/home_controller.dart +++ b/lib/pages/home/home_controller.dart @@ -50,5 +50,29 @@ class HomeController extends GetxController { } } + + void makePrevious(GeoJsonFeature fs){ + GeoJsonFeature pt = fs as GeoJsonFeature; + + for(int i=0; i<= locations[0].collection.length - 1; i++){ + GeoJsonMultiPoint p = locations[0].collection[i].geometry as GeoJsonMultiPoint; + + if(p.geoSerie!.geoPoints[0].latitude == pt.geometry!.geoSerie!.geoPoints[0].latitude && p.geoSerie!.geoPoints[0].longitude == pt.geometry!.geoSerie!.geoPoints[0].longitude ){ + + if(currentFeature.length > 0){ + currentFeature.clear(); + } + if(i == 0 ){ + currentFeature.add(locations[0].collection[locations[0].collection.length -1] as GeoJsonFeature); + } + else{ + currentFeature.add(locations[0].collection[i - 1] as GeoJsonFeature); + } + } + } + + } + + } \ No newline at end of file diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index c4a90f6..c6dabf4 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -7,10 +7,8 @@ import 'package:get/get.dart'; import 'package:rogapp/pages/drawer/drawer_page.dart'; import 'package:rogapp/pages/home/home_controller.dart'; import 'package:rogapp/routes/app_pages.dart'; -import 'package:rogapp/services/location_line_service.dart'; -import 'package:rogapp/services/location_polygon_service.dart'; -import 'package:rogapp/services/location_service.dart'; import 'package:rogapp/widgets/bottom_sheet_widget.dart'; +import 'package:flutter_breadcrumb/flutter_breadcrumb.dart'; class HomePage extends GetView { @@ -61,9 +59,7 @@ class HomePage extends GetView { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded(child: IconButton(icon: Icon(Icons.camera_enhance), onPressed: (){},),), - Expanded(child: IconButton(icon: Icon(Icons.arrow_back_ios), onPressed: (){}),), Expanded(child: new Text('')), - Expanded(child: IconButton(icon: Icon(Icons.arrow_forward_ios), onPressed: (){}),), Expanded(child: IconButton(icon: Icon(Icons.travel_explore), onPressed: (){}),), ], ), @@ -71,9 +67,19 @@ class HomePage extends GetView { floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, body:Column( children: [ - Container( - height: 50.0, - color: Colors.amber, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Container( + alignment: Alignment.centerLeft, + height: 50.0, + child: BreadCrumb( + items: [ + BreadCrumbItem(content: Text('Item1', style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),)), + BreadCrumbItem(content: Text('Item2', style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),)), + ], + divider: Icon(Icons.chevron_right), + ), + ), ), Expanded( child: Obx(() => diff --git a/lib/pages/map/map_page.dart b/lib/pages/map/map_page.dart index 752fd73..a2ddc54 100644 --- a/lib/pages/map/map_page.dart +++ b/lib/pages/map/map_page.dart @@ -42,9 +42,7 @@ class MapPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded(child: IconButton(icon: Icon(Icons.camera_enhance), onPressed: (){},),), - Expanded(child: IconButton(icon: Icon(Icons.arrow_back_ios), onPressed: (){}),), Expanded(child: new Text('')), - Expanded(child: IconButton(icon: Icon(Icons.arrow_forward_ios), onPressed: (){}),), Expanded(child: IconButton(icon: Icon(Icons.travel_explore), onPressed: (){}),), ], ), diff --git a/lib/services/location_service.dart b/lib/services/location_service.dart index 98087b1..4f1be0c 100644 --- a/lib/services/location_service.dart +++ b/lib/services/location_service.dart @@ -18,19 +18,7 @@ class LocationService{ if (response.statusCode == 200) { - // geo.processedFeatures.listen((fst) { - // fs = fst; - // }); - - return featuresFromGeoJson(utf8.decode(response.bodyBytes)); - // await geo.parse(response.body, verbose:true); - - // return fs; - - // } else { - // throw Exception('Failed to create album.'); - // } } } diff --git a/lib/utils/string_values.dart b/lib/utils/string_values.dart index ff68ba6..a4b8f7d 100644 --- a/lib/utils/string_values.dart +++ b/lib/utils/string_values.dart @@ -5,10 +5,46 @@ class StringValues extends Translations{ // TODO: implement keys Map> get keys => { 'en_US': { - 'app_title': '- Rogaining -' + 'app_title': '- Rogaining -', + 'address':'address', + 'email':'Email', + 'web':'Web', + 'wikipedia':'Wikipedia', + 'video':'video', + 'description':'Description', + 'telephone':'Tel', + 'how_nice': 'How nice', + 'want_to_go': "Want to Go", + 'schedule_point': "Schedule point", + 'login': 'Login', + 'change_password': 'Change Password', + 'profile': 'Profile', + 'recommended_route': 'Recommended Route', + 'point_rank': 'Point Rank', + 'game_rank': 'Game Rank', + 'my_route': 'My Route', + 'visit_history': 'Visit History' }, 'ja_JP': { - 'app_title': '旅行工程表' + 'app_title': '旅行工程表', + 'address':'住所', + 'email':'Eメール', + 'web':'Eメール', + 'wikipedia':'ウィキペディア', + 'video':'ビデオ', + 'description':'説明', + 'telephone':'電話', + 'how_nice':'いいね', + 'want_to_go': '行きたい', + 'schedule_point': '予定地点', + 'login': 'ログインする', + 'change_password': 'パスワード変更', + 'profile': 'プロフィール', + 'recommended_route': '推奨ルート', + 'point_rank': '地点ランキング', + 'game_rank': 'ゲームランキング', + 'my_route': 'マイルート', + 'visit_history': '訪問履歴' }, }; } \ No newline at end of file diff --git a/lib/widgets/bottom_sheet_widget.dart b/lib/widgets/bottom_sheet_widget.dart index 07dc56e..eebb366 100644 --- a/lib/widgets/bottom_sheet_widget.dart +++ b/lib/widgets/bottom_sheet_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/home/home_controller.dart'; +import 'package:url_launcher/url_launcher.dart'; class BottomSheetWidget extends StatelessWidget { //const BottomSheetWidget({ Key? key }, GeoJsonFeature? pt) : super(key: key); @@ -17,63 +18,163 @@ class BottomSheetWidget extends StatelessWidget { } } + void _launchURL(url) async { + if (!await launch(url)) throw 'Could not launch $url'; + } + @override Widget build(BuildContext context) { return SingleChildScrollView( - child: Padding( - padding: EdgeInsets.only( - bottom: MediaQuery.of(context).viewInsets.bottom, - ), - child: Container( - alignment: Alignment.topLeft, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.0), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - height: 35.0, - alignment: Alignment.center, - color: Colors.black12, - child: Obx(() => - Text(homeController.currentFeature[0].properties!["location_name"], style: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.bold, - ), - ) - ), - ), - ), - IconButton( - onPressed:(){ - print("next"); - homeController.makeNext(homeController.currentFeature[0]); - }, - icon: Icon(Icons.delete_outlined) - ) - ], - ), - Row( - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Obx(() => getImage(homeController.currentFeature[0])), - ), - ), - SizedBox(width: 66.0,) - ], - ), - ], + child: Column( + children: [ + SizedBox(height: 8.0,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + MaterialButton( + onPressed: () { + homeController.makePrevious(homeController.currentFeature[0]); + }, + color: Colors.blue, + textColor: Colors.white, + child: Icon( + Icons.arrow_back_ios, + size: 10, + ), + padding: EdgeInsets.all(16), + shape: CircleBorder(), ), - ) - ), + Expanded( + child: Container( + alignment: Alignment.center, + child: Obx(() => + Text(homeController.currentFeature[0].properties!["location_name"], style: TextStyle( + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + ), + ), + ), + MaterialButton( + onPressed: () { + homeController.makeNext(homeController.currentFeature[0]); + }, + color: Colors.blue, + textColor: Colors.white, + child: Icon( + Icons.arrow_forward_ios, + size: 10, + ), + padding: EdgeInsets.all(16), + shape: CircleBorder(), + ), + ], + ), + Row( + children: [ + Expanded( + child: SizedBox( + height: 360.0, + child: Obx(() => getImage(homeController.currentFeature[0])), + ) + ), + ], + ), + Row( + children: [ + Expanded( + child: Column( + children: [ + homeController.currentFeature[0].properties!["address"] != null ? + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("address".tr, style: TextStyle(fontWeight: FontWeight.bold),), + SizedBox(width: 12.0,), + Obx(() => Text(homeController.currentFeature[0].properties!["address"], + style: TextStyle(color: Colors.blue,), + )) + ], + ): Container(width: 0.0, height: 0,), + homeController.currentFeature[0].properties!["phone"] != null ? + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("telephone".tr, style: TextStyle(fontWeight: FontWeight.bold),), + SizedBox(width: 12.0,), + Obx(() => Text(homeController.currentFeature[0].properties!["phone"], + style: TextStyle(color: Colors.blue,), + )) + ], + ): Container(width: 0, height: 0,), + homeController.currentFeature[0].properties!["email"] != null ? + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("email".tr, style: TextStyle(fontWeight: FontWeight.bold),), + SizedBox(width: 12.0,), + Obx(() => Text(homeController.currentFeature[0].properties!["email"], + style: TextStyle(color: Colors.blue,), + )) + ], + ): Container(width: 0, height: 0,), + homeController.currentFeature[0].properties!["webcontents"] != null ? + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("web".tr, style: TextStyle(fontWeight: FontWeight.bold)), + SizedBox(width: 12.0,), + Obx(() => InkWell( + onTap: (){ + _launchURL(homeController.currentFeature[0].properties!["webcontents"]); + }, + child: Text(homeController.currentFeature[0].properties!["webcontents"], + style: TextStyle(color: Colors.blue,), + ), + )) + ], + ): Container(width: 0.0, height: 0.0,), + homeController.currentFeature[0].properties!["videos"] != null ? + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("video".tr, style: TextStyle(fontWeight: FontWeight.bold)), + SizedBox(width: 12.0,), + Obx(() => Text(homeController.currentFeature[0].properties!["videos"], + style: TextStyle(color: Colors.blue,), + )) + ], + ): Container(width: 0.0, height: 0.0,), + ], + ), + ), + ], + ), + SizedBox(height: 20.0,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + ElevatedButton( + onPressed: (){}, + child: Text("schedule_point".tr) + ), + ElevatedButton( + onPressed: (){}, + child: Text("schedule_point".tr) + ), + ElevatedButton( + onPressed: (){}, + child: Text("schedule_point".tr) + ) + ], + ), + Row( + children: [ + SizedBox(height: 60.0,), + ], + ) + ], ), ); } diff --git a/pubspec.lock b/pubspec.lock index a521f07..e3640b0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -104,6 +104,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_breadcrumb: + dependency: "direct main" + description: + name: flutter_breadcrumb + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" flutter_compass: dependency: transitive description: @@ -595,6 +602,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.3.1" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.20" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" vector_math: dependency: "direct main" description: @@ -625,4 +688,4 @@ packages: version: "0.2.0+1" sdks: dart: ">=2.16.0 <3.0.0" - flutter: ">=2.10.0-0" + flutter: ">=2.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index c5cf964..b918068 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -56,7 +56,10 @@ dependencies: material_design_icons_flutter: ^5.0.6595 google_fonts: any image_picker: ^0.8.4+4 + #geojson_vi: ^2.0.7 geojson: ^1.0.0 + url_launcher: ^6.0.20 + flutter_breadcrumb: ^1.0.1 dev_dependencies: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 1ece8f2..94586cc 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,8 +7,11 @@ #include "generated_plugin_registrant.h" #include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { GeolocatorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("GeolocatorWindows")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 6fc58c6..c9e02ad 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST geolocator_windows + url_launcher_windows ) set(PLUGIN_BUNDLED_LIBRARIES)