Jane Doe
Pro Plan
flutter create system_design_deploy_flutter_netlifycd system_design_deploy_flutter_netlifygit initgit add .git commit -m "Initial commit"system_design_deploy_flutter_netlifygit remote add origin git@github.com:PrimeTimeTran/system_design_deploy_flutter_netlify.gitgit branch -M maingit push -u origin mainsystem_design_deploy_flutter_netlifyif cd flutter; then git pull && cd ..; else git clone https://github.com/flutter/flutter.git; fi && flutter/bin/flutter config --enable-web && flutter/bin/flutter build web --releasebuild/web
Deploying Flutter to Netlify can be trickier than other frameworks due to Netlify not having Flutter installed on each of their server instances.
We can get around this issue by checking for flutter's installation in our build command.
if cd flutter; then git pull && cd ..; else git clone https://github.com/flutter/flutter.git; fi && flutter/bin/flutter config --enable-web && flutter/bin/flutter build web --releaseIf the host system, the machine about to run the build command, doesn't have Flutter installed then install it before creating a web build of the Flutter app.