It works on mobile data and wifi during debug but on release mode it does not work in the app. It shows an error of Future.then must return a value of the returned future's type
in release mode
It works on mobile data and wifi during debug but on release mode it does not work in the app. It shows an error of Future.then must return a value of the returned future's type
in release mode
2
Answers
Since you said it works in debug, but not in release:
Flutter sets the Internet Permission in the AndroidManifest automatically, but you have to set it yourself for the release version.
https://docs.flutter.dev/data-and-backend/networking
Add this to your AndroidManifest.xml
To fix this error, you need to make sure that the then method on the Future object is returning the correct type of value.
Here is an example of how to fix this error: