From 7446df2922c123120b968dcc3f532117bb72d5c8 Mon Sep 17 00:00:00 2001 From: Jiin Kim <57239105+jiin-kim109@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:35:07 -0400 Subject: [PATCH] Flutter web hot restart (#105) * docs: add a wiki for troubleshooting flutter web hot restart issue in the cloud ide * fix: multiline code blocks --------- Co-authored-by: Bradley Steinfeld --- docs/labs/flutter-web-hot-restart.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/labs/flutter-web-hot-restart.md b/docs/labs/flutter-web-hot-restart.md index 06b3f26..bdcfbfa 100644 --- a/docs/labs/flutter-web-hot-restart.md +++ b/docs/labs/flutter-web-hot-restart.md @@ -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" @@ -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. @@ -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.