flutter_app_generator 1.0.1
flutter_app_generator: ^1.0.1 copied to clipboard
A powerful CLI tool for generating production-ready Flutter applications with pre-configured dependencies, Firebase integration, and localization support.
Flutter App Generator #
A powerful CLI tool for generating production-ready Flutter applications with pre-configured dependencies, Firebase integration, localization, and platform-specific configurations.
Features #
- ๐ Quick Setup: Creates a complete Flutter app with a single command
- ๐ฅ Firebase Integration: Optional Firebase setup with authentication, Firestore, and analytics
- ๐ Localization Ready: Pre-configured internationalization support
- ๐ฑ Multi-Platform: Supports iOS, Android, and Web with platform-specific configurations
- ๐จ Modern Architecture: Includes app structure with themes, routing, and constants
- ๐ฆ Essential Dependencies: Pre-configured with commonly used packages
- ๐งน Clean Code: Removes default Flutter lints and uses very_good_analysis
- โก Enhanced Main: Optional enhanced main.dart with error handling and logging
Installation #
Option 1: Install from pub.dev (Recommended) #
dart pub global activate flutter_app_generator
After activation, you can run the tool from anywhere:
flutter_app_generator -n MyApp
Option 2: Install from source #
git clone https://github.com/shebnik/flutter_app_generator.git
cd flutter_app_generator
dart pub global activate --source path .
Option 3: Run directly from source #
git clone https://github.com/shebnik/flutter_app_generator.git
cd flutter_app_generator
# Direct dart command (all platforms)
dart run bin/flutter_app_generator.dart -n MyApp
# Or use convenience scripts:
# Windows
flutter_app_generator.bat -n MyApp
# macOS/Linux (make executable first)
chmod +x flutter_app_generator.sh
./flutter_app_generator.sh -n MyApp
Usage #
Basic Usage #
# Using global installation
flutter_app_generator -n MyApp
# Or running from source
dart run bin/flutter_app_generator.dart -n MyApp
Advanced Usage #
flutter_app_generator -n MyAwesomeApp -b com.example.myapp --verbose
Command Options #
-n, --name(required): App name (supports proper casing, e.g., "MyAwesomeApp")-b, --bundle-id: Bundle identifier (default: com.example)-d, --description: App description-p, --platforms: Target platforms (default: web,android,ios)--firebase: Include Firebase dependencies (default: true)--enhanced-main: Use enhanced main.dart with error handling (default: true)--verbose: Show detailed output during generation
Generated App Structure #
my_app/
โโโ assets/ # Empty assets folder
โโโ lib/
โ โโโ l10n/
โ โ โโโ app_en.arb # Localization files
โ โ โโโ l10n.dart # Localization helper
โ โโโ src/
โ โ โโโ app/
โ โ โโโ app.dart # Main app widget
โ โ โโโ app_constants.dart # App constants
โ โ โโโ app_router.dart # GoRouter configuration
โ โ โโโ app_theme.dart # Theme configuration
โ โโโ main.dart # Enhanced main with error handling
โโโ analysis_options.yaml # Very Good Analysis rules
โโโ l10n.yaml # Localization configuration
โโโ pubspec.yaml # Dependencies and configuration
Included Dependencies #
Core Dependencies #
flutter_svg- SVG supportgo_router- Declarative routinggoogle_fonts- Google Fonts integrationpackage_info_plus- App informationpath_provider- File system pathsintl- Internationalizationlogger- Logging utilitieslogger_service- Enhanced logging serviceflutter_localizations- Localization supportflutter_web_plugins- Web plugin supportuniversal_io- Web platform support
Development Dependencies #
very_good_analysis- Strict linting rulesbuild_runner- Code generationfreezed- Immutable classesjson_serializable- JSON serializationflutter_launcher_icons- App icon generation
Firebase Dependencies (Optional) #
firebase_core- Firebase core functionalityfirebase_auth- Authenticationcloud_firestore- NoSQL databasecloud_functions- Cloud functionsfirebase_crashlytics- Crash reportingfirebase_analytics- Analytics
Features Explained #
Smart Naming #
- Input:
MyAwesomeAppโ Directory:myawesomeapp, Display Name:MyAwesomeApp - Automatically handles proper casing for display names while using lowercase for project structure
Platform-Specific Configuration #
- iOS: Updates
Info.plistwith correct display name - Android: Updates
AndroidManifest.xmlwith app label - Web: Updates
index.htmltitle
Enhanced Main.dart #
- Global error handling with Firebase Crashlytics integration
- Structured logging with file output
- Platform-specific initialization
- Firebase setup with emulator support for development
Clean Dependencies #
- Removes default
flutter_lintsin favor ofvery_good_analysis - Maintains alphabetical ordering in
pubspec.yaml - Includes essential packages for modern Flutter development
Development #
To contribute to this project:
- Fork the repository
- Create a feature branch
- Make your changes
- Test with various app configurations
- Submit a pull request
Requirements #
- Flutter SDK 3.0 or higher
- Dart SDK 3.0 or higher
Platform Support #
This tool works on all platforms that support Flutter:
- Windows โ
- macOS โ
- Linux โ
Cross-Platform Notes #
- The tool automatically detects your platform and uses appropriate commands
- All Flutter commands are executed with shell support for maximum compatibility
- Path handling uses the
pathpackage for cross-platform file operations - No platform-specific dependencies or shell scripts required
Troubleshooting #
Flutter Not Found #
If you get "Flutter is not installed or not in PATH" error:
- Ensure Flutter is properly installed: https://flutter.dev/docs/get-started/install
- Verify
flutter --versionworks in your terminal - On Windows, restart your terminal after installing Flutter
Permission Issues (macOS/Linux) #
If you encounter permission issues:
# Make the script executable
chmod +x /path/to/flutter_app_generator
Global Activation Issues #
If global activation fails:
# Check if pub cache is in PATH
dart pub global list
# Add pub cache to PATH if needed (example for bash/zsh)
echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> ~/.bashrc
source ~/.bashrc
License #
This project is licensed under the MIT License - see the LICENSE file for details.