Skip to content

Commit 4815439

Browse files
authored
update CONTRIBUTING.md (#2104)
1 parent 4ff25a0 commit 4815439

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,42 @@ If you have Microsoft Edge installed and want to use it for debugging Flutter ap
119119
# Flutter
120120
export CHROME_EXECUTABLE="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
121121
```
122+
If you added these through the terminal, close that terminal session and create a new one.
123+
124+
### Building the Flutter client
125+
Open an instance of your IDE (preferably VS Code) at the `flet-dev/flet/client` directory.
126+
127+
First, run `printenv | grep FLET` in the built-in terminal to make sure everything is set. You should see the above environment variables you set (`FLET_VIEW_PATH`, `FLET_WEB_PATH`) printed out.
128+
129+
- To build the Flutter client for MacOS, run:
130+
```
131+
flutter build macos
132+
```
133+
When the build is complete, you should see the Flet.app bundle in `client/build/macos/Build/Products/Release`. (Running it will open a blank window.)
134+
- To build the Flutter client for Web, run the below command:
135+
```
136+
flutter build web
137+
```
138+
When the build is complete, a directory `client/build/web` will be created.
139+
140+
### Running the Flutter client
141+
Now open another instance of VS Code at `flet-dev/flet/sdk/python` directory.
142+
143+
Create a new folder preferably named `playground` (it has been added to the gitignore) in which you will test your additions.
144+
145+
Try running the below command, where `<your-main.py>` is the file to test your additions:
146+
147+
```bash
148+
poetry run flet run -w -p 8550 playground/<your-main.py>
149+
```
150+
You should see http://127.0.0.1:8550/ opened in the browser and also a desktop window with the output of your code.
151+
Making changes to the `<your-main.py>` will automatically trigger a hot reload.
152+
153+
Now, switch to your flutter vscode instance and run the below command to start/connect the flet client:
154+
```bash
155+
flutter run
156+
```
157+
then choose your device from the shown options.
158+
You will be able to see the debugging outputs of the flet client in this terminal.
159+
160+
**Note** that if you make changes to the dart files, you will need to recompile/rebuild the Flutter client (with `flutter run` as above) for the changes to take effect in your playground.

0 commit comments

Comments
 (0)