GithubHelp home page GithubHelp logo

stepanic / flutterflow-socket Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 8.81 MB

Hot Reload of Flutter app after Push to repository at FlutterFlow

License: MIT License

Shell 55.39% JavaScript 44.61%

flutterflow-socket's Introduction

flutterflow-socket

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 :)

Donate

Demo

demo

1. Installation

  1. position to your FlutterFlow project in terminal cd /path/to/your/ff/project
  2. copy directory ./tools and scripts ./run and ./watch from this repository to your existing FlutterFlow app with this command
curl -sSL https://raw.githubusercontent.com/stepanic/flutterflow-socket/main/installer.sh | sh

Installation

  1. follow the Setup instructions

2. Setup

  1. install entr (for MacOS brew install entr) brew install entr
  2. copy Webhook Proxy URL from installation output or read it from the GITHUB_WEBHOOK_URL variable in ./watch script
  3. OPTIONAL: change GITHUB_WEBHOOK_SECRET at ./watch or leave it to default ff-my-github-webhook-secret setup ENV variables
  4. add a new Webhook at GitHub https://github.com/<ORG_ID|USERNAME>/<REPO_ID>/settings/hooks/new
  • Payload URL = Webhook Proxy URL from 2nd step
  • Content type = application/json
  • Secret = GITHUB_WEBHOOK_SECRET from ./watch new webhook at github

3. Usage

  1. get a <DEVICE_ID> with flutter devices
  2. run the Flutter app on the device with ./run <DEVICE_ID> run 000
  3. open another terminal window/tab and watch for local and remote changes with ./watch watch
  4. make some changes in the FlutterFlow project and click to Push to Repository Push to Repository Pushed to Repository Reloaded on device
  5. repeat 4th step multiple times :))

Example

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.

How it works

  1. Flutter app should be run with --pid-file
  1. ./watch script internally is calling ./tools/hotreloader.sh which is sending a signal to Flutter process(es)
  1. ./watch script internally starts background Node.js process ./tools/github/listen which is listening for new GitHub commits from Webhook via smee.io channel
  1. ./tools/github/listen Node.js script internally is calling ./tools/sync for automatic pulling the newest commits from flutterflow branch and merge them to the currently active branch

Advanced

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

Buy me a coffee :))

If this project help you reduce time to develop, you can give me a cup of coffee :)

Donate

Author

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

flutterflow-socket's People

Contributors

stepanic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.