Flutter project deployment on vercel

1,038

You can change your Vercel project settings to build and deploy a Flutter Web project.

Build & Development Settings

  • Framework Preset: Other
  • Build Command: flutter/bin/flutter build web --release
  • Output Directory: build/web
  • Install Command: if cd flutter; then git pull && cd .. ; else git clone https://github.com/flutter/flutter.git; fi && ls && flutter/bin/flutter doctor && flutter/bin/flutter clean && flutter/bin/flutter config --enable-web

Screenshot of Vercel Build Settings for Flutter

Example build log showing a successful Flutter deploy

Screenshot of Vercel Build Log for Flutter

Share:
1,038
Usman Sahi
Author by

Usman Sahi

Updated on December 30, 2022

Comments

  • Usman Sahi
    Usman Sahi over 1 year

    I've deployed flutter project on vercel from github, but after deployment it shows:

    404: NOT_FOUND Code: NOT_FOUND.
    Framework presets: Others

    Build log:

    15:28:18.542 Cloning github.com/Usman167/UPKeepApp-FluxStore- (Branch: master, Commit: e331f69) 15:28:20.977 Cloning completed: 2.435s
    15:28:21.169 Analyzing source code...
    15:28:26.899 Uploading build outputs...
    15:28:26.913 Deploying build outputs...
    15:28:33.974 Done with "."

    enter image description here

  • Usman Sahi
    Usman Sahi almost 3 years
    Bro can You guide me about flutter Mobile app project.
  • lava
    lava almost 3 years
    I think you want to host your flutter project as website in vercel.isn't it?.
  • Usman Sahi
    Usman Sahi almost 3 years
    bro actually i'm using stripe payment gateway in my flutter mobile app. For that i've deployed it on vercel. but it shows this error.
  • lava
    lava almost 3 years
  • lava
    lava almost 3 years
  • Pumuckelo
    Pumuckelo over 2 years
    Do you know how I can checkout a specific version of flutter? Because wtih some versions the build is failing due to null safety not working(enforced??) e.G. if I want to use flutter version 2.2.3
  • Pumuckelo
    Pumuckelo over 2 years
    Solution: you can just use "git checkout 2.2.3" to use a specific version. Example of my bash script: #!/bin/bash if cd flutter; then git pull && cd .. ; else git clone https://github.com/flutter/flutter.git -b stable; fi && ls && cd flutter && git checkout 2.2.3 && cd .. && flutter/bin/flutter doctor && flutter/bin/flutter clean && flutter/bin/flutter pub get