Automatic Hot Reload of Flutter app after Push to repository at FlutterFlow without any manual source pull and app reload, because every development second matter!
If this project help you reduce time to develop, you can give me a cup of coffee :)
- position to your FlutterFlow project in terminal
cd /path/to/your/ff/project - copy directory
./toolsand scripts./runand./watchfrom this repository to your existing FlutterFlow app with this command
curl -sSL https://raw.githubusercontent.com/stepanic/flutterflow-socket/main/installer.sh | sh
- follow the
Setupinstructions
- install
entr(for MacOSbrew install entr)
- copy
Webhook Proxy URLfrom installation output or read it from theGITHUB_WEBHOOK_URLvariable in./watchscript - OPTIONAL: change
GITHUB_WEBHOOK_SECRETat./watchor leave it to defaultff-my-github-webhook-secret
- add a new Webhook at GitHub
https://github.com/<ORG_ID|USERNAME>/<REPO_ID>/settings/hooks/new
Payload URL=Webhook Proxy URLfrom 2nd stepContent type=application/jsonSecret=GITHUB_WEBHOOK_SECRETfrom./watch
- get a
<DEVICE_ID>withflutter devices - run the Flutter app on the device with
./run <DEVICE_ID>
- open another terminal window/tab and watch for local and remote changes with
./watch
- make some changes in the FlutterFlow project and click to
Push to Repository

- repeat 4th step multiple times :))
If you want to try how it works before installation at your project then clone this repository https://github.com/stepanic/flutterflow-socket-example and in one terminal execute ./run <DEVICE_ID> and ./watch in another.
- Flutter app should be run with
--pid-file
./watchscript internally is calling./tools/hotreloader.shwhich is sending a signal to Flutter process(es)
- look at https://github.com/stepanic/flutterflow-socket/blob/main/watch#L25-L30
- and https://github.com/stepanic/flutterflow-socket/blob/main/tools/hotreloader.sh
- inspired by https://medium.com/@kikap/how-to-automatically-hot-reload-flutter-when-dart-source-files-change-6e8fdb523004
./watchscript internally starts background Node.js process./tools/github/listenwhich is listening for new GitHub commits from Webhook via smee.io channel
./tools/github/listenNode.js script internally is calling./tools/syncfor automatic pulling the newest commits fromflutterflowbranch and merge them to the currently active branch
When adding widgets in FlutterFlow which is changing dependencies in the pubspac.yaml or there are modification at Firestore schema or app icon is changed then add DEEP to the commit message before pushing to the repository. For more details please check this https://github.com/stepanic/flutterflow-socket/blob/main/tools/sync#L14-L20
If this project help you reduce time to develop, you can give me a cup of coffee :)
Please find the the tool author at https://experts.flutterflow.io/, and check references at https://www.toptal.com/resume/matija-stepanic/N8zLEO/worlds-top-talent


