how to migrate flutter existing app to web - flutter

I have designed a mobile application using flutter, I have seen that it is compatible with the web and I would like to know how to migrate my already designed application to the web environment, I know that I must take into account the compatibility with the dependencies that I have used and already reviewed.
At the moment I have carried out the following process, but all it does is create a folder with few elements that when executed, the browser opens with a blank page, the flutter logo and a blue appbar. What procedure am I missing?
flutter config --enable-web
flutter create.
flutter run -d chrome

Related

Build a Flutter Web App and run the same web app in Flutter Desktop programs

I am new to flutter programming. I want to create a flutter web app which can be run in web view in a Flutter desktop application for all desktop platforms (Linux, Windows and MacOS). The web-app will be running on the main thread. And desktop specific tasks will be run on an isolate. The web app will be the UI and would mainly be using cloud firestore and mostly be listening to document or collection changes and communicate the changed data back to the isolate.
Is the web-app on a Flutter Desktop application possible to do ? And will I be needing to "hosting" the web page to used in a web_view ?
And will I be able to communicate with the web-app from the isolate with the usual Isolate communications ?
I want to create a flutter web app which can be run in web view in a Flutter desktop application for all desktop platforms
Currently Flutter doesn't have desktop support for platform views, which means you can't have an inline webview. You could use a full-window webview with no Flutter UI, but then it's not clear what value you would get from having the desktop host be a Flutter application.
And will I be able to communicate with the web-app from the isolate with the usual Isolate communications ?
If you are expecting to be able to communicate directly between the isolate of the Flutter desktop host and the Flutter web application, no. You would be subject to all of the standard limitations of using a webview, which means any communication in or out would have to go through JavaScript. The fact that the host app is a Flutter app would be essentially invisible to the web app, and similarly in the other direction, because you would be running two completely unrelated instances of the Flutter engine and Dart VM (one compiled to native code and one compiled to JS).

How to deploy flutter example for the web?

https://pub.dev/packages/flutter_tex/example (want to run this code for Flutter Web)
Goal: Deploy flutter example on a simple web page for checking latex code output
Expected result: Simple web page where you type Latex on the left and it shows you rendered equations on the right
My experience: 1 day
Current installation: Flutter, Dart, Android Studio, Dart -> Able to "create new Flutter project"
What I have tried: Opened a new flutter project - pasted code in main.dart - did not work (no device device - need virtual device for web deployment?)
In order to run your Flutter project on the web, you must ensure that you have the latest version of Flutter (currently I am running v2.0.2). If you don't have the latest version, just run flutter upgrade in the terminal.
Secondly, you need to check whether the package that you are using also supports the web platform. You can check it by going into the "Scores" tab in the package.
Then, all you have to do is to run the command:
flutter run -d chrome
This will launch the flutter app in the Google chrome browser.

Create a flutter project without a web dependence

I want to create a new project in flutter using VS, but I want this project without the web dependence just a mobile app dependence but each time I create a project it gives me the dependence of the web, not a mobile app
For Example, this what I get:
This what I want
You can generate a flutter app for only mobile platforms with flutter create tool by specifying platforms.
flutter create <app_name> --platforms=android,ios
In the same way you enabled flutter web support, disable it.
flutter config --no-enable-web
This removes web support so that future created projects will not generate a web folder. You may need to restart any open editors for the changes to take place.

Why can't I run my Flutter app in a browser? Why isn't there a web folder?

(I did a presentation last night and had this question asked. Couldn't find it on SO so I thought I'd ask and answer it myself to help others out).
When running my flutter project, it is demanding an emulator be available but I want it to run in a browser. I noticed that there's an android folder and an ios folder but no web folder. How do I get it to run on the web?
You were on the wrong channel when you created the project. Flutter has multiple channels. To fix it, you'll go to the 'master' channel and add the web components.
Run these commands in your project folder:
$ flutter channel master
$ flutter config --enable-web
$ flutter create .
Don't worry; it doesn't clobber or remove anything when you flutter create .. It just adds the web capability. Now when you run, it'll recognize a browser as a valid environment.

I want to update the existing logo for my PWA app

When I am updating the logo of the PWA app the icon is not getting updated for the previously installed applications. However for newly installed apps I am getting the correct logo.
Did you try updating the new image icon in manifest.json & then showing a prompt to users to refresh the PWA?
You can try to have a look at the documentation for Android APK (from the question is not clear your target device: web or mobile).
Chrome will periodically compare the locally installed manifest against a copy of the manifest fetched from the network. If any of the properties in the manifest required to add the PWA to the home screen have changed in the network copy, Chrome will request an updated WebAPK, reflecting those new values.
This feature is not yet available for desktop, but planned in a future release.
Do you use any framework (Angular, React) to build your PWA? If you want to read more details about how to install an app on the homescreen or the web manifest properties, you can have a look here.