hoshika_flkit 0.2.0
hoshika_flkit: ^0.2.0 copied to clipboard
A CLI tool to generate Flutter projects.
FLKit #
FLKit is a small CLI for creating Flutter apps with a clean, feature-first starter. It removes the repetitive setup work around routing, translations, theme tokens, environment variables, auth screens, navigation, and the first project structure.
The package is published on pub.flutter-io.cn as hoshika_flkit, and it installs the
flkit command.
Features #
- Feature-first Flutter starter.
- Starter and custom creation flows.
- Feature generation with
flkit add feature <name>. - Agent-readable starter with
AGENTS.mdandflkit.yaml. - Mobile, desktop, and web platform selection.
- Slang i18n with English and French starter translations.
- Feature-local translation files.
- GoRouter navigation with onboarding, auth, home, search, favorite, settings.
- Optional Riverpod Generator setup.
- Optional Dio API client setup.
- Envied setup for generated environment variables.
- Freezed and JSON Serializable dependencies ready for DTOs and models.
- Simple black and white Theme Tailor theme.
- Mock async auth flow with TODOs for backend calls.
Install #
Activate FLKit from pub.flutter-io.cn:
dart pub global activate hoshika_flkit
Check that the command is available:
flkit --version
Usage #
Create a Flutter app with the default starter:
flkit create sample_app --template=starter
The starter template only asks for a bundle id and uses the default FLKit stack.
Create a Flutter app with the custom flow:
flkit create sample_app
The custom flow asks for:
- bundle id
- target platforms
- languages
- Riverpod Generator
- Dio
Non-Interactive Usage #
You can pass flags for scripts, CI, or AI agents:
flkit create sample_app \
--template=starter \
--bundle-id=com.example.app \
--platforms=mobile
Platform groups:
flkit create sample_app --template=starter --platforms=mobile
flkit create sample_app --template=starter --platforms=desktop
flkit create sample_app --template=starter --platforms=web
flkit create sample_app --template=starter --platforms=mobile,web
Flutter platforms are also supported:
flkit create sample_app --template=starter --platforms=android,ios,web
Add A Feature #
Inside a FLKit-generated project, add a feature folder:
flkit add feature notifications
This creates:
lib/features/notifications/
application/
data/
domain/
i18n/
presentation/
It also creates a starter screen and i18n files for the detected project languages.
Use explicit languages for scripts or AI agents:
flkit add feature notifications --languages=en,fr
Skip Slang generation if you want to run it yourself later:
flkit add feature notifications --no-run-slang
Generated Project #
After generation, FLKit runs:
flutter pub get
dart run slang
Then run the remaining code generation commands in the generated project:
cd sample_app
dart run slang
dart run build_runner build --delete-conflicting-outputs
flutter run
The generated starter uses this layout:
lib/
core/
env/
i18n/
network/
router/
theme/
widgets/
features/
auth/
favorite/
home/
onboarding/
search/
settings/
Feature translations live next to their feature:
lib/features/auth/i18n/auth_en.i18n.json
lib/features/auth/i18n/auth_fr.i18n.json
Shared translations stay in:
lib/core/i18n/
Environment values are generated from .env with Envied:
.env.example
lib/core/env/env.dart
FLKit also adds .env patterns to the generated .gitignore.
Generated projects include:
AGENTS.md
flkit.yaml
AGENTS.md gives AI agents and contributors project instructions. flkit.yaml
records the generated stack, architecture, tools, locales, and conventions.
Roadmap #
See ROADMAP.md.
License #
MIT