@bear1210/create-flutter-template
v0.1.1
Published
Business-free Flutter project scaffold CLI (architecture from production Flutter apps)
Readme
@bear1210/create-flutter-template
Business-free Flutter scaffold CLI. Bootstraps a new Android + iOS app with a layered lib/ layout and shared infrastructure (network, logging, theme, i18n, routing), without any product/business domain code.
Version in this package.json is the npm package version. Monorepo overview: repo README.
Requirements
- Node.js
>= 20 - Flutter SDK on
PATH(fluttermust resolve) - For iOS builds: Xcode + CocoaPods (macOS)
Check the machine first:
npx -p @bear1210/create-rn-template check-mobile-env --strict-flutterQuick start
npx @bear1210/create-flutter-template myFlutterApp --org=com.example
cd myFlutterApp
flutter runFrom this monorepo:
npm install
npm run create-flutter-template -- myFlutterApp --org=com.exampleCLI
create-flutter-template <project-name> [--org=com.example] [--skip-install]| Argument / flag | Description |
| --------------- | ----------- |
| <project-name> | Output directory name. Also used to derive the Dart package name (snake_case) and display name. |
| --org=<reverse-domain> | Organization for Android applicationId / iOS bundle id prefix. Default: com.example. |
| --skip-install | Skip flutter pub get, flutter gen-l10n, and npm install (husky / commitlint). |
What the CLI does
- Runs
flutter create --org … --project-name … --platforms android,ios - Overlays the business-free
template/(lib, pubspec, tooling, Cursor rules, fonts) - Rewrites the placeholder package name
flutter_template_app→ your Dart package name - Injects camera / photo usage strings (iOS) and camera-related permissions (Android)
- Unless
--skip-install:flutter pub get→flutter gen-l10n→npm install
What the scaffold includes
App shell
- Minimal
Homepage (sample list + counter) andLogspage GoRouter+Provider- Shake-to-open logs in debug builds
Infrastructure (lib/core/)
- Dio client + auth token store / 401 refresh interceptor hook
- sqflite-backed
LocalLogger(query / export JSON·CSV) - Material 3 theme (Poppins) + ScreenUtil (390×844 design size)
- Camera / photo-library permission helpers
Engineering
analysis_options.yaml(flutter_lints)- ARB i18n (
l10n.yaml+lib/l10n/) package.jsonscripts for run / analyze / format / build /gen:l10ncommitlint+husky(commit-msg)- Cursor rules: architecture, Dart style, l10n, no private iOS APIs
Not included (intentionally)
- Product/business screens, APIs, Firebase / IAP / OAuth credentials
Included by default
zippy_flutterprobe (debug only viaZippyProbe.start(); path dep underpackages/zippy_flutter)
Generated layout
myFlutterApp/
├── lib/
│ ├── main.dart, app.dart
│ ├── pages/ # Home, Logs
│ ├── router/ # GoRouter
│ ├── widgets/common/
│ ├── providers/
│ ├── datasources/local/
│ ├── repositories/ / entities/ / services/
│ ├── core/ # network, theme, logging, permissions
│ └── l10n/
├── packages/zippy_flutter/ # Zippy debug probe
├── assets/fonts/ # Poppins
├── android/ / ios/ # from flutter create (+ permission patches)
├── pubspec.yaml
├── package.json # npm scripts + husky/commitlint
└── .cursor/rules/After generate
cd myFlutterApp
flutter run
# optional API base override
flutter run --dart-define=API_BASE_URL=https://your-host
# after editing ARB strings
flutter gen-l10n # or: npm run gen:l10nUseful npm scripts (Node tooling; Flutter commands still need the SDK):
| Script | Action |
| ------ | ------ |
| npm run setup | flutter pub get |
| npm run analyze | flutter analyze |
| npm run format | dart format lib test |
| npm run run / dev | flutter run |
| npm run build:apk | release APK (split ABI) |
| npm run build:appbundle | Play App Bundle |
| npm run build:ipa | iOS IPA |
| npm run gen:l10n | regenerate localizations |
Default API base URL lives in lib/core/constants/app_constants.dart (API_BASE_URL).
Local package development
# from repo root
npm install
npm run create-flutter-template -- demoApp --org=com.example --skip-installBump / publish version from this package only:
npm version patch -w @bear1210/create-flutter-templateLicense
MIT
