flutter_native_toolkit 1.0.1
flutter_native_toolkit: ^1.0.1 copied to clipboard
A powerful CLI tool to automate native Android and iOS configuration in Flutter projects. Set minSdkVersion, add permissions, configure Info.plist, and more with simple commands.
Flutter Native Toolkit #
A powerful CLI tool to automate native Android and iOS configuration in Flutter projects. Stop manually editing AndroidManifest.xml, build.gradle, and Info.plist files!
Features #
- Set Android minSdkVersion - Update
build.gradleorbuild.gradle.ktswith a single command - Add Android Permissions - Inject permissions into
AndroidManifest.xmlautomatically - Add iOS Plist Keys - Configure
Info.plistentries for iOS permissions and settings - Interactive Permission Selector - Choose from 100+ pre-configured permissions organized by category
- Cross-Platform Support - Add permissions to both Android and iOS simultaneously
- Smart Defaults - Auto-generates iOS usage descriptions for common permissions
- Add Dependencies - Quick wrapper for
flutter pub add
Installation #
Global Activation (Recommended) #
dart pub global activate flutter_native_toolkit
Then use it from any Flutter project:
flutter_native_toolkit <command>
Local Installation #
Add to your dev_dependencies:
dev_dependencies:
flutter_native_toolkit: ^1.0.0
Then run:
dart run flutter_native_toolkit <command>
Quick Start #
# Set Android minSdkVersion to 23
flutter_native_toolkit set-sdk --version 23
# Add camera permission to both platforms
flutter_native_toolkit add-permission --name camera
# Interactive mode - browse and select permissions
flutter_native_toolkit add-permission --interactive
# List all available permissions
flutter_native_toolkit list-permissions
Commands #
set-sdk - Set Android minSdkVersion #
Update the minSdkVersion in your Android build.gradle or build.gradle.kts file.
flutter_native_toolkit set-sdk --version <VERSION>
flutter_native_toolkit set-sdk -v <VERSION>
Options:
| Option | Short | Description | Required |
|---|---|---|---|
--version |
-v |
SDK version number (1-99) | Yes |
Examples:
# Set to API level 23 (Android 6.0)
flutter_native_toolkit set-sdk -v 23
# Set to API level 26 (Android 8.0)
flutter_native_toolkit set-sdk --version 26
Supports:
- Groovy DSL:
minSdkVersion 21orminSdkVersion = 21 - Kotlin DSL:
minSdk = 21 - Variable references:
minSdkVersion flutter.minSdkVersion
add-permission - Add Permissions #
Add permissions to Android's AndroidManifest.xml and/or iOS's Info.plist.
flutter_native_toolkit add-permission [OPTIONS]
Options:
| Option | Short | Description | Default |
|---|---|---|---|
--name |
-n |
Permission key(s) to add | - |
--platform |
-p |
Target: android, ios, or both |
both |
--ios-description |
-d |
Custom iOS usage description | Auto-generated |
--interactive |
-i |
Launch interactive selector | false |
--list |
-l |
List all available permissions | false |
Examples:
# Add single permission to both platforms
flutter_native_toolkit add-permission -n camera
# Add multiple permissions (comma-separated)
flutter_native_toolkit add-permission -n camera,location,microphone
# Add multiple permissions (multiple flags)
flutter_native_toolkit add-permission -n camera -n location -n microphone
# Android only
flutter_native_toolkit add-permission -n internet -p android
# iOS only with custom description
flutter_native_toolkit add-permission -n camera -p ios -d "We need camera to scan QR codes"
# Interactive mode
flutter_native_toolkit add-permission -i
flutter_native_toolkit add-permission --interactive
list-permissions - List Available Permissions #
Display all 100+ available permissions organized by category.
flutter_native_toolkit list-permissions [OPTIONS]
Options:
| Option | Short | Description |
|---|---|---|
--category |
-c |
Filter by category name |
Examples:
# List all permissions
flutter_native_toolkit list-permissions
# Filter by category
flutter_native_toolkit list-permissions -c camera
flutter_native_toolkit list-permissions -c bluetooth
flutter_native_toolkit list-permissions -c location
add-plist - Add iOS Plist Key #
Add custom key-value pairs to iOS Info.plist.
flutter_native_toolkit add-plist --key <KEY> --value <VALUE> [OPTIONS]
Options:
| Option | Short | Description | Default |
|---|---|---|---|
--key |
-k |
Plist key name | Required |
--value |
-v |
Value for the key | Required |
--type |
-t |
Value type: string, boolean, integer, array |
string |
Examples:
# Add string value
flutter_native_toolkit add-plist -k CFBundleDisplayName -v "My App"
# Add boolean value
flutter_native_toolkit add-plist -k UIRequiresFullScreen -v true -t boolean
# Add integer value
flutter_native_toolkit add-plist -k MinimumOSVersion -v 12 -t integer
add-dep - Add Dependency #
Quick wrapper for flutter pub add.
flutter_native_toolkit add-dep --name <PACKAGE> [OPTIONS]
Options:
| Option | Short | Description | Default |
|---|---|---|---|
--name |
-n |
Package name to add | Required |
--dev |
-d |
Add as dev dependency | false |
Examples:
# Add regular dependency
flutter_native_toolkit add-dep -n http
# Add dev dependency
flutter_native_toolkit add-dep -n mockito -d
flutter_native_toolkit add-dep --name build_runner --dev
Available Permissions (100+) #
Permission Categories Overview #
| Category | Count | Description |
|---|---|---|
| Network & Connectivity | 21 | Internet, WiFi state, foreground services |
| Camera & Media Capture | 3 | Camera, microphone, flashlight |
| Location Services | 5 | Fine/coarse/background location |
| Storage & Files | 12 | Read/write storage, media access |
| Contacts & Calendar | 5 | Contacts, calendar, reminders |
| Phone & SMS | 17 | Calls, SMS, call logs, voicemail |
| Bluetooth & NFC | 9 | Bluetooth LE, NFC, nearby devices |
| Sensors & Biometrics | 8 | Biometric auth, health data, motion |
| System & Notifications | 67 | Notifications, alarms, tracking, services |
Network & Connectivity (21 permissions) #
| Key | Android Permission | iOS | Description |
|---|---|---|---|
internet |
android.permission.INTERNET |
- | Access the internet |
network_state |
android.permission.ACCESS_NETWORK_STATE |
- | View network connectivity state |
wifi_state |
android.permission.ACCESS_WIFI_STATE |
- | View WiFi connectivity state |
vibrate |
android.permission.VIBRATE |
- | Control device vibration |
wake_lock |
android.permission.WAKE_LOCK |
- | Prevent device from sleeping |
boot_completed |
android.permission.RECEIVE_BOOT_COMPLETED |
- | Run at device startup |
foreground_service |
android.permission.FOREGROUND_SERVICE |
- | Run foreground services |
foreground_service_location |
android.permission.FOREGROUND_SERVICE_LOCATION |
- | Run location foreground service |
foreground_service_camera |
android.permission.FOREGROUND_SERVICE_CAMERA |
- | Run camera foreground service |
foreground_service_microphone |
android.permission.FOREGROUND_SERVICE_MICROPHONE |
- | Run microphone foreground service |
foreground_service_data_sync |
android.permission.FOREGROUND_SERVICE_DATA_SYNC |
- | Run data sync foreground service |
foreground_service_media_playback |
android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK |
- | Run media playback foreground service |
foreground_service_phone_call |
android.permission.FOREGROUND_SERVICE_PHONE_CALL |
- | Run phone call foreground service |
foreground_service_health |
android.permission.FOREGROUND_SERVICE_HEALTH |
- | Run health foreground service |
foreground_service_connected_device |
android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE |
- | Run connected device foreground service |
foreground_service_remote_messaging |
android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING |
- | Run remote messaging foreground service |
foreground_service_special_use |
android.permission.FOREGROUND_SERVICE_SPECIAL_USE |
- | Run special use foreground service |
foreground_service_media_projection |
android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION |
- | Run media projection foreground service |
foreground_service_file_management |
android.permission.FOREGROUND_SERVICE_FILE_MANAGEMENT |
- | Run file management foreground service |
change_wifi_state |
android.permission.CHANGE_WIFI_STATE |
- | Connect/disconnect WiFi networks |
change_network_state |
android.permission.CHANGE_NETWORK_STATE |
- | Change network connectivity state |
Camera & Media Capture (3 permissions) #
| Key | Android Permission | iOS Key | Description |
|---|---|---|---|
camera |
android.permission.CAMERA |
NSCameraUsageDescription |
Take photos and videos |
microphone |
android.permission.RECORD_AUDIO |
NSMicrophoneUsageDescription |
Record audio |
flashlight |
android.permission.FLASHLIGHT |
- | Control camera flashlight |
Location Services (5 permissions) #
| Key | Android Permission | iOS Key | Description |
|---|---|---|---|
location |
android.permission.ACCESS_FINE_LOCATION |
NSLocationWhenInUseUsageDescription |
Access precise GPS location |
coarse_location |
android.permission.ACCESS_COARSE_LOCATION |
NSLocationWhenInUseUsageDescription |
Access approximate location |
background_location |
android.permission.ACCESS_BACKGROUND_LOCATION |
NSLocationAlwaysAndWhenInUseUsageDescription |
Access location in background |
location_always |
android.permission.ACCESS_FINE_LOCATION |
NSLocationAlwaysUsageDescription |
Access location always (iOS legacy) |
access_location_extra_commands |
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS |
- | Send extra commands to location provider |
Storage & Files (12 permissions) #
| Key | Android Permission | iOS Key | Description |
|---|---|---|---|
read_storage |
android.permission.READ_EXTERNAL_STORAGE |
NSPhotoLibraryUsageDescription |
Read external storage (Android 12-) |
write_storage |
android.permission.WRITE_EXTERNAL_STORAGE |
NSPhotoLibraryAddUsageDescription |
Write to external storage (Android 12-) |
images |
android.permission.READ_MEDIA_IMAGES |
NSPhotoLibraryUsageDescription |
Read images (Android 13+) |
video |
android.permission.READ_MEDIA_VIDEO |
NSPhotoLibraryUsageDescription |
Read videos (Android 13+) |
audio_files |
android.permission.READ_MEDIA_AUDIO |
NSAppleMusicUsageDescription |
Read audio files (Android 13+) |
manage_storage |
android.permission.MANAGE_EXTERNAL_STORAGE |
- | Full storage access |
visual_user_selected |
android.permission.READ_MEDIA_VISUAL_USER_SELECTED |
NSPhotoLibraryUsageDescription |
Access user-selected photos/videos (Android 14+) |
documents_folder |
android.permission.READ_EXTERNAL_STORAGE |
NSDocumentsFolderUsageDescription |
Access Documents folder |
downloads_folder |
android.permission.READ_EXTERNAL_STORAGE |
NSDownloadsFolderUsageDescription |
Access Downloads folder |
desktop_folder |
android.permission.READ_EXTERNAL_STORAGE |
NSDesktopFolderUsageDescription |
Access Desktop folder (macOS) |
file_provider |
android.permission.READ_EXTERNAL_STORAGE |
NSFileProviderDomainUsageDescription |
Access file provider domains |
read_media_audio_video |
android.permission.READ_MEDIA_AUDIO |
- | Read audio and video files |
Contacts & Calendar (5 permissions) #
| Key | Android Permission | iOS Key | Description |
|---|---|---|---|
contacts_read |
android.permission.READ_CONTACTS |
NSContactsUsageDescription |
Read user contacts |
contacts_write |
android.permission.WRITE_CONTACTS |
NSContactsUsageDescription |
Modify user contacts |
calendar_read |
android.permission.READ_CALENDAR |
NSCalendarsUsageDescription |
Read calendar events |
calendar_write |
android.permission.WRITE_CALENDAR |
NSCalendarsUsageDescription |
Create/modify calendar events |
reminders |
android.permission.READ_CALENDAR |
NSRemindersUsageDescription |
Access reminders (iOS) |
Phone & SMS (17 permissions) #
| Key | Android Permission | iOS | Description |
|---|---|---|---|
phone_call |
android.permission.CALL_PHONE |
- | Initiate phone calls |
phone_read |
android.permission.READ_PHONE_STATE |
- | Read phone state and identity |
phone_numbers |
android.permission.READ_PHONE_NUMBERS |
- | Read device phone numbers |
call_log_read |
android.permission.READ_CALL_LOG |
- | Read call history |
call_log_write |
android.permission.WRITE_CALL_LOG |
- | Modify call history |
sms_send |
android.permission.SEND_SMS |
- | Send text messages |
sms_read |
android.permission.READ_SMS |
- | Read text messages |
sms_receive |
android.permission.RECEIVE_SMS |
- | Receive text messages |
mms_receive |
android.permission.RECEIVE_MMS |
- | Receive multimedia messages |
answer_phone_calls |
android.permission.ANSWER_PHONE_CALLS |
- | Programmatically answer calls |
add_voicemail |
android.permission.ADD_VOICEMAIL |
- | Add voicemails to the system |
use_sip |
android.permission.USE_SIP |
- | Use SIP service for calls |
process_outgoing_calls |
android.permission.PROCESS_OUTGOING_CALLS |
- | Monitor/modify outgoing calls |
manage_own_calls |
android.permission.MANAGE_OWN_CALLS |
- | Manage own VoIP calls |
read_voicemail |
android.permission.READ_VOICEMAIL |
- | Read voicemail messages |
write_voicemail |
android.permission.WRITE_VOICEMAIL |
- | Write voicemail messages |
accept_handover |
android.permission.ACCEPT_HANDOVER |
- | Accept call handover |
receive_wap_push |
android.permission.RECEIVE_WAP_PUSH |
- | Receive WAP push messages |
read_basic_phone_state |
android.permission.READ_BASIC_PHONE_STATE |
- | Read basic phone state (Android 11+) |
Bluetooth & NFC (9 permissions) #
| Key | Android Permission | iOS Key | Description |
|---|---|---|---|
bluetooth |
android.permission.BLUETOOTH |
NSBluetoothAlwaysUsageDescription |
Bluetooth access (Android 11-) |
bluetooth_admin |
android.permission.BLUETOOTH_ADMIN |
- | Bluetooth admin (Android 11-) |
bluetooth_scan |
android.permission.BLUETOOTH_SCAN |
NSBluetoothAlwaysUsageDescription |
Scan for Bluetooth devices (Android 12+) |
bluetooth_connect |
android.permission.BLUETOOTH_CONNECT |
NSBluetoothPeripheralUsageDescription |
Connect to Bluetooth devices (Android 12+) |
bluetooth_advertise |
android.permission.BLUETOOTH_ADVERTISE |
- | Advertise to Bluetooth devices |
nfc |
android.permission.NFC |
NFCReaderUsageDescription |
Near Field Communication |
nearby_wifi |
android.permission.NEARBY_WIFI_DEVICES |
- | Discover nearby WiFi devices (Android 13+) |
uwb_ranging |
android.permission.UWB_RANGING |
- | Ultra-wideband ranging |
nearby_devices |
android.permission.NEARBY_DEVICES |
- | Discover nearby devices |
Sensors & Biometrics (8 permissions) #
| Key | Android Permission | iOS Key | Description |
|---|---|---|---|
biometric |
android.permission.USE_BIOMETRIC |
NSFaceIDUsageDescription |
Use fingerprint/face authentication |
fingerprint |
android.permission.USE_FINGERPRINT |
NSFaceIDUsageDescription |
Use fingerprint (deprecated) |
sensors |
android.permission.BODY_SENSORS |
NSMotionUsageDescription |
Access body sensors |
sensors_background |
android.permission.BODY_SENSORS_BACKGROUND |
- | Access body sensors in background |
activity_recognition |
android.permission.ACTIVITY_RECOGNITION |
NSMotionUsageDescription |
Detect physical activity |
health |
android.permission.BODY_SENSORS |
NSHealthShareUsageDescription |
Access health data (iOS HealthKit) |
health_update |
android.permission.BODY_SENSORS |
NSHealthUpdateUsageDescription |
Update health data |
high_sampling_rate_sensors |
android.permission.HIGH_SAMPLING_RATE_SENSORS |
- | Access sensors at high sampling rate |
System & Notifications (67 permissions) #
| Key | Android Permission | iOS Key | Description |
|---|---|---|---|
notifications |
android.permission.POST_NOTIFICATIONS |
- | Post notifications (Android 13+) |
system_alert |
android.permission.SYSTEM_ALERT_WINDOW |
- | Draw over other apps |
ignore_battery |
android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS |
- | Ignore battery optimizations |
install_packages |
android.permission.REQUEST_INSTALL_PACKAGES |
- | Install APK files |
delete_packages |
android.permission.REQUEST_DELETE_PACKAGES |
- | Uninstall apps |
schedule_exact_alarm |
android.permission.SCHEDULE_EXACT_ALARM |
- | Schedule exact alarms (Android 12+) |
use_exact_alarm |
android.permission.USE_EXACT_ALARM |
- | Use exact alarms (Android 14+) |
speech_recognition |
android.permission.RECORD_AUDIO |
NSSpeechRecognitionUsageDescription |
Use speech recognition |
siri |
android.permission.RECORD_AUDIO |
NSSiriUsageDescription |
Integrate with Siri (iOS) |
tracking |
android.permission.AD_ID |
NSUserTrackingUsageDescription |
Track user across apps (iOS ATT) |
picture_in_picture |
android.permission.ENTER_PICTURE_IN_PICTURE_ON_HIDE |
- | Enter picture-in-picture mode |
shortcuts |
com.android.launcher.permission.INSTALL_SHORTCUT |
- | Create home screen shortcuts |
query_all_packages |
android.permission.QUERY_ALL_PACKAGES |
- | See all installed apps |
homekit |
android.permission.INTERNET |
NSHomeKitUsageDescription |
Access HomeKit (iOS) |
local_network |
android.permission.INTERNET |
NSLocalNetworkUsageDescription |
Access local network (iOS) |
focus_status |
android.permission.ACCESS_NOTIFICATION_POLICY |
NSFocusStatusUsageDescription |
Read Focus status (iOS) |
tv_provider |
android.permission.INTERNET |
NSVideoSubscriberAccountUsageDescription |
Access TV provider (iOS) |
access_notification_policy |
android.permission.ACCESS_NOTIFICATION_POLICY |
- | Access Do Not Disturb settings |
bind_notification_listener |
android.permission.BIND_NOTIFICATION_LISTENER_SERVICE |
- | Read notifications from other apps |
media_content_control |
android.permission.MEDIA_CONTENT_CONTROL |
- | Control media playback |
get_accounts |
android.permission.GET_ACCOUNTS |
- | Get device accounts |
authenticate_accounts |
android.permission.AUTHENTICATE_ACCOUNTS |
- | Manage accounts on device |
read_sync_settings |
android.permission.READ_SYNC_SETTINGS |
- | Read sync settings |
write_sync_settings |
android.permission.WRITE_SYNC_SETTINGS |
- | Modify sync settings |
write_settings |
android.permission.WRITE_SETTINGS |
- | Modify system settings |
read_app_usage |
android.permission.PACKAGE_USAGE_STATS |
- | Access app usage statistics |
set_wallpaper |
android.permission.SET_WALLPAPER |
- | Change device wallpaper |
set_wallpaper_hints |
android.permission.SET_WALLPAPER_HINTS |
- | Set wallpaper size hints |
expand_status_bar |
android.permission.EXPAND_STATUS_BAR |
- | Expand/collapse status bar |
modify_audio_settings |
android.permission.MODIFY_AUDIO_SETTINGS |
- | Change audio settings |
disable_keyguard |
android.permission.DISABLE_KEYGUARD |
- | Disable screen lock temporarily |
kill_background_processes |
android.permission.KILL_BACKGROUND_PROCESSES |
- | Kill background processes |
reorder_tasks |
android.permission.REORDER_TASKS |
- | Reorder running tasks |
read_sync_stats |
android.permission.READ_SYNC_STATS |
- | Read sync statistics |
transmit_ir |
android.permission.TRANSMIT_IR |
- | Use infrared transmitter |
request_companion_run_background |
android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND |
- | Companion app run in background |
request_companion_use_data_background |
android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND |
- | Companion app use data in background |
request_companion_start_foreground |
android.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND |
- | Companion app start foreground |
get_package_size |
android.permission.GET_PACKAGE_SIZE |
- | Get size of installed packages |
clear_app_cache |
android.permission.CLEAR_APP_CACHE |
- | Clear cache of all apps |
read_install_sessions |
android.permission.READ_INSTALL_SESSIONS |
- | Read install sessions |
bind_quick_settings_tile |
android.permission.BIND_QUICK_SETTINGS_TILE |
- | Provide quick settings tile |
bind_device_admin |
android.permission.BIND_DEVICE_ADMIN |
- | Device administration |
bind_accessibility_service |
android.permission.BIND_ACCESSIBILITY_SERVICE |
- | Accessibility service |
bind_autofill_service |
android.permission.BIND_AUTOFILL_SERVICE |
- | Autofill service |
bind_vr_listener_service |
android.permission.BIND_VR_LISTENER_SERVICE |
- | VR listener service |
bind_wallpaper |
android.permission.BIND_WALLPAPER |
- | Wallpaper service |
bind_voice_interaction |
android.permission.BIND_VOICE_INTERACTION |
- | Voice interaction service |
bind_vpn_service |
android.permission.BIND_VPN_SERVICE |
- | VPN service |
request_password_complexity |
android.permission.REQUEST_PASSWORD_COMPLEXITY |
- | Request password complexity |
use_full_screen_intent |
android.permission.USE_FULL_SCREEN_INTENT |
- | Full screen intent notifications |
start_foreground_services_from_background |
android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND |
- | Start foreground from background |
update_packages_without_user_action |
android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION |
- | Update packages silently |
request_observe_companion_device_presence |
android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE |
- | Observe companion device |
deliver_companion_messages |
android.permission.DELIVER_COMPANION_MESSAGES |
- | Deliver companion messages |
schedule_exact_alarm_legacy |
android.permission.SCHEDULE_EXACT_ALARM |
- | Schedule exact alarms (legacy) |
detect_screen_capture |
android.permission.DETECT_SCREEN_CAPTURE |
- | Detect screen capture |
read_nearby_streaming_policy |
android.permission.READ_NEARBY_STREAMING_POLICY |
- | Read nearby streaming policy |
credential_manager |
android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS |
- | Use credential manager |
run_user_initiated_jobs |
android.permission.RUN_USER_INITIATED_JOBS |
- | Run user-initiated jobs |
subscribe_to_keyguard_locked_state |
android.permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE |
- | Subscribe to keyguard state |
read_assistant_app_search_data |
android.permission.READ_ASSISTANT_APP_SEARCH_DATA |
- | Read assistant app search data |
execute_app_action |
android.permission.EXECUTE_APP_ACTION |
- | Execute app actions |
request_companion_self_managed |
android.permission.REQUEST_COMPANION_SELF_MANAGED |
- | Companion self managed |
Interactive Mode #
The interactive mode provides a guided experience for selecting permissions:
flutter_native_toolkit add-permission --interactive
Features:
- Browse permissions by category
- See descriptions for each permission
- Select multiple permissions at once (e.g.,
1,3,5orall) - Visual indicators for iOS-compatible permissions
- Review selections before applying
Interactive Flow:
PERMISSION SELECTOR
Select permissions by category. Enter numbers separated by commas
to select multiple permissions (e.g., 1,3,5).
Select a category (or 0 to finish):
1. Network & Connectivity (21 permissions)
2. Camera & Media Capture (3 permissions)
3. Location Services (5 permissions)
4. Storage & Files (12 permissions)
5. Contacts & Calendar (5 permissions)
6. Phone & SMS (17 permissions)
7. Bluetooth & NFC (9 permissions)
8. Sensors & Biometrics (8 permissions)
9. System & Notifications (67 permissions)
0. Done - Add selected permissions
Enter choice: 2
Camera & Media Capture
Enter numbers separated by commas, "all" for all, or "back" to go back
[ ] 1. Camera [iOS]
Take photos and videos
[ ] 2. Microphone [iOS]
Record audio
[ ] 3. Flashlight
Control camera flashlight
Enter choices (e.g., 1,3,5 or "all"): 1,2
Added 2 permission(s)
Currently selected (2):
- Camera (camera)
- Microphone (microphone)
Add more permissions? (y/n): n
Adding 2 permission(s)...
- Camera (camera)
+ Android: Successfully added permission: android.permission.CAMERA
+ iOS: Successfully added "NSCameraUsageDescription" to Info.plist.
- Microphone (microphone)
+ Android: Successfully added permission: android.permission.RECORD_AUDIO
+ iOS: Successfully added "NSMicrophoneUsageDescription" to Info.plist.
Summary
------------------------------
Android: 2 added
iOS: 2 added
Programmatic Usage #
You can also use the library programmatically in your Dart code:
import 'package:flutter_native_toolkit/flutter_native_helper.dart';
void main() {
final projectRoot = '/path/to/flutter/project';
// Android Manager
final androidManager = AndroidManager(projectRoot);
// Update minSdkVersion
final sdkResult = androidManager.updateMinSdk(23);
switch (sdkResult) {
case Success(:final message):
print('Success: $message');
case Failure(:final error):
print('Error: $error');
}
// Add permission
final permResult = androidManager.addPermission('android.permission.CAMERA');
// iOS Manager
final iosManager = IosManager(projectRoot);
// Add plist key
final plistResult = iosManager.addPlistKey(
'NSCameraUsageDescription',
'We need camera access for photos',
);
// Use permission constants
final cameraPermission = findPermission('camera');
if (cameraPermission != null) {
print('Android: ${cameraPermission.androidPermission}');
print('iOS Key: ${cameraPermission.iosPermissionKey}');
print('iOS Description: ${cameraPermission.iosDefaultDescription}');
}
// Get all permissions by category
final permissionsByCategory = getPermissionsByCategory();
for (final category in PermissionCategory.values) {
final permissions = permissionsByCategory[category]!;
print('${category.displayName}: ${permissions.length} permissions');
}
}
Error Handling #
The CLI provides helpful error messages:
# Not in a Flutter project
$ flutter_native_toolkit set-sdk -v 23
Error: Not a Flutter/Dart project. Could not find pubspec.yaml in current directory.
# Invalid permission
$ flutter_native_toolkit add-permission -n invalid_perm
Warning: Permission "invalid_perm" not found. Use --list to see available permissions.
# Missing Android directory
$ flutter_native_toolkit set-sdk -v 23
Warning: Android directory not found. Run "flutter create ." to add Android support.
Requirements #
- Dart SDK:
^3.0.0 - Flutter project with
pubspec.yaml - For Android commands:
android/directory - For iOS commands:
ios/directory
Dependencies #
dependencies:
args: ^2.5.0 # Command-line argument parsing
xml: ^6.5.0 # XML parsing for AndroidManifest.xml
path: ^1.9.0 # Cross-platform path handling
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog #
See CHANGELOG.md for a list of changes.
Support #
If you encounter any issues or have questions:
Made with Dart for Flutter developers