Change package name
Chances are you don't want your app to be named Flutter Boilerplate. Not only that, iOS doesn't let users use com.example as the identifier if you enable sign in with apple. This will guide you through the process of changing your app name and package name.
Changing Package Name and App Title
Package Name (Application ID / Bundle Identifier)
The package name uniquely identifies your app on app stores. To change it:
Option 1: Using change_app_package_name (Recommended for Android/iOS)
This project includes the change_app_package_name dev dependency. Run:
dart run change_app_package_name:main com.yourcompany.yourappThis automatically updates Android and iOS package names.
NOTE
iOS and macOS bundle identifiers do not allow underscores. Use camelCase instead (e.g., com.example.flutterBoilerplate instead of com.example.flutter_boilerplate). You may need to manually fix the iOS bundle identifier in ios/Runner.xcodeproj/project.pbxproj and macOS in macos/Runner/Configs/AppInfo.xcconfig after running this command.
To update all the Dart import references in your app, run:
find lib -name "*.dart" -exec sed -i '' 's/old_package_name/new_package_name/g' {} +Option 2: Manual Changes
| Platform | File | What to Change |
|---|---|---|
| Android | android/app/build.gradle.kts | namespace and applicationId |
| iOS | ios/Runner.xcodeproj/project.pbxproj | PRODUCT_BUNDLE_IDENTIFIER |
| macOS | macos/Runner/Configs/AppInfo.xcconfig | PRODUCT_BUNDLE_IDENTIFIER |
| Linux | linux/CMakeLists.txt | APPLICATION_ID |
| Windows | Uses executable name, no bundle ID needed | - |
App Title (Display Name)
The app title is what users see on their device. Update these files:
| Platform | File | What to Change |
|---|---|---|
| Flutter | lib/app/app.dart | title parameter in MaterialApp.router |
| Android | android/app/src/main/AndroidManifest.xml | android:label attribute |
| iOS | ios/Runner/Info.plist | CFBundleDisplayName and CFBundleName |
| macOS | macos/Runner/Configs/AppInfo.xcconfig | PRODUCT_NAME |
| Linux | linux/CMakeLists.txt | BINARY_NAME |
| Windows | windows/CMakeLists.txt | project() name and BINARY_NAME |
| Web | web/index.html | <title> tag and apple-mobile-web-app-title meta |
| Web | web/manifest.json | name and short_name |
| pubspec | pubspec.yaml | name (Dart package name, use snake_case) |
After changing the package name and app name successfully, run dart fix --apply to fix the analyzer warnings.
Quick Checklist
- Run
change_app_package_namefor Android/iOS package name - Update
pubspec.yaml→name(snake_case, e.g.,my_app) - Update
lib/app/app.dart→titlein MaterialApp - Update
android/app/src/main/AndroidManifest.xml→android:label - Update
ios/Runner/Info.plist→CFBundleDisplayNameandCFBundleName - Update
macos/Runner/Configs/AppInfo.xcconfig→PRODUCT_NAME - Update
linux/CMakeLists.txt→BINARY_NAME - Update
windows/CMakeLists.txt→project()andBINARY_NAME - Update
web/index.html→<title>and meta tags - Update
web/manifest.json→nameandshort_name - Run
dart fix --applyto fix analyzer warnings - Run
flutter clean && flutter pub get - Rebuild for each platform