flutter-web

How to host Flutter Web (Hummingbird) on Firebase Hosting

房东的猫 提交于 2019-12-30 07:24:12
问题 I created a flutter web project and work fine in localhost. So I planned to host the website in firebase. I followed the commands it deployed successfully but it shows only black screen in the console it shows error message. Error : Loading failed for the with source “https://myportfolioflutterweb.firebaseapp.com/web/main.dart.js”. SyntaxError: expected expression, got '<'[Learn More] My Project Structure : firebase.json : { "hosting": { "public": "public", "ignore": [ "firebase.json", "**/.*

How do I link http url to flutter-web

感情迁移 提交于 2019-12-24 03:42:44
问题 I'm learning flutter web. I'm trying to open another url when button is clicked. Is there any way like this: onclick: ()=>openurl("https://test.com") How can I achieve this? Please help 回答1: Current easiest way to do it is by using href with your html library: import 'dart:html' as html; html.window.location.href = "https://www.google.com" // or any website your want Put that code inside your onTap method and that's it. 回答2: Flutter Web does not support plugins (yet), so you have to use

Is there a number input field in flutter with increment/decrement buttons attached to the field?

萝らか妹 提交于 2019-12-11 10:15:55
问题 I am trying to create a number input field with and up and down arrow button to increment and decrement its value. I am wondering if there is any inbuilt widget which already provides this functionality. I have to create couple of such fields in my UI and creating so many stateful widgets makes me wonder if there is any simpler approach. import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget {

failed to create local server ( address already in use ) when trying to serve flutter_web project

拟墨画扇 提交于 2019-12-10 22:25:58
问题 i tried launch the flutter web project locally by this terminal command webdev serve --auto restart but i got the following error message Starting resource servers...Unhandled exception: SocketException: Failed to create server socket (OS Error: Address already in use, errno = 48), address = 127.0.0.1, port = 8080 #0 _NativeSocket.bind (dart:io-patch/socket_patch.dart:591:7) <asynchronous suspension> #1 _RawServerSocket.bind (dart:io-patch/socket_patch.dart:1206:26) #2 _ServerSocket.bind

Error when adding provider package to flutter web project

天涯浪子 提交于 2019-12-10 15:07:52
问题 I tried to add the provider package to my flutter web project and got the following error: Because every version of provider depends on flutter any from sdk which is >forbidden, provider is forbidden. So, because WebApplication depends on provider ^3.0.0, version solving >failed. Flutter users should run flutter packages get instead of pub get . Process finished with exit code 69 I tried flutter packages get and also upgraded flutter to the newest version. When running flutter packages get

Why my flutter web app does not run upon running webdev serve

喜夏-厌秋 提交于 2019-12-10 12:15:55
问题 enter image description hereI've build my flutter web app and when I run webdev serve I've got this error message webdev could not run for this project. Could not find a file named "pubspec.yaml" in "C:\Users\Karrar\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\protobuf-0.13.12". How to fix this problem? 回答1: It is answered here https://github.com/flutter/flutter/issues/32313 You have two options: use longer command instead: flutter packages pub global run webdev serve or add protobuf: ^0

How to use cloud_firestore in flutter for web and android?

☆樱花仙子☆ 提交于 2019-12-09 12:58:11
问题 I have a Flutter app which works on Android as expected but if I want to compile it for Web I get an error. It has to do something with the dependency cloud_firestore. If I use the dependency firebase it works fine on the web but on android now not.. This is the error message I get using cloud_firestore (compiling for web): Skipping compiling pay_balance|lib/main_web_entrypoint.dart with ddc because some of its transitive libraries have sdk dependencies that not supported on this platform:

make responsive web on flutter web

匆匆过客 提交于 2019-12-08 23:01:37
I'm making an form login with web flutter, but it's still not responsive ... when I try to add the SingleChildScrollView widget, so that when it runs on the mobile browser it can scroll. but the display form on the laptop float to the top my code looks like this Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.indigo[100], body: SingleChildScrollView( child: Container( child: Form( key: formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Center( child: Card() //I'm sorry the code

How to use cloud firestore in Flutter web app

孤街浪徒 提交于 2019-12-08 05:32:10
问题 I am creating a flutter web app ,I want to connect my flutter web project with cloud firestore, is there any to connect my project to cloud firestore I have try import cloud_firestore: ^0.12.5+2 in pubspec.yaml. Because op depends on cloud_firestore >=0.3.0 which requires the Flutter SDK, version solving failed. 回答1: The FlutterFire plugin that you found only targets iOS or Android. If you're targeting the web, use the firebase-dart plugin. Also see a similar answer I gave yesterday here: Is

make responsive web on flutter web

大兔子大兔子 提交于 2019-12-08 05:27:14
问题 I'm making an form login with web flutter, but it's still not responsive ... when I try to add the SingleChildScrollView widget, so that when it runs on the mobile browser it can scroll. but the display form on the laptop float to the top my code looks like this Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.indigo[100], body: SingleChildScrollView( child: Container( child: Form( key: formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.center,