Skip to content

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:

This project includes the change_app_package_name dev dependency. Run:

bash
dart run change_app_package_name:main com.yourcompany.yourapp

This 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:

bash
find lib -name "*.dart" -exec sed -i '' 's/old_package_name/new_package_name/g' {} +

Option 2: Manual Changes

PlatformFileWhat to Change
Androidandroid/app/build.gradle.ktsnamespace and applicationId
iOSios/Runner.xcodeproj/project.pbxprojPRODUCT_BUNDLE_IDENTIFIER
macOSmacos/Runner/Configs/AppInfo.xcconfigPRODUCT_BUNDLE_IDENTIFIER
Linuxlinux/CMakeLists.txtAPPLICATION_ID
WindowsUses executable name, no bundle ID needed-

App Title (Display Name)

The app title is what users see on their device. Update these files:

PlatformFileWhat to Change
Flutterlib/app/app.darttitle parameter in MaterialApp.router
Androidandroid/app/src/main/AndroidManifest.xmlandroid:label attribute
iOSios/Runner/Info.plistCFBundleDisplayName and CFBundleName
macOSmacos/Runner/Configs/AppInfo.xcconfigPRODUCT_NAME
Linuxlinux/CMakeLists.txtBINARY_NAME
Windowswindows/CMakeLists.txtproject() name and BINARY_NAME
Webweb/index.html<title> tag and apple-mobile-web-app-title meta
Webweb/manifest.jsonname and short_name
pubspecpubspec.yamlname (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

  1. Run change_app_package_name for Android/iOS package name
  2. Update pubspec.yamlname (snake_case, e.g., my_app)
  3. Update lib/app/app.darttitle in MaterialApp
  4. Update android/app/src/main/AndroidManifest.xmlandroid:label
  5. Update ios/Runner/Info.plistCFBundleDisplayName and CFBundleName
  6. Update macos/Runner/Configs/AppInfo.xcconfigPRODUCT_NAME
  7. Update linux/CMakeLists.txtBINARY_NAME
  8. Update windows/CMakeLists.txtproject() and BINARY_NAME
  9. Update web/index.html<title> and meta tags
  10. Update web/manifest.jsonname and short_name
  11. Run dart fix --apply to fix analyzer warnings
  12. Run flutter clean && flutter pub get
  13. Rebuild for each platform