![]() ? Please specify a unique project id (warning: cannot be modified afterward) : I If you want to create a project in a Google Cloud organization or folder, please use "firebase projects:create" instead, and return to this command when you've created the project. ? Please select an option: Create a new project You can create multiple project aliases by running firebase use -add,īut for now we'll just set up a default project. You're about to initialize a Firebase project in this directory:įirst, let's associate this project directory with a Firebase project. ![]() Polinach-macbookpro3:my_app1 polinach$ firebase init hosting My commands: polinach-macbookpro3:my_app1 polinach$ flutter build webĬompiling lib/main.dart for the Web. All steps go smooth, however instead of my application I see this screen. The example file I'll show you is valid as of today (July 2021) but it should stay within the same idea.Īdd an ++code>apple-app-site-association++/code> in the ++code>web/.well-known/++/code> folder.I am following the steps to host my flutter helloworld application. What I had to learn the hard way is that Apple outdated documentation is still living on the Apple website alongside the new documentation. Now we want to add the ++code>apple-app-site-association++/code> file in order to mutualize all the links to the same domain! ++pre>++code data-line-start="53" data-line-end="55">firebase deploy -only hosting ++/code>++/pre> Add the apple-app-site-association file Once it's done, you can run the ++code>firebase deploy++/code> command to deploy your Website: ++pre>++code data-line-start="45" data-line-end="49">? What do you want to use as your public directory? (public) build/web ? Configure as a single-page app (rewrite all urls to /index.html)? (y/N) y ? Set up automatic builds and deploys with GitHub? (y/N) N ++/code>++/pre> You can then select or create a Firebase project and choose these options: ![]() ++pre>++code data-line-start="35" data-line-end="37">firebase init ++/code>++/pre>Ĭommand and select the ++code>Hosting++/code> key by pressing space. If everything is successful you'll have a folder ++code>web++/code> in the ++code>build++/code> folder! Deploy to Firebase Hostingįor this second step, you need to activate Firebase Hosting directly on the Firebase console. Once everything is updated to support Flutter Web, you can run this command: You only need to go through each package of your ++code>pubspec.yaml++/code> file and check if the package is compatible for the web or add the correct ++code>kIsWeb++/code> condition. It will then be a matter of updating your packaging or following specific web instructions.įor instance, an app with more than 25 packages took only 30 minutes to migrate to Flutter Web. ++pre>++code data-line-start="15" data-line-end="17">flutter create. To add web support to an existing you can run this command in your project folder with Flutter 2: This file is needed to provide Universal Link on iOS.Īt the end of the article you will be able to deep link into iOS without needing a custom scheme thanks to Firebase Hosting! Compile the app for the Webįirstly, you need to add the Web support to your app. I decided to write a small article in order to share my finding about how to host a Flutter Web app and an ++code>apple-app-site-association++/code> file on the same Firebase hosting deploy. ![]() Since Flutter 2.0, It has been fairly simple to add Web support to an existing app. Recently, I needed to deploy a Flutter app directly on the Web. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |