Flutter Internet Permission: If you’re working on a flutter app that needs the internet, you’ll need to add additional permissions to the AndroidManifest.xml
file. Otherwise, your app won’t be able to connect to the internet.
In this post, I am going to share how to permit the internet connection in your Flutter application.
Flutter Internet Permission
To keep it short, you will have to add the following to your androidManifest.xml
.
<uses-permission android:name="android.permission.INTERNET" />
If you are not sure how to do it, follow the step-by-step instructions below.
Step 1: Copy the following line
<uses-permission android:name="android.permission.INTERNET" />
Step 2: Find AndroidManifest.xml
file
The file is located in your Flutter project in the following path:
project-path > android > app > src > main > AndroidManifest.xml
Step 3: Paste the code in androidManifest.xml
Paste the code as shown in the screenshot given below:
Why need permission to access the internet in your app?
This permission is required for user security. When you download an app from the Play Store, it will ask you for permission to use it.
Let’s imagine you’re downloading a program that shouldn’t utilize the internet at all, and if you don’t ask for permission, it could be silently uploading data to a server.
You must include internet permission explicitly in AndroidManifest.xml
so that your app’s users are aware of it.