Internet Permission ๐
A Flutter plugin that automatically adds internet permissions for all platforms!
One command โ all platforms configured! โก
โจ Features
- ๐ Automatic setup โ Just run:
dart run internet_permission:setup - ๐ฑ Supports 6 platforms โ Android, iOS, macOS, Windows, Linux, Web
- ๐ Safe โ Creates backup files before making changes
- โก Fast โ Setup completes in seconds
- ๐ฏ Easy โ No additional configuration needed
๐ Quick Start
1๏ธโฃ Install
flutter pub add internet_permission
2๏ธโฃ Setup (Automatic!)
dart run internet_permission:setup
That's all! โ
๐ What Does It Add?
๐ฑ Android
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
๐ iOS
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
๐ป macOS
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
๐ช Windows
โ Default permission (no setup needed)
๐ง Linux
โ Default permission (no setup needed)
๐ Web
โ Default permission (no setup needed)
๐ป Usage
Check Internet Connection
InternetCheckedScaffold(
appBar: AppBar(title: Text('My App')),
body: Center(child: Text('Content')),
)e
Full Example
import 'package:flutter/material.dart';
import 'package:internet_connection_checker/internet_connection_checker.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Internet Checker Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return InternetCheckedScaffold(
appBar: AppBar(
title: Text('Internet Checker Demo'),
centerTitle: true,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.wifi,
size: 100,
color: Colors.green,
),
SizedBox(height: 20),
Text(
'Internet is connected!',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 10),
Text(
'Try turning off your internet to see the dialog',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey),
),
],
),
),
// Custom settings
dialogTitle: 'Connection Lost',
dialogMessage: 'Unable to connect to the internet. Please check your connection.',
retryButtonText: 'Try Again',
checkInterval: Duration(seconds: 3),
);
}
}
๐ฑ Setup Script Output
$ dart run internet_permission:setup
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ Internet Permission Setup v2.0.0 โ
โ ๐ฑ For all platforms โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Project: /path/to/your/project
๐ง Configuring platforms...
๐ฑ Android: โ
Added (INTERNET, ACCESS_NETWORK_STATE)
๐ iOS: โ
Added (NSAppTransportSecurity)
๐ป macOS: โ
Added (network.client, network.server)
๐ช Windows: โ
Default permissions
๐ง Linux: โ
Default permissions
๐ Web: โ
Default permissions
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
6/6 platforms successfully configured!
๐ Next steps:
1. flutter clean
2. flutter pub get
3. flutter run
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ API Reference
๐ฑ Android (manual)
Edit android/app/src/main/AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application>
<!-- ... -->
</application>
</manifest>
๐ iOS (manual)
Edit ios/Runner/Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
๐ป macOS (manual)
Edit macos/Runner/DebugProfile.entitlements and Release.entitlements:
<dict>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
๐งช Testing
In Example Project
cd example
dart run internet_permission:setup
flutter run
In a New Project
flutter create my_app
cd my_app
flutter pub add internet_permission
dart run internet_permission:setup
flutter run -d macos
โ ๏ธ Important Notes
- Backup Files โ The script creates
.backupfiles before making changes - Repeatable โ Safe to run multiple times; skips already configured platforms
- Production โ For iOS/macOS, use HTTPS connections in production
- Web โ CORS must be configured on your server
- Backward Compatibility โ Old command
setup_permissionsstill works
๐ Troubleshooting
Script Not Working?
flutter clean
flutter pub get
dart run internet_permission:setup
Platform Missing?
Some platforms may not exist in your project by default โ this is normal.
Permissions Not Added?
If automatic setup fails, follow the manual setup instructions above.
๐ฆ Version History
2.0.2 โ 2025-12-06 ๐
- โจ NEW: Support for all 6 platforms
- ๐ Simplified command:
dart run internet_permission:setup - ๐จ Improved terminal UI
- โก Faster execution
1.0.5 โ 2025-12-05
- Automatic setup script
- Android & iOS support
๐ค Contributing
Pull requests are welcome! Feel free to contribute to this project.
๐ License
MIT License
๐ Links
๐จโ๐ป Author
AbubakrFlutter
- ๐ง Email: [email protected]
- ๐ GitHub: @AbubakrFlutter
โญ If you find this plugin useful, please leave a star on GitHub!