简体   繁体   English

用于移动和Web应用程序的flutter 1.9 yaml文件?

[英]flutter 1.9 yaml file for mobile and web app?

My flutter app runs fine on android and now I'm trying to build it as a web app. 我的flutter应用程序在android上运行良好,现在我正尝试将其构建为网络应用程序。 I followed the directions on flutter.dev , but am getting the following errors: 我按照flutter.dev上的指示进行操作 ,但出现以下错误:

Skipping compiling myapp|lib/main_web_entrypoint.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:

firebase_core|lib/firebase_core.dart
myapp|lib/pages/home.dart
myapp|lib/pages/upload.dart
platform|lib/src/interface/local_platform.dart
google_api_availability|lib/src/google_api_availability.dart
location_permissions|lib/src/location_permissions.dart
firebase_storage|lib/firebase_storage.dart
image_picker|lib/image_picker.dart
flutter_svg|lib/svg.dart
flutter_svg|lib/src/utilities/http.dart
flutter_svg|lib/src/picture_provider.dart
cached_network_image|lib/src/cached_network_image_provider.dart
flutter_cache_manager|lib/src/cache_store.dart
flutter_cache_manager|lib/src/web_helper.dart
flutter_cache_manager|lib/src/file_info.dart
flutter_cache_manager|lib/src/cache_manager.dart
sqflite|lib/src/factory_mixin.dart
sqflite|lib/src/factory_impl.dart
path_provider|lib/path_provider.dart

https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings

I followed the link at the bottom and tried to apply what it said to my yaml file with no avail (I'm barely yaml literate). 我点击了底部的链接,并尝试将其内容应用到我的yaml文件中,但毫无用处(我几乎没有yaml识字能力)。 Any suggestions would be appreciated! 任何建议,将不胜感激! Below is my yaml file. 以下是我的yaml文件。

name: myapp
description: A new Flutter project.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: ^0.9.7+2
  image_picker: ^0.6.0+2
  firebase_storage: ^2.1.0+1
  firebase_auth: ^0.8.3
  google_sign_in: ^4.0.1+1
  geolocator: 5.0.1
  uuid: ^2.0.0
  image: ^2.0.7
  animator: 0.1.4
  cupertino_icons: ^0.1.2
  path_provider: ^0.5.0+1
  firebase_messaging: ^4.0.0+1
  timeago: 2.0.17
  cached_network_image:
  flutter_svg:

dev_dependencies:
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:
  uses-material-design: true
  fonts:
    - family: Signatra
      fonts:
        - asset: assets/fonts/Signatra.ttf
  assets:
    - assets/images/google_signin_button.png
    - assets/images/upload.svg
    - assets/images/search.svg
    - assets/images/activity_feed.svg
    - assets/images/no_content.svg

I think some of the packages may not be web-aware. 我认为某些软件包可能不支持网络。 So for instance image_picker is in your list and I can't see how that could work properly in a browser. 因此,例如image_picker在您的列表中,我看不到它如何在浏览器中正常工作。 You might be best commenting them all out and adding them one at a time. 您最好将它们全部注释掉,并一次添加一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM