Skip to content

Commit

Permalink
Flutter web hot restart (#105)
Browse files Browse the repository at this point in the history
* docs: add a wiki for troubleshooting flutter web hot restart issue in the cloud ide

* fix: multiline code blocks

---------

Co-authored-by: Bradley Steinfeld <bradley@steinfeld.ca>
  • Loading branch information
jiin-kim109 and bsteinfeld authored Oct 11, 2024
1 parent 4b4fcfc commit 7446df2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/labs/flutter-web-hot-restart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ To overcome this limitation, you can use the following bash script to monitor fi
1. **Copy and Paste the Bash Script**
Copy the following script into a file (for example, `hot_reload.sh`).

`#!/bin/bash
```
#!/bin/bash
# Path to your Flutter project directory
PROJECT_DIR="/home/project/hello_world_web/lib"
Expand Down Expand Up @@ -66,7 +67,8 @@ To overcome this limitation, you can use the following bash script to monitor fi
start_server
# Start watching for changes
watch_and_reload`
watch_and_reload
```

2. **Set the Correct Project Directory**
In the script, make sure to update the line that sets `PROJECT_DIR` to point to your Flutter project directory.
Expand All @@ -76,8 +78,10 @@ To overcome this limitation, you can use the following bash script to monitor fi
3. **Run the Script**
After saving the script, give it execute permissions and run it:

`chmod +x hot_reload.sh
./hot_reload.sh`
```
chmod +x hot_reload.sh
./hot_reload.sh
```

The script will start the Flutter web server, and any time you modify a file in your project, it will detect the change, rebuild the project, and restart the server automatically.

Expand Down

0 comments on commit 7446df2

Please sign in to comment.