brix_cli 1.1.1
brix_cli: ^1.1.1 copied to clipboard
Start here: brix create makes a Flutter app that runs at once, with login, signup, codes, reset, theme, API calls and safe storage on every brix package.
brix_cli #
Start here. brix_cli is the front door of the brix family: one command makes a new app on every other brix package. Already have an app? Add only the packages you need, see the family.
Make a new Flutter app that already works: login, signup with an email code, forgot and reset password, profile, change password, delete account and logout. It comes with a theme, API calls, safe storage and tests, all built on brix.


Get started #
-
Install the command once:
dart pub global activate brix_cli -
Make an app. Use lowercase letters, digits and underscores for the name, and your company's reverse domain for
--org:brix create my_app --org com.mycompany
-
Run it:
cd my_app flutter runOr press F5 in VS Code. Until you add your API, debug runs use a test backend on the device: log in with
demo@brix.devandDemo@1234, every code is123456, or tap "Skip login". -
Add your API address in
lib/config/app_config.dart, then match the endpoints inlib/data/repositories/. Separate staging and production addresses go inenv/staging.jsonandenv/production.json.
What is inside #
The folders follow the Flutter architecture guide: routing on go_router, views and view models for each feature, repositories for your API.

Each screen is a short layout. The logic behind it (forms, loading, double taps, the session, error messages) comes from the brix packages, so it gets better when you run flutter pub upgrade, and none of it is copied into your app.
The test backend #
Debug builds without an API run on a small backend that lives on the device, in lib/dev. It saves its accounts, so the app behaves as it would with a real server: sign up, verify, log in, change your name or password, delete the account.
Every device keeps its own copy. If two people test with the demo account and one changes the password or deletes the account, the other device is not affected. "Reset local backend" starts that device over, and "Skip login" jumps to the home screen.
When you bring your own login, delete lib/dev and the two lines marked local test backend in lib/main.dart. Nothing else uses them.
Safe for release #
The test backend can never end up in your store app:
- It runs only behind
kDebugMode, so the compiler leaves it out of release builds, together with its accounts, codes and buttons. - A release build without an API shows a short setup message instead of a login screen, and only accepts an
httpsaddress. - On every change, our CI makes a new app, builds it for release on Android and the web and checks that no test account or test button is inside.
Changing the app id #
Picked com.example at the start? Change the id on Android, iOS, macOS and Linux with one command, run inside the app:
brix id com.mycompany.my_app
Commands #
brix create <app_name> [--org com.mycompany] Make a new app
brix id <com.mycompany.app> Change the app id everywhere
brix --version
brix --help
MIT licensed.
The brix packages #
brix_cli is one part of brix. New app? Start with brix_cli. Existing app? Take only the packages you need; each brings the core with it.
| Package | Version | What it does |
|---|---|---|
| brix_cli | brix create my_app: a new app on every package below. Start here |
|
| brix_ui | Buttons, fields, select, sheets, dialogs, toasts, light and dark | |
| brix_getx | GetX controllers for every account screen | |
| brix_network | REST calls that return a Result |
|
| brix_storage | Values, secrets and a session store | |
| brix | The core every package builds on: flows, Result, Json, BrixLogger |
