Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result is null #1

Closed
berthojoris opened this issue May 29, 2020 · 7 comments
Closed

result is null #1

berthojoris opened this issue May 29, 2020 · 7 comments

Comments

@berthojoris
Copy link

Pas ane test di emulator error kek gini bro

Exception has occurred.
NoSuchMethodError (NoSuchMethodError: The getter 'isNotEmpty' was called on null.
Receiver: null
Tried calling: isNotEmpty)

Pas direction atau scroll di list view bengkelnya

Error line : maps_provider.dart line 333

@berthojoris berthojoris changed the title result.isNotEmpty result is null May 29, 2020
@berthojoris
Copy link
Author

Keknya bermasalah di setPolyLines

@yusriltakeuchi
Copy link
Owner

Apa Direction API dan Place API di Google Cloudnya sudah dienable? Karena dia perlu service tersebut.

@berthojoris
Copy link
Author

berthojoris commented May 30, 2020

Sudah semua enable bro. Pas ane trace, di bagian void setPolyLines hasilnya result null. Makanya gak bisa result.forEach. Ane liat di code bro kan checknya if (result.isNotEmpty) di ane langsung berenti di situ, kalo ane ganti jadi if (result != null) jalan gak error. Cuma polyline nya gak ada coz null.
Di bagian ini gak dapat nullnya

result = await _polylinePoints.getCoordinatesWithLocation(
          origin: sourceLocation,
          destination: destination,
          mode: RouteMode.driving);

Apa karena ane pake versi sdk flutternya ane paling baru 1.17.2 ?
Oh ya ini ane test pake emulator bukan real device

@berthojoris
Copy link
Author

Sepertinya karen harus mengaktifkan billing

@yusriltakeuchi
Copy link
Owner

Error ini karena tidak berhasil mendapatkan Direction dari Direction APInya Google API, pastiin sudah mengaktifkan billing dan enable Direction APInya.
Karena function tersebut akan mengarah ke HTTP Request berikut

https://maps.googleapis.com/maps/api/directions/json

@berthojoris
Copy link
Author

Betul mas. Karena billing harus di enable dulu baru jalan

@yusriltakeuchi
Copy link
Owner

Oke berarti solve ya problem ini. Jika ada kendala lagi bisa langsung create new issue lagi aja.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants