

I am a long time vercel user for my Next.js projects. But I personally like Cloudflare pages more. Vercel and Netlify are one of those great option you can go with. If you want to host your flutter web application, then there are many services you can find. Cloudflare is automatically initialized the environment and deploy your project in their global network of CDNs.Ĭheck out this article to know more about configure Cloudflare pages for static sites.
#Deploying flutter web app install#
To install peanut package : flutter pub global activate peanutīuild your project and save the output in production branch : flutter pub global run peanut -b production

But we can use this functionality to host our site to any of the static hosting service provider. Initially, it is created to work with GitHub pages. Thus, we can set the release branch as a production branch at the server. This package build our web project and push the output in a separate branch. To serve the release build of our flutter app, and to make our life easier, we use a package called Peanut. This command build your flutter project and populate the released version of your app inside the build/web directory inside your project directory. Inside your project root folder, type flutter build web The building of a flutter web project is fairly simple. Now you can also watch this video instead of reading this whole article to get a live demonstration of the deployment. It is suitable for web apps, but if you want to optimize your app for SEO, then flutter is not an ideal option to choose from. When you're finished writing your app in dart, flutter will compile your dart code into JavaScript using dart2js and inject it inside an HTML page.įlutter uses canvas to display its content in the web. Now you can compile your dart code to run on the web with the help of flutter web.
#Deploying flutter web app how to#
How to deploy flutter web app to Cloudflare pagesįlutter web is the web implementation of flutter framework.
