Generate Screens
Generate Screen with ability to generate ViewModel and Responsive Layouts with it.xflutter_cli generate screen
Generate Screen with Flags:
Result:
- xflutter_cli_test_application
- android
- assets
- ios
- lib
- router
- ui
- screens
- home
- mobile
- viewmodels
- widgets
Usage:
Name | Type | Description | Example |
---|---|---|---|
src | option | specify one of the modules to execute command in (monorepo workspace or standalone modular-app) | |
path | option | generate screen path | <ui/screens/{name}> for layer-based <modules/{module}/presentation/{name}> for feature-based |
mobile | flag | give you the ability to wrap mobile layout in your screen (only mobile screen will be generated) | |
tablet | flag | give you the ability to wrap tablet and mobile layouts in your screen (generate mobile and tablet screens) | |
desktop | flag | give you the ability to wrap desktop, tablet and mobile layouts in your screen (generate mobile, tablet and desktop screens) | |
state-management | flag | generate state-holder (viewModel) with screen to manage variables between screen and children widgets | |
router | flag | give you ability to manage navigation between screens | |
theme | flag | wrap your screen scaffold inside theme builder | |
back-button | flag | add back button to generated screen | |
source | option | import file from specific module, this is helpful when you have multiple files with same name and one of them should be imported in the generated file, so you need to tell CLI which one should be imported | filename.dart:my_app1 |
sources | option | import file from multiple modules, this is helpful when you have multiple files with same name and many of them of them should be imported in the generated file, so you need to tell CLI which files should be imported | models.dart:my_package1, models.dart:my_package2 |