flutter_base_kit 1.0.0
flutter_base_kit: ^1.0.0 copied to clipboard
A comprehensive Flutter development kit with base classes, utilities, and common patterns for faster app development.
Flutter Base Kit #
A comprehensive Flutter development toolkit that provides a solid foundation for building modern Flutter applications with best practices, dependency injection, routing, networking, and more.
Features #
- π Project Templates: Create apps, packages, or package+tester projects
- π§ Dependency Injection: GetIt + Injectable for clean architecture
- π Networking: Dio + Retrofit for API communication
- π Localization: Multi-language support with ARB files
- π¨ Theme System: Flexible theming with BaseDesigns + CustomDesigns
- π± State Management: Provider + Bloc for state management
- π Code Generation: Freezed, JSON serialization, and more
- π£οΈ Routing: AutoRoute for declarative navigation
- π¦ CLI Tool: Command-line interface for project generation
Installation #
Local Development (Recommended for now) #
Since the package is not yet published to pub.flutter-io.cn, you can use it locally:
git clone https://github.com/Okladnoj/flutter_base_kit.git
cd flutter_base_kit
dart pub get
# Run the CLI tool locally
dart run bin/flutter_base_kit.dart create my_app --template app
Global Installation (After publication) #
Once published to pub.flutter-io.cn:
dart pub global activate flutter_base_kit
Usage #
CLI Commands #
Create a new Flutter app
# Basic app creation
flutter_base_kit create my_app
# With organization identifier
flutter_base_kit create my_app --org com.example
# With verbose output
flutter_base_kit create my_app --template app --org com.example --verbose
Create a Flutter package
# Create a package
flutter_base_kit create my_package --template package
# With organization identifier
flutter_base_kit create my_package --template package --org com.example
Create a package with tester
# Create package + tester project
flutter_base_kit create my_project --template package+tester
# With organization identifier
flutter_base_kit create my_project --template package+tester --org com.example
Initialize existing project
# Add flutter_base_kit to existing project
flutter_base_kit init
Template Types #
app
: Full Flutter application with all featurespackage
: Flutter package/plugin templatepackage+tester
: Package with separate tester application
CLI Options #
--org
: Organization identifier (e.g., com.example)--template
: Template type (app, package, package+tester)--verbose
: Enable verbose output--help
: Show help message
Project Structure #
App Template #
lib/
βββ api/ # API services and models
βββ core/ # Core functionality
βββ di/ # Dependency injection
βββ l10n/ # Localization
βββ models/ # Data models
βββ routes/ # App routing
βββ services/ # Business logic services
βββ themes/ # App theming
βββ ui/ # UI components
βββ utils/ # Utilities
Package Template #
lib/
βββ src/ # Package source code
β βββ ui/ # UI components
β βββ themes/ # Theme system
β βββ utils/ # Utilities
β βββ ...
βββ example/ # Example usage
Package + Tester Template #
project_name/
βββ project_name_package/ # Package
βββ project_name_tester/ # Tester app
Getting Started #
-
Create a new project:
flutter_base_kit create my_app --template app --org com.example
-
Navigate to project:
cd my_app
-
Install dependencies:
flutter pub get
-
Run code generation:
flutter packages pub run build_runner build
-
Run the app:
flutter run
Dependencies #
Core Dependencies #
flutter_bloc
: State managementget_it
: Dependency injectioninjectable
: Code generation for DIauto_route
: Declarative routingdio
: HTTP clientretrofit
: Type-safe HTTP clientfreezed
: Immutable data classesjson_annotation
: JSON serializationflutter_localizations
: Localization support
Development Dependencies #
build_runner
: Code generationinjectable_generator
: DI code generationauto_route_generator
: Route code generationretrofit_generator
: Retrofit code generationjson_serializable
: JSON code generationfreezed
: Freezed code generationflutter_gen_runner
: Asset code generation
Configuration #
Localization #
Add ARB files to lib/l10n/
:
app_en.arb
- English translationsapp_ru.arb
- Russian translations
Assets #
Configure assets in pubspec.yaml
:
flutter:
assets:
- assets/images/
- assets/svg/
- assets/lottie/
- assets/icons/
fonts:
- family: Nunito
fonts:
- asset: fonts/nunito/Nunito-Regular.ttf
Code Generation #
Run code generation after changes:
flutter packages pub run build_runner build --delete-conflicting-outputs
Contributing #
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Support #
If you encounter any issues or have questions, please:
- Check the documentation
- Search existing issues
- Create a new issue with detailed information
Changelog #
See CHANGELOG.md for a list of changes and version history.