added map cache

This commit is contained in:
Mohamed Nouffer
2023-03-17 11:54:12 +05:30
parent 044e5595c2
commit 05a812428a
15 changed files with 802 additions and 408 deletions

View File

@ -4,11 +4,47 @@ PODS:
- connectivity_plus (0.0.1): - connectivity_plus (0.0.1):
- Flutter - Flutter
- ReachabilitySwift - ReachabilitySwift
- DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.4)
- DKImagePickerController/PhotoGallery (4.3.4):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.4)
- DKPhotoGallery (0.0.17):
- DKPhotoGallery/Core (= 0.0.17)
- DKPhotoGallery/Model (= 0.0.17)
- DKPhotoGallery/Preview (= 0.0.17)
- DKPhotoGallery/Resource (= 0.0.17)
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Core (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Preview
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Model (0.0.17):
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Preview (0.0.17):
- DKPhotoGallery/Model
- DKPhotoGallery/Resource
- SDWebImage
- SwiftyGif
- DKPhotoGallery/Resource (0.0.17):
- SDWebImage
- SwiftyGif
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_compass (0.0.1): - flutter_compass (0.0.1):
- Flutter - Flutter
- flutter_keyboard_visibility (0.0.1): - flutter_keyboard_visibility (0.0.1):
- Flutter - Flutter
- flutter_local_notifications (0.0.1):
- Flutter
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
@ -24,58 +60,88 @@ PODS:
- GoogleMaps/Base - GoogleMaps/Base
- image_picker_ios (0.0.1): - image_picker_ios (0.0.1):
- Flutter - Flutter
- move_to_background (0.0.1):
- Flutter
- path_provider_ios (0.0.1): - path_provider_ios (0.0.1):
- Flutter - Flutter
- permission_handler_apple (9.0.4): - permission_handler_apple (9.0.4):
- Flutter - Flutter
- ReachabilitySwift (5.0.0) - ReachabilitySwift (5.0.0)
- SDWebImage (5.15.5):
- SDWebImage/Core (= 5.15.5)
- SDWebImage/Core (5.15.5)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.2): - sqflite (0.0.2):
- Flutter - Flutter
- FMDB (>= 2.7.5) - FMDB (>= 2.7.5)
- SwiftyGif (5.4.4)
- url_launcher_ios (0.0.1): - url_launcher_ios (0.0.1):
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`) - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_compass (from `.symlinks/plugins/flutter_compass/ios`) - flutter_compass (from `.symlinks/plugins/flutter_compass/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`) - geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- move_to_background (from `.symlinks/plugins/move_to_background/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- DKImagePickerController
- DKPhotoGallery
- FMDB - FMDB
- GoogleMaps - GoogleMaps
- ReachabilitySwift - ReachabilitySwift
- SDWebImage
- SwiftyGif
EXTERNAL SOURCES: EXTERNAL SOURCES:
camera_avfoundation: camera_avfoundation:
:path: ".symlinks/plugins/camera_avfoundation/ios" :path: ".symlinks/plugins/camera_avfoundation/ios"
connectivity_plus: connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios" :path: ".symlinks/plugins/connectivity_plus/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
flutter_compass: flutter_compass:
:path: ".symlinks/plugins/flutter_compass/ios" :path: ".symlinks/plugins/flutter_compass/ios"
flutter_keyboard_visibility: flutter_keyboard_visibility:
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios" :path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
geolocator_apple: geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/ios" :path: ".symlinks/plugins/geolocator_apple/ios"
google_maps_flutter_ios: google_maps_flutter_ios:
:path: ".symlinks/plugins/google_maps_flutter_ios/ios" :path: ".symlinks/plugins/google_maps_flutter_ios/ios"
image_picker_ios: image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
move_to_background:
:path: ".symlinks/plugins/move_to_background/ios"
path_provider_ios: path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios" :path: ".symlinks/plugins/path_provider_ios/ios"
permission_handler_apple: permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios" :path: ".symlinks/plugins/permission_handler_apple/ios"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
sqflite: sqflite:
:path: ".symlinks/plugins/sqflite/ios" :path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios: url_launcher_ios:
@ -84,20 +150,29 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
camera_avfoundation: 07c77549ea54ad95d8581be86617c094a46280d9 camera_avfoundation: 07c77549ea54ad95d8581be86617c094a46280d9
connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_compass: cbbd285cea1584c7ac9c4e0c3e1f17cbea55e855 flutter_compass: cbbd285cea1584c7ac9c4e0c3e1f17cbea55e855
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
google_maps_flutter_ios: 66201f392bf62d500f07670a30488a247b9bb5b9 google_maps_flutter_ios: 66201f392bf62d500f07670a30488a247b9bb5b9
GoogleMaps: 008e2c80e38605b56b560e8deb73d4194ff30bef GoogleMaps: 008e2c80e38605b56b560e8deb73d4194ff30bef
image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb
move_to_background: 39a5b79b26d577b0372cbe8a8c55e7aa9fcd3a2d
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
PODFILE CHECKSUM: a1c2f8dde3796ecc1697a15e7c75eb5205d8a740 PODFILE CHECKSUM: a1c2f8dde3796ecc1697a15e7c75eb5205d8a740
COCOAPODS: 1.11.2 COCOAPODS: 1.12.0

View File

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 51; objectVersion = 54;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -200,6 +200,7 @@
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
@ -253,6 +254,7 @@
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );

View File

@ -63,5 +63,7 @@
<false/> <false/>
<key>io.flutter.embedded_views_preview</key> <key>io.flutter.embedded_views_preview</key>
<true/> <true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict> </dict>
</plist> </plist>

View File

@ -1,14 +1,37 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:rogapp/pages/index/index_binding.dart'; import 'package:rogapp/pages/index/index_binding.dart';
import 'package:rogapp/routes/app_pages.dart'; import 'package:rogapp/routes/app_pages.dart';
import 'package:rogapp/utils/string_values.dart'; import 'package:rogapp/utils/string_values.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:path/path.dart' as p;
void main() async {
WidgetsFlutterBinding.ensureInitialized();
FlutterMapTileCaching.initialise(await RootDirectory.normalCache);
final StoreDirectory instanceA = FMTC.instance('OpenStreetMap (A)');
await instanceA.manage.createAsync();
await instanceA.metadata.addAsync(
key: 'sourceURL',
value: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
);
await instanceA.metadata.addAsync(
key: 'validDuration',
value: '14',
);
await instanceA.metadata.addAsync(
key: 'behaviour',
value: 'cacheFirst',
);
void main() {
//WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp()); runApp(MyApp());
} }

View File

@ -396,6 +396,8 @@ class DestinationController extends GetxController {
} }
if(indexController.locations.isEmpty) return;
//check for location in bounds //check for location in bounds
for(GeoJsonFeature fs in indexController.locations[0].collection){ for(GeoJsonFeature fs in indexController.locations[0].collection){

View File

@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_map/plugin_api.dart'; import 'package:flutter_map/plugin_api.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart'; import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:flutter_map_marker_popup/flutter_map_marker_popup.dart'; import 'package:flutter_map_marker_popup/flutter_map_marker_popup.dart';
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
import 'package:flutter_polyline_points/flutter_polyline_points.dart'; import 'package:flutter_polyline_points/flutter_polyline_points.dart';
import 'package:geojson/geojson.dart'; import 'package:geojson/geojson.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
@ -15,6 +16,7 @@ import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart'; import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/services/destination_service.dart'; import 'package:rogapp/services/destination_service.dart';
import 'package:rogapp/utils/text_util.dart'; import 'package:rogapp/utils/text_util.dart';
import 'package:rogapp/widgets/base_layer_widget.dart';
import 'package:rogapp/widgets/bottom_sheet_new.dart'; import 'package:rogapp/widgets/bottom_sheet_new.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart'; import 'package:rogapp/widgets/bottom_sheet_widget.dart';
import 'package:rogapp/widgets/bread_crum_widget.dart'; import 'package:rogapp/widgets/bread_crum_widget.dart';
@ -122,10 +124,9 @@ class DestinationMapPage extends StatelessWidget {
FlutterMap TravelMap() { FlutterMap TravelMap() {
return FlutterMap( return FlutterMap(
mapController: indexController.rogMapController,
options: MapOptions( options: MapOptions(
onMapCreated: (c){ onMapReady: (){
indexController.rogMapController = c;
indexController.rogMapController!.onReady.then((_) {
indexController.is_rog_mapcontroller_loaded.value = true; indexController.is_rog_mapcontroller_loaded.value = true;
subscription = indexController.rogMapController!.mapEventStream.listen((MapEvent mapEvent) { subscription = indexController.rogMapController!.mapEventStream.listen((MapEvent mapEvent) {
if (mapEvent is MapEventMoveStart) { if (mapEvent is MapEventMoveStart) {
@ -133,7 +134,7 @@ class DestinationMapPage extends StatelessWidget {
if (mapEvent is MapEventMoveEnd) { if (mapEvent is MapEventMoveEnd) {
//destinationController.is_gps_selected.value = true; //destinationController.is_gps_selected.value = true;
//indexController.mapController!.move(c.center, c.zoom); //indexController.mapController!.move(c.center, c.zoom);
LatLngBounds bounds = c.bounds!; LatLngBounds bounds = indexController.rogMapController!.bounds!;
indexController.currentBound.clear(); indexController.currentBound.clear();
indexController.currentBound.add(bounds); indexController.currentBound.add(bounds);
if(indexController.currentUser.length <= 0){ if(indexController.currentUser.length <= 0){
@ -141,7 +142,6 @@ class DestinationMapPage extends StatelessWidget {
} }
} }
}); });
});
} , } ,
bounds: indexController.currentBound.length > 0 ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]), bounds: indexController.currentBound.length > 0 ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]),
zoom: 1, zoom: 1,
@ -149,16 +149,10 @@ class DestinationMapPage extends StatelessWidget {
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag, interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
), ),
children: [ children: [
TileLayerWidget( BaseLayer(),
options: TileLayerOptions(
urlTemplate: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
),
),
Obx(() => Obx(() =>
indexController.routePointLenght > 0 ? indexController.routePointLenght > 0 ?
PolylineLayerWidget( PolylineLayer(
options: PolylineLayerOptions(
polylines: [ polylines: [
Polyline( Polyline(
points: getPoints()!, points: getPoints()!,
@ -166,16 +160,14 @@ class DestinationMapPage extends StatelessWidget {
color: Colors.indigo color: Colors.indigo
), ),
], ],
),
) )
: :
Container(), Container(),
), ),
LocationMarkerLayerWidget(), CurrentLocationLayer(),
MarkerLayerWidget( MarkerLayer(
options: MarkerLayerOptions( markers: getMarkers()!
markers: getMarkers()!
),
), ),
], ],

View File

@ -46,8 +46,8 @@ class IndexController extends GetxController {
var is_custom_area_selected = false.obs; var is_custom_area_selected = false.obs;
MapController? mapController; MapController mapController = MapController();
MapController? rogMapController; MapController rogMapController = MapController();
var mode = 0.obs; var mode = 0.obs;

View File

@ -39,7 +39,7 @@ class _LandingPageState extends State<LandingPage> {
Container( Container(
height: MediaQuery.of(context).size.height/3, height: MediaQuery.of(context).size.height/3,
decoration: BoxDecoration( decoration: BoxDecoration(
image:DecorationImage(image: AssetImage('assets/gradient_japanese_temple.jpg')) image:DecorationImage(image: AssetImage('assets/images/gradient_japanese_temple.jpg'))
), ),
), ),
SizedBox(height: 20.0,), SizedBox(height: 20.0,),

View File

@ -1,22 +1,24 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart'; import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
class BaseLayer extends StatelessWidget { class BaseLayer extends StatelessWidget {
const BaseLayer({Key? key}) : super(key: key); const BaseLayer({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return TileLayerWidget( return TileLayer(
options: TileLayerOptions( urlTemplate: "https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",
backgroundColor: Colors.transparent, tileProvider: FMTC.instance('OpenStreetMap (A)').getTileProvider(
//urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', FMTCTileProviderSettings(
urlTemplate: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', behavior: CacheBehavior.values
//urlTemplate: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', .byName('cacheFirst'),
//subdomains: ['a', 'b', 'c'], cachedValidDuration: Duration(
//subdomains: ['TileMatrix', 'TileCol', 'TileRow'], days: 14
),
), ),
); ),
);
} }
} }

View File

@ -21,37 +21,63 @@ class MapWidget extends StatelessWidget {
StreamSubscription? subscription; StreamSubscription? subscription;
Widget getMarkerShape(GeoJsonFeature i){ Widget getMarkerShape(GeoJsonFeature i, BuildContext context){
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
//print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
RegExp regex = RegExp(r'([.]*0)(?!.*\d)'); RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( InkWell(
height: 32, onTap: () {
width: 32, GeoJsonFeature? fs = indexController.getFeatureForLatLong(p.geoSerie!.geoPoints[0].latitude, p.geoSerie!.geoPoints[0].longitude);
decoration: BoxDecoration( print("------- fs ${fs}------");
shape: BoxShape.circle, if(fs != null){
color: Colors.transparent, indexController.currentFeature.clear();
border: Border.all( indexController.currentFeature.add(fs);
color: i.properties!['buy_point'] > 0 ? Colors.blue : Colors.red, //print("----- fs is ${fs.properties!['photos']}");
width: 3, indexController.getAction();
style: BorderStyle.solid
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: true,
builder:((context) => BottomSheetNew())
//builder:((context) => BottomSheetWidget())
);
}
},
child: 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.centerLeft,
origin: Offset.fromDirection(1, 26),
angle: 270 * pi / 180,
child: Icon(Icons.play_arrow_outlined, color: Colors.red, size: 70,)):
Container(color: Colors.transparent,),
],
) )
), ),
child: Stack( ),
alignment: Alignment.center,
children: [
Icon(Icons.circle,size: 6.0,),
i.properties!['cp'] == -1 ?
Transform.rotate(
alignment: Alignment.centerLeft,
origin: Offset.fromDirection(1, 26),
angle: 270 * pi / 180,
child: Icon(Icons.play_arrow_outlined, color: Colors.red, size: 70,)):
Container(color: Colors.transparent,),
],
)
),
Container(color: Colors.white, child: Text(TextUtils.getDisplayTextFeture(i), style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,))), Container(color: Colors.white, child: Text(TextUtils.getDisplayTextFeture(i), style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,))),
], ],
); );
@ -71,14 +97,12 @@ class MapWidget extends StatelessWidget {
child: CircularProgressIndicator(), child: CircularProgressIndicator(),
): ):
FlutterMap( FlutterMap(
//mapController: mapController, mapController: indexController.mapController,
options: MapOptions( options: MapOptions(
onMapCreated: (c){ maxZoom:18.4,
indexController.mapController = c; onMapReady: (){
indexController.mapController!.onReady.then((_) {
indexController.is_mapController_loaded.value = true; indexController.is_mapController_loaded.value = true;
subscription = indexController.mapController!.mapEventStream.listen((MapEvent mapEvent) { subscription = indexController.mapController.mapEventStream.listen((MapEvent mapEvent) {
if (mapEvent is MapEventMoveStart) { if (mapEvent is MapEventMoveStart) {
//print(DateTime.now().toString() + ' [MapEventMoveStart] START'); //print(DateTime.now().toString() + ' [MapEventMoveStart] START');
// do something // do something
@ -89,34 +113,15 @@ class MapWidget extends StatelessWidget {
//indexController.rogMapController!.move(c.center, c.zoom); //indexController.rogMapController!.move(c.center, c.zoom);
} }
}); });
});
}, },
//center: LatLng(37.15319600454702, 139.58765950528198), //center: LatLng(37.15319600454702, 139.58765950528198),
bounds: indexController.currentBound.length > 0 ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]), bounds: indexController.currentBound.length > 0 ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]),
zoom: 1, zoom: 1,
maxZoom: 24,
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag, interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
plugins: [
MarkerClusterPlugin(),
],
onPositionChanged: (MapPosition pos, isvalue){ onPositionChanged: (MapPosition pos, isvalue){
// LatLng c1 = pos.center?? LatLng(0, 0);
// Timer(Duration(milliseconds:800), () {
// print(pos.bounds!.center);
// print("Yeah, this line is printed after 3 second");
// LatLng c2 = pos.center?? LatLng(0, 0);
// if(c1.latitude != 0 && c1.latitude == c2.latitude){
// print("------ calling ----");
// //indexController.loadLocationsBound();
// }
// });
//
}, },
onTap: (_, __) => onTap: (_, __) =>
_popupController _popupController
@ -124,81 +129,29 @@ class MapWidget extends StatelessWidget {
), ),
children: [ children: [
BaseLayer(), BaseLayer(),
LocationMarkerLayerWidget(), CurrentLocationLayer(),
indexController.locations.isNotEmpty && indexController.locations[0].collection.isNotEmpty ?
MarkerLayer(
markers:indexController.locations[0].collection.map((i) {
print("i si ${i.properties!['location_id']}");
indexController.locations.length > 0 ? RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
MarkerClusterLayerWidget( GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
options: MarkerClusterLayerOptions( print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
spiderfyCircleRadius: 0, return Marker(
spiderfySpiralDistanceMultiplier: 2, anchorPos: AnchorPos.exactly(Anchor(108.0, 18.0)),
circleSpiralSwitchover: 12, height: 32.0,
maxClusterRadius: 0, width: 120.0,
rotate: true, point: LatLng(p.geoSerie!.geoPoints[0].latitude, p.geoSerie!.geoPoints[0].longitude),
onMarkerTap: (marker){ builder: (ctx){
GeoJsonFeature? fs = indexController.getFeatureForLatLong(marker.point.latitude, marker.point.longitude); return getMarkerShape(i, context);
//print("------- fs ${fs}------"); },
if(fs != null){ );
indexController.currentFeature.clear(); }).toList(),
indexController.currentFeature.add(fs); )
//print("----- fs is ${fs.properties!['photos']}"); :
indexController.getAction(); Center(child: CircularProgressIndicator())
,
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: true,
builder:((context) => BottomSheetNew())
//builder:((context) => BottomSheetWidget())
);
}
},
size: Size(40, 40),
anchor: AnchorPos.align(AnchorAlign.left),
fitBoundsOptions: const FitBoundsOptions(
padding: EdgeInsets.all(50),
maxZoom: 265,
),
markers:indexController.locations[0].collection.map((i) {
print("i si ${i.properties!['location_id']}");
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
return Marker(
anchorPos: AnchorPos.exactly(Anchor(108.0, 18.0)),
height: 32.0,
width: 120.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),
builder: (ctx){
return getMarkerShape(i);
},
);
}).toList(),
builder: (context, markers) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
color: Colors.blue),
child: Center(
child: Text(
markers.length.toString(),
style: TextStyle(color: Colors.white),
),
),
);
},
),
): Container(height:0,width: 0),
], ],
) )
) )

File diff suppressed because it is too large Load Diff

View File

@ -71,8 +71,10 @@ dependencies:
circular_menu: ^2.0.1 circular_menu: ^2.0.1
camera_camera: ^3.0.0-dev camera_camera: ^3.0.0-dev
intl: ^0.17.0 intl: ^0.17.0
modal_bottom_sheet: ^2.1.2 modal_bottom_sheet: ^3.0.0-pre
connectivity_plus: ^3.0.2 connectivity_plus: ^3.0.2
flutter_map_tile_caching: ^6.2.0
shared_preferences: ^2.0.15
flutter_icons: flutter_icons:
android: true android: true
@ -106,7 +108,7 @@ flutter:
assets: assets:
- assets/images/ - assets/images/
- assets/images/empty_image.png - assets/images/empty_image.png
- assets/gradient_japanese_temple.jpg - assets/images/gradient_japanese_temple.jpg
- assets/images/japanese_fun.jpeg - assets/images/japanese_fun.jpeg
- assets/images/appicon.png - assets/images/appicon.png
- assets/images/login_image.jpg - assets/images/login_image.jpg

View File

@ -9,6 +9,7 @@
#include <connectivity_plus/connectivity_plus_windows_plugin.h> #include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <geolocator_windows/geolocator_windows.h> #include <geolocator_windows/geolocator_windows.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h> #include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
@ -18,6 +19,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("GeolocatorWindows")); registry->GetRegistrarForPlugin("GeolocatorWindows"));
PermissionHandlerWindowsPluginRegisterWithRegistrar( PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar( UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows")); registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }

View File

@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus connectivity_plus
geolocator_windows geolocator_windows
permission_handler_windows permission_handler_windows
share_plus
url_launcher_windows url_launcher_windows
) )