Install & Create a Project¶
This page is for fluzer users: how to install it, create a project, generate a feature module, and run it. All commands and skeletons are based on the real code.
1. Install fluzer¶
For local development you can also run it directly:
dart run bin/fluzer.dart <command>(inside theflutter_zero_clirepository).
Verify it is on your PATH after installing:
2. Create a project¶
What create does (create_command.dart):
- Validate the project name (must start with a lowercase letter; only lowercase letters, digits, and underscores).
- Render the
projectbrick (only thenamevariable) into the current directory, generating the./<name>project directory directly. - Run
flutter create . --org <org> --project-name <name>. - Remove the redundant test file (
widget_test.dart) generated byflutter create. - Run
flutter pub get. - Run
flutter gen-l10n. - Run
build_runner(optional; skip with--no-build-runner).
Available options:
| Option | Default | Description |
|---|---|---|
--org |
com.example |
Organization identifier; affects the bundle ID |
--no-build-runner |
— | Skip the build_runner step after generation |
--build-runner |
enabled | Run build_runner after generation (default; negatable) |
After creation, enter the project:
3. Add a feature module¶
new will:
- Render the
featurebrick intolib/features/login/. - Inject
LoginModule.register(getIt)into theregisterFeatureModulesregion ofcore/di/injection_base.dart. - Run
build_runnerby default (skip with--no-build-runner).
The generated skeleton (excerpt from the brick):
// lib/features/login/login_module.dart
class LoginModule {
LoginModule._();
static void register(GetIt getIt) {
getIt.registerLazySingleton<LoginRepository>(
() => LoginRepository(client: getIt<DioClient>()),
);
}
}
// lib/features/login/presentation/pages/login_page.dart
class LoginPage extends StatelessWidget {
const LoginPage({super.key, this.bloc});
final LoginBloc? bloc;
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (_) => bloc ?? LoginBloc(repository: getIt<LoginRepository>()),
child: const EffectListener<LoginBloc, LoginState>(
effectsHandles: [loginEffectHandle],
child: LoginBody(),
),
);
}
}
loginEffectHandleis the business handler function exported frompresentation/effects/login_effect_handle.dart;EffectListenerplaces it at the front of the responsibility chain, and the framework's default handles fall back at the end of the chain.
4. Next steps¶
After the skeleton is generated, the directory contains freezed empty shells (with guiding comments) and a Bloc placeholder that already mixes in the four Mixins. The next step is Write Your First Feature — a complete example showing how to wire the packaged Mixins / Effect / error system / BaseRepository together to write business logic.
About the version command
Running fluzer version shows the current version and automatically checks pub.dev for updates (available results cached for 24h, unavailable results for 10min, with silent degradation). See CLI Reference for details.