mehmetoguzderin / decorated_google_maps_flutter

A Flutter package that provides a Decorated Google Maps widget with support for custom widgets that can show charts, visualizations, markers and more.
MIT License
3 stars 0 forks source link

onCameraMoveError #2

Open Vinaykummar opened 4 years ago

Vinaykummar commented 4 years ago

hi i am getting this error

E/flutter (26050): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'call' was called on null.
E/flutter (26050): Receiver: null E/flutter (26050): Tried calling: call() E/flutter (26050): #0 _DecoratedGoogleMapState.build. (package:decorated_google_maps_flutter/src/decorated_google_map.dart:227:34) E/flutter (26050): #1 GoogleMapController._connectStreams. (package:google_maps_flutter/src/controller.dart:64:69)
E/flutter (26050): #2 _rootRunUnary (dart:async/zone.dart:1192:38) E/flutter (26050): #3 _CustomZone.runUnary (dart:async/zone.dart:1085:19) E/flutter (26050): #4 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7) E/flutter (26050): #5 CastStreamSubscription._onData (dart:_internal/async_cast.dart:83:11) E/flutter (26050): #6 _rootRunUnary (dart:async/zone.dart:1192:38) E/flutter (26050): #7 _CustomZone.runUnary (dart:async/zone.dart:1085:19) E/flutter (26050): #8 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7) E/flutter (26050): #9 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11) E/flutter (26050): #10 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7) E/flutter (26050): #11 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:134:11) E/flutter (26050): #12 _WhereStream._handleData (dart:async/stream_pipe.dart:209:12) E/flutter (26050): #13 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:166:13) E/flutter (26050): #14 _rootRunUnary (dart:async/zone.dart:1192:38) E/flutter (26050): #15 _CustomZone.runUnary (dart:async/zone.dart:1085:19) E/flutter (26050): #16 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7) E/flutter (26050): #17 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11) E/flutter (26050): #18 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:266:7) E/flutter (26050): #19 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:134:11) E/flutter (26050): #20 _WhereStream._handleData (dart:async/stream_pipe.dart:209:12) E/flutter (26050): #21 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:166:13) E/flutter (26050): #22 _rootRunUnary (dart:async/zone.dart:1192:38) E/flutter (26050): #23 _CustomZone.runUnary (dart:async/zone.dart:1085:19) E/flutter (26050): #24 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7) E/flutter (26050): #25 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11) E/flutter (26050): #26 _DelayedData.perform (dart:async/stream_impl.dart:594:14) E/flutter (26050): #27 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:710:11) E/flutter (26050): #28 _PendingEvents.schedule. (dart:async/stream_impl.dart:670:7) E/flutter (26050): #29 _rootRun (dart:async/zone.dart:1180:38) E/flutter (26050): #30 _CustomZone.run (dart:async/zone.dart:1077:19) E/flutter (26050): #31 _CustomZone.runGuarded (dart:async/zone.dart:979:7) E/flutter (26050): #32 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1019:23) E/flutter (26050): #33 _rootRun (dart:async/zone.dart:1184:13) E/flutter (26050): #34 _CustomZone.run (dart:async/zone.dart:1077:19) E/flutter (26050): #35 _CustomZone.runGuarded (dart:async/zone.dart:979:7) E/flutter (26050): #36 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1019:23) E/flutter (26050): #37 _microtaskLoop (dart:async/schedule_microtask.dart:43:21) E/flutter (26050): #38 _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)

mehmetoguzderin commented 4 years ago

Hello @Vinaykummar

Can you give a little more context to your usage of onCameraMove? How you construct it etc.

Vinaykummar commented 4 years ago

As simple, once I got values from firestore instream builder I loaded markers into the map whenever i zoom in or zoom out or move map i am getting this log

This is how i am using DecoratedGoogleMap( children: markers.toList(), onMapCreated: (mapController) async { position = await _geolocator.getCurrentPosition( desiredAccuracy: LocationAccuracy.best, locationPermissionLevel: GeolocationPermission.location); _googleMapController = mapController; _googleMapController.animateCamera( CameraUpdate.newCameraPosition(CameraPosition( target: LatLng(position.latitude, position.longitude), zoom: 16, ))); }, myLocationEnabled: true, mapType: MapType.normal, initialCameraPosition: myLocation),