Skip to content

Commit 4745875

Browse files
ferraraferFilledStacks
authored andcommitted
Add create widget command section on CLI page
1 parent dca220a commit 4745875

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

docs/tooling/stacked-cli.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To get started, install the `stacked_cli` package on your machine:
1818
dart pub global activate stacked_cli
1919
```
2020

21-
### Creating a App
21+
### Creating a new App
2222

2323
To create your first Stacked app, all you need to do is run:
2424

@@ -41,7 +41,7 @@ The following `arguments` are available on create app command:
4141
| --platforms | | The platforms supported by this project. Platform folders will be generated in the target project. Allowed: ios, android, windows, linux, macos, web |
4242
| --line-length | -l | When a number is provided, it will be used as the line length for formatting code. |
4343

44-
### Add a New View
44+
### Add a new View
4545

4646
From the root folder of your Stacked application, run the command:
4747

@@ -62,7 +62,7 @@ The following `arguments` are available on create view command:
6262
| --config-path | -c | Sets the file path for the custom config. |
6363
| --line-length | -l | When a number is provided, it will be used as the line length for formatting code. |
6464

65-
### Add a New Service
65+
### Add a new Service
6666

6767
From the root folder of your Stacked application, run the command:
6868

@@ -82,7 +82,7 @@ The following `arguments` are available on create service command:
8282
| --config-path | -c | Sets the file path for the custom config. |
8383
| --line-length | -l | When a number is provided, it will be used as the line length for formatting code. |
8484

85-
### Add a New Bottom Sheet
85+
### Add a new Bottom Sheet
8686

8787
From the root folder of your Stacked application, run the command:
8888

@@ -103,7 +103,7 @@ The following `arguments` are available on create bottom_sheet command:
103103
| --config-path | -c | Sets the file path for the custom config. |
104104
| --line-length | -l | When a number is provided, it will be used as the line length for formatting code. |
105105

106-
### Add a New Dialog
106+
### Add a new Dialog
107107

108108
From the root folder of your Stacked application, run the command:
109109

@@ -124,6 +124,27 @@ The following `arguments` are available on create dialog command:
124124
| --config-path | -c | Sets the file path for the custom config. |
125125
| --line-length | -l | When a number is provided, it will be used as the line length for formatting code. |
126126

127+
### Add a new Widget
128+
129+
From the root folder of your Stacked application, run the command:
130+
131+
```shell
132+
stacked create widget users_list
133+
```
134+
135+
This will create a new Widget called `UsersList` with its associated WidgetModel called `UsersListModel` in the `ui/widgets/common/users_list` folder. This will also create the WidgetModel test file inside `test/widget_models/`.
136+
137+
The following `arguments` are available on create view command:
138+
139+
| Argument | Alias | Description |
140+
| ------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------- |
141+
| --help | -h | Prints this usage information. |
142+
| --[no-]model | | When model is provided, StackedView will be used instead of StatelessWidget and a Model will be created. |
143+
| --template | -t | Selects the type of widget to create instead of the default empty widget. |
144+
| --config-path | -c | Sets the file path for the custom config. |
145+
| --path | -p | Sets the path for the component. |
146+
| --line-length | -l | When a number is provided, it will be used as the line length for formatting code. |
147+
127148
### Generate Code
128149

129150
When you've changed something manually, or added a new model, instead of executing the command `flutter pub run build_runner build --delete-conflicting-outputs` you can simply run `stacked generate`.

0 commit comments

Comments
 (0)