flutterfirebase

Run flutter deploy with entrypoint


I have a flutter project which has several entry points (main.dart classes), is there any way how to pass that to the flutter deploy command? Something like flutter deploy -t lib/main_test.dart or so.

From the official documentation https://docs.flutter.dev/deployment/web#before-you-begin (see last point 8) the flutter deploy automatically runs flutter build web --release, which in my case should be flutter build web -t lib/main_test.dart --release. Thank you in advance.


Solution

  • Faced this issue and resolved it by replacing "source": "." with "public": "build/web" under firebase.json that was generated from firebase init hosting. After that, run Flutter build command like how you did with flutter build web -t lib/main_test.dart --release which generates the app into the /build/web directory. Finally, run firebase deploy to deploy.