flutter_app_rebrand 1.0.3
flutter_app_rebrand: ^1.0.3 copied to clipboard
Rebrand your Flutter application using one command from terminal
Flutter App Rebrand #
Flutter App Rebrand automates the process of rebranding a Flutter application by updating the package name, launcher icon, and app name across both Android and iOS platforms. It ensures a smooth transition when you need to rebrand an app for new clients, products, or design overhauls.
Features #
- Package Name Update: Automatically updates the package name for both Android and iOS.
- App Name Update: Changes the app name that is displayed on the device.
- Directory Structure Refactoring: Moves the
MainActivity
to the correct new package directory and deletes the old one. - iOS Bundle Identifier Update: Updates the iOS product bundle identifier (
Runner.xcodeproj
). - Launcher Icon Update: Replaces the app’s launcher icon with a new one, updating for both platforms. Optional if flutter_launcher_icons package is not being used.
- iOS Archive Name Update: This package also updates the generated archive name as per the provided appName
What It does? #
- ✅ Updates AndroidManifest.xml, build.gradle and MainActivity in both Java and Kotlin
- ✅ Moves MainActivity to the new package directory structure and deletes old one
- ✅ Generate & updates old ic_launcher icons with new ones
- ✅ Updates Product Bundle Identifier in iOS (Runner.xcodeproj)
- ✅ Generate & updates AppIcons and ImageSets
How It Works #
This package uses a configuration file (rebrand_config.json
) to automatically apply all the necessary changes to your Flutter app. Once the configuration file is set up, the rebranding process runs smoothly without the need for manual edits to each platform-specific file.
Installation #
Add the flutter_app_rebrand
package to your project by including it in your pubspec.yaml
file underdev_dependencies:
section.
dev_dependencies:
flutter_app_rebrand: ^1.0.3
or run this command
flutter pub add -d flutter_app_rebrand
Update dependencies
flutter pub get
Usage #
Step 1: Define Your Input Configuration #
Option 1: Manually creating json file #
Create a JSON configuration file in your project's root directory, such as rebrand_config.json
, with the following structure:
{
"ios": {
"packageName": "com.sarj33t.ios",
"launcherIconPath": "../FAR-logo.png",
"appName": "Panda iOS"
},
"android": {
"packageName": "com.sarj33t.android",
"launcherIconPath": "../FAR-logo.png",
"appName": "Panda Droid"
}
}
Configuration Details:
iOS:
- packageName: Unique bundle identifier for the iOS app.
- launcherIconPath: Path to the iOS launcher icon file.
- appName: Display name for the iOS app.
Android:
- packageName: Unique package name for the Android app.
- launcherIconPath: Path to the Android launcher icon file.
- appName: Display name for the Android app.
Notes:
- The configuration can be platform-specific or identical for both iOS and Android.
- Ensure the launcherIconPath points to a valid image file relative to the configuration file.
Option 2: Auto Generate JSON Config file #
Run the following command in your terminal:
dart run flutter_app_rebrand:build
This command will generate the rebrand_config.json
JSON file that contains the new package name, path to the new launcher icon, and the updated app name.
Step 2: Run the Rebranding Command #
Execute the following command in your terminal:
dart run flutter_app_rebrand
- This will rebrand your Flutter application based on the properties that you've defined in
rebrand_config.json
file
Step 3: Rebuild Your App #
Once the configurations are applied, rebuild your Flutter app for iOS and Android:
flutter build ios
flutter build apk
About the Author #
- For more projects, tutorials, and resources, visit my website: sarj33t.com
YouTube Video Guide #
For a step-by-step video guide on how to use Flutter App Rebrand, watch this YouTube video:
(NOTE: it will refer to older versions of FAR, will re-upload new video soon)
Meta #
Distributed under the MIT license.
https://github.com/sarj33t/flutter_app_rebrand
Contributing #
- Fork the repository: (https://github.com/sarj33t/flutter_app_rebrand/fork)
- Create a new feature branch (
git checkout -b feature/your-feature-name
) - Commit your changes with a descriptive message (
git commit -am 'Add new feature: your-feature-name''
) - Push to the branch (
git push origin feature/your-feature-name
) - Open a Pull Request and submit it for review.
Acknowledgements #
The launcher icon code within FAR was originally extracted from version XYZ of the flutter_launcher_icon package.
Support #
If you find my work useful and would like to support me, you can buy me a coffee! ☕️