xproject_generator 1.1.1
xproject_generator: ^1.1.1 copied to clipboard
CLI and library to scaffold production-ready Flutter apps and feature modules using opinionated GetX, Riverpod, and Bloc templates.
1.1.1 #
CLI (create & setup) #
- CI/CD wizard prompts are English only (scope, GitLab runner modes, deployment channels, platform validation messages).
- Generated project
README.mdis English only (aligned with English-onlyGUIDE.md).
1.1.0 #
Generated BaseConnection (token & refresh) #
- New Provider state management option (
provider+go_router); the connection is created once byProvider<BaseConnection>inapp.dartand injected withcontext.read<BaseConnection>(). - Auth/refresh logic is now shared and identical for GetX, Riverpod, Bloc and Provider; only how the single instance is provided differs (GetX permanent
Get.put, RiverpodkeepAliveprovider, Bloc lazy singleton, ProviderProvider<BaseConnection>). - New helpers:
saveSession(token:, refreshToken:),clearSession(),updateAuthHeaders(),clearAuthHeaders(). CallsaveSessionafter login so the token reaches the live connection (previously headers were built once in the constructor and the token was never applied). handleTokenExpired()now runs a real refresh flow (reads the stored refresh token, calls the refresh endpoint, saves rotated tokens, returns auth headers). Adjust endpoint / response keys to your API. A failed refresh fails the request cleanly (no retry loop).- Fixed: the instance is no longer replaced on refresh (
Get.delete+Get.putin GetX,reset()in Bloc).DioExtendedalready updates the headers of the same instance and retries the request. - Fixed: Riverpod
baseConnectionwas auto-disposed; it is nowkeepAlive. - Fixed: no more empty
Bearerheader before login. UserSessionsgainssaveRefreshToken/getRefreshToken; fixed the RiverpodUserModelimport path.
CLI — xproject create #
- Step progress while scaffolding: icon + spinner, label, and overall percentage on the right (four steps: 0→25→50→75→100%). When a step finishes, the line shows ✓ and total duration (e.g.
(4.2s)) instead of a ticking timer. - After create, runs
flutter pub getanddart run build_runner buildso generated apps have l10n and*.freezed.dart/*.g.dartbefore you open the IDE (GetX, Riverpod, and Bloc).
Setup commands (xproject setup …) #
- Run inside the generated Flutter project to add integrations skipped at create time.
xproject setup firebase— packages, splash, Gradle plugins, native placeholders; does not overwrite realgoogle-services.json/GoogleService-Info.plist/firebase_service.dart.xproject setup secret-key(aliassecret) — encrypted.envflow + stubsecretkey.dartuntil you replace it withsecret_key_scrypt_generator.xproject setup ci(aliascicd) — GitLab CI or GitHub Actions (+ optional Fastlane); confirms before overwriting existing pipeline files.xproject setup platforms—flutter create --platforms …for missing platforms, then flavor wiring when Android/iOS is new.- Unknown setup subcommands exit with an error instead of opening the interactive menu.
GUIDE.mdis regenerated when a setup command changes the project; the CLI reports which integration was refreshed (checklists live in Part 2).
Wizard & scaffolding #
GUIDE.mdis English only; regenerated when setup changes the project (CLI notes which integration was refreshed).- Platform target multi-select;
flutter createpasses--platforms(default Android + iOS). - Wizard order after platforms: state management → architecture (Bloc/Riverpod) → Firebase → secret key → CI/CD.
- Optional CI/CD: GitLab CI or GitHub Actions; CI-only or CI + deployment (Fastlane: Play internal, TestFlight, Firebase App Distribution, artifacts-only).
- GitLab runner modes: shared Flutter image, self-hosted shell (
ci/GITLAB_RUNNER_SETUP.md), or self-hosted Docker (ci/Dockerfile). - GitHub:
.github/workflows/flutter_ci.ymlwithubuntu-latest/macos-latest.
Generated GUIDE.md #
- Part 1 — prerequisites, project summary, folder tour.
- Part 2 — numbered setup sections with
- [ ]checklists (env, secret key, codegen, Android/iOS flavor, Firebase, CI/CD, run app, VS Code). - English-only body; two-part structure with VS Code–friendly TOC anchors.
- Table of contents links match VS Code Markdown preview heading IDs (GitHub-style slugs + duplicate-heading handling).
- Copy pass: shorter meta intros, clearer VS Code vs terminal wording; Android section highlights Run and Debug /
.vscode/launch.jsonper flavor. - Sections and
.gitignoreentries follow wizard choices (Firebase, secret key, CI/CD, platforms).
Generated project docs & DX #
- Minimal generated
README.mdpointing toGUIDE.md. .vscode/fromVsCodeConfigBuilder(launch per flavor, tasks including Build AppBundle - Development).smoke_test.dartwhen CI is enabled.- Conditional generation audit: CI/Fastlane, VS Code tasks, gitignore paths, and related files only when selected.
Templates & fixes #
- Import
ShakeChuckerConfigs/ShakeForChuckerfrompackage:dio_extended/diox_chucker.dart(dio_extended2.x). - Firebase placeholder
google-services.jsonandGoogleService-Info.plistare valid JSON/XML; Google Services 4.4.2 and Crashlytics Gradle 3.0.3 on new Firebase projects. - Template dependency bumps: Firebase Flutter 5.x stack,
dio_extended2.x,freezed4.x, Riverpod 3.4 /riverpod_generator4.0.9,go_router18.x,equatable3.x,xwidgets_pack1.3.x. - Generator package:
mason_logger,lints,testupdates; expanded tests (CI templates, gitignore, GUIDE sections, setup integrations, Android Gradle patches, post-create codegen).
1.0.6 #
Architecture & token refresh #
- Replaced the singleton
BaseConnectionwith proper dependency injection so refreshed tokens are always picked up:- Riverpod:
baseConnectionProvider - GetX: a permanent
AppController+Get.put<BaseConnection>(...) - Bloc: a single resettable instance
- Riverpod:
- A single, fresh
BaseConnectioninstance now lives for the whole app lifecycle and is shared across providers/controllers. - Switched
DioExtendedinitialization to the synchronousheadersAPI (instead ofheadersAsync) across all templates.
Project structure #
- Moved shared widgets out of
core/widgetsinto the feature that uses them (AuthScaffold→ login feature,HomeShell→ home feature). Truly shared widgets can live inlib/widgets.
Dependencies & configuration #
- Bumped all template dependencies to their latest versions.
- Added an optional "Use Secret Key (Generator Package)?" prompt to conditionally encrypt
.envfiles. - Pinned the Riverpod codegen stack to a set compatible with the meta version shipped by Flutter stable (
riverpod_generator4.0.3, analyzer-9-compatiblejson_serializable/json_annotation) to fixflutter pub getresolution failures.
Fixes #
- Fixed a Dart VM assertion crash on GetX startup caused by
StorageHelperbeing used before initialization;initApp()now initializes storage, then env, then DI in order across all state managers. - Corrected relative import paths for the shared widgets.
1.0.5 #
- Add Bloc state management option.
- Add Simple and Clean Code (domain layer) options when creating a project with Bloc or Riverpod.
1.0.4 #
- Update paths when generating features for GetX.
1.0.3 #
- Adjust logic to load assets in
lib/assets/fonts.
1.0.2 #
- Move assets into
lib.
1.0.1 #
- Add customizable
TextStylehelper using Inter. - Add customizable
AppColor. - Add API request boilerplate.
- Bug fixes.
1.0.0 #
- Initial release.