🧱 Presentation Layer
A brick to create a presentation layer by features with selected state management (current bloc
, cubit
, get
).
🚧 Requirements
Make sure you have the libraries of state management you want to use, for example: bloc
and cubit
, you have the bloc
or flutter_bloc
(equatable
if you want to use Equatable
) libraries inside your pubspec.yaml
file.
🚀 Usage
Full command:
mason make presentation_layer -o ./output-path --name name --stm bloc/cubit/getx
Command:
mason make presentation_layer
✨ Variables
Variable | Description | Default | Type |
---|---|---|---|
name | Presentation Layer name | Home | string |
stm | State Management (current bloc, cubit, getx) | enum |
📦 Output
Generated folder architecture with name home
and bloc
for state management:
.
├── home
│ ├── bloc
│ │ ├── home_bloc.dart
│ │ ├── home_event.dart
│ │ └── home_state.dart
│ ├── view
│ │ └── home_page.dart (home_page.dart has Page-View pattern)
│ ├── widget
│ │ └── .gitkeep
│ └── home.dart
└── ...
Generated folder architecture with name is home
and cubit
for state management:
.
├── home
│ ├── cubit
│ │ ├── home_cubit.dart
│ │ └── home_state.dart
│ ├── view
│ │ └── home_page.dart (home_page.dart has Page-View pattern)
│ ├── widget
│ │ └── .gitkeep
│ └── home.dart
└── ...
Generated folder architecture with name is home
and getx
for state management:
.
├── home
│ ├── binding
│ │ └── home_binding.dart
│ ├── controller
│ │ └── home_controller.dart
│ ├── view
│ │ └── home_page.dart (home_page.dart using `GetView<HomeController>`)
│ ├── widget
│ │ └── .gitkeep
│ └── home.dart
└── ...