Skip to content

App Crashes while setting Navigation View #265

Closed
@punk39393

Description

@punk39393

Environment details

App Crashed.
enabled maps sdk, for android and navigations api both
using android 11 for testing
working fine with your navigation app
i am using only for Android
pls help me what wrong i am doing

Code example

while setting view like this Future _initializeNavigationSession() async {
if (!await GoogleMapsNavigator.areTermsAccepted()) {
await GoogleMapsNavigator.showTermsAndConditionsDialog(
'My App',
'Logistics solutions',
);
}
await GoogleMapsNavigator.initializeNavigationSession();
setState(() {
_navigationSessionInitialized = true;
});
}

void _onViewCreated(GoogleNavigationViewController controller) async{
navigationViewController = controller;
await controller.setMyLocationEnabled(true);
await controller.setNavigationUIEnabled(true);
await GoogleMapsNavigator.setDestinations(Destinations(
waypoints: _waypoints,
displayOptions: NavigationDisplayOptions(
showDestinationMarkers: false,
showStopSigns: true,
showTrafficLights: true,
),
routingOptions: RoutingOptions(travelMode: NavigationTravelMode.driving),));

}

@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: curentLocation == null
? Center(
child: utils.iosProgressIndicator(AppColors.primaryThemeColor),
)
: SafeArea(
child: Stack(children: [
_navigationSessionInitialized ?
GoogleMapsNavigationView(
gestureRecognizers:Set()
..add(Factory(
() => PanGestureRecognizer()))
..add(Factory(
() => ScaleGestureRecognizer())) ,
onViewCreated: _onViewCreated,
initialMapType: MapType.normal,
initialNavigationUIEnabledPreference: NavigationUIEnabledPreference.automatic,
initialCameraPosition: CameraPosition(
target: curentLocation!,
zoom: 14,
),
):Center(child: utils.iosProgressIndicator(AppColors.primaryThemeColor),),

Following these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions