flutter-web

Flutter Web : How to run javascript using dart js

淺唱寂寞╮ 提交于 2021-02-19 06:29:05
问题 I want to use the Stripe library on the web flutter. But unfortunately, until now there is still no stripe library available for web flutter. Therefore I try to run javascript on the web flutter, where it will call the stripe-js library (https://stripe.com/docs/js/payment_intents/confirm_card_payment). What I want to ask, first, is how to use the javascript library on web flutter? like this : <script src = "https://js.stripe.com/v3/"> </script> Secondly, how do I call the javascript function

Flutter web can't load network image from another domain

自古美人都是妖i 提交于 2021-02-19 04:13:51
问题 I can't load network images in flutter web from other domains with API calls. getting this error Trying to load an image from another domain? Find answers at: https://flutter.dev/docs/development/platform-integration/web-images ImageCodecException: Failed to load network image. any help? 回答1: For being able to display your images from Firebase Storage on a Flutter web page you have to configure your data for CORS. Open the GCP console, select your project and start a cloud terminal session by

Stop saving in cache memory Flutter web Firebase hosting

江枫思渺然 提交于 2021-02-19 02:47:13
问题 I designed a web app using the Flutter web. I hosted it with Firebase host. But It's not showing changes of my code after deploying to firebase. It's still showing my older version of web app. But I can overcome this problem by clearing cache memory of browser or ctrl+refresh . But I don't want to do this every time I deploy to firebase. How to stop saving my web app in cache memory? hosted link: https://frcovid19dashboard.web.app 回答1: Append a version number to your main.dart file. Every

How to configure go back button in Browser for Flutter Web App

跟風遠走 提交于 2021-02-18 22:55:27
问题 I'm not asking about webview. This is about Flutter web app. I need to go back to a specific page when user press back button which is inbuilt in browser. Any guessing ? I'm getting this error when I press back button Error: Assertion failed: org-dartlang- sdk:///flutter_web_sdk/lib/_engine/engine/history.dart:110:14 _userProvidedRouteName != null is not true at Object.throw_ [as throw] (http://localhost:8300/dart_sdk.js:4770:11) at Object.assertFailed (http://localhost:8300/dart_sdk.js:4721

How can a named route have URL parameters in flutter web?

二次信任 提交于 2021-02-18 19:57:32
问题 I'm building a web-app which needs to have a route that gets a post ID and then it will fetch the post using the ID. How can I have URL arguments let's say /post/:id so id is the argument My app looks like that currently: class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( // title: "Paste", initialRoute: "/", theme: ThemeData( primarySwatch: Colors.green, primaryColor: Colors.blue ), routes: { "/": (context) => HomePage(), "/post":

How can a named route have URL parameters in flutter web?

ぐ巨炮叔叔 提交于 2021-02-18 19:57:31
问题 I'm building a web-app which needs to have a route that gets a post ID and then it will fetch the post using the ID. How can I have URL arguments let's say /post/:id so id is the argument My app looks like that currently: class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( // title: "Paste", initialRoute: "/", theme: ThemeData( primarySwatch: Colors.green, primaryColor: Colors.blue ), routes: { "/": (context) => HomePage(), "/post":

How to use Skia / CanvasKit in Flutter Web?

自闭症网瘾萝莉.ら 提交于 2021-02-18 05:33:32
问题 I know that Flutter supports using Skia instead of DomCanvas in Flutter Web using WASM CanvasKit, i.e. "Skia + WebAssembly". I have heard that this provides significant performance improvements, however, I do not know how to enable it. 回答1: You can enable CanvasKit / Skia in Flutter Web by supplying a Dart environment constant: flutter run -d chrome --dart-define=FLUTTER_WEB_USE_SKIA=true The flutter tools now have a good shortcut for it: flutter run -d chrome --web-renderer canvaskit The -

Private and public routers in Flutter

左心房为你撑大大i 提交于 2021-02-11 12:51:22
问题 I am new in Flutter and my task is to divide path into public and private. For solution, this I used the suggested advice from Dima Rostopira answered Jul 28 '20 at 8:29 in this topic My main problem is that instead of the shown in the example: MyAuth.isUserLoggedIn I need to use an asynchronous function: Auth().isAuth() but example solution does not work with an asynchronous function. Can someone help solve this problem? ConditionalRouter.dart class ConditionalRouter extends MapMixin<String,

Private and public routers in Flutter

戏子无情 提交于 2021-02-11 12:50:57
问题 I am new in Flutter and my task is to divide path into public and private. For solution, this I used the suggested advice from Dima Rostopira answered Jul 28 '20 at 8:29 in this topic My main problem is that instead of the shown in the example: MyAuth.isUserLoggedIn I need to use an asynchronous function: Auth().isAuth() but example solution does not work with an asynchronous function. Can someone help solve this problem? ConditionalRouter.dart class ConditionalRouter extends MapMixin<String,

Running flutter web app locally without android studio

岁酱吖の 提交于 2021-02-11 12:31:54
问题 I have a flutter app using Firebase's cloud firestore. I've done the web build and running it on Chrome through Android Studio works well. I would like to share my web app progress to my client but don't want to host it (because it's not finished yet). Hence I'd like to find a way to run it locally the same way you can do it with Android Studio but without needing to install Android Studio (and hopefully not requiring to install flutter either), so that I can send the build file to my client