Flutter 中的 Ionicons 包在构建期间显示此警告 - 期望找到 (packages/Ionicons/Ionicons, MaterialIcons) 的字体

Vas*_*oni 5 dart material-design ionicons flutter

我在我的 flutter 应用程序中使用 Ionicons pagckage 作为图标。但是当执行 flutter build appbundle 时,它​​向我显示这个错误 -

Expected to find fonts for (packages/Ionicons/Ionicons, MaterialIcons), but found (MaterialIcons). This usually means you are referring to font families in an IconData class but not including them in the assets section of your pubspec.yaml, are missing the package that would include them, or are missing "uses-material-design: true".
Run Code Online (Sandbox Code Playgroud)

我已经写uses-material-design: true在我的 pubspec.yaml 中了。这是我的 pubspec.yaml 文件 -

name: my_app_name
description: A new Flutter project.

publish_to: 'none'

version: 0.0.9+9

environment:
  sdk: '>=2.18.1 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  uuid: ^3.0.6
  intl: ^0.17.0
  timeago: ^3.3.0
  pinput: ^2.2.16
  confetti: ^0.7.0
  location: ^4.4.0
  latlong2: ^0.8.1
  ionicons: ^0.2.1
  provider: ^6.0.3
  geocoding: ^2.0.5
  share_plus: ^6.0.1
  flutter_map: ^3.0.0
  photo_view: ^0.14.0
  flutter_svg: ^1.1.6
  url_launcher: ^6.1.7
  firebase_auth: ^4.1.1
  firebase_core: ^2.1.1
  in_app_review: ^2.0.6
  path_provider: ^2.0.11
  image_picker: ^0.8.5+3
  auto_size_text: ^3.0.0
  google_sign_in: ^5.4.2
  webview_flutter: ^3.0.4
  carousel_slider: ^4.1.1
  flutter_spinkit: ^5.1.0
  cloud_firestore: ^4.0.4
  dropdown_button2: ^1.8.2
  email_validator: ^2.1.17
  device_info_plus: ^8.0.0
  connectivity_plus: ^3.0.2
  purchases_flutter: ^4.3.2
  firebase_storage: ^11.0.4
  firebase_messaging: ^14.0.4
  permission_handler: ^10.2.0
  flutter_email_sender: ^5.2.0
  firebase_app_check: ^0.1.1+3
  cached_network_image: ^3.2.2
  firebase_ui_firestore: ^1.0.4
  flutter_native_splash: ^2.2.11
  flutter_local_notifications: ^12.0.3
  internet_connection_checker: ^1.0.0+1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0

flutter_native_splash:
  color: "#02b866"
  image: assets/play_store_512.png
  color_dark: "#02b866"
  image_dark: assets/play_store_512.png
  android: true
  ios: true

flutter:
  uses-material-design: true
  fonts:
    - family: SFProDisplay
      fonts:
        - asset: assets/SF-Pro-Display-Black.otf
          weight: 900
        - asset: assets/SF-Pro-Display-Bold.otf
          weight: 800
        - asset: assets/SF-Pro-Display-Heavy.otf
          weight: 700
        - asset: assets/SF-Pro-Display-Light.otf
          weight: 600
        - asset: assets/SF-Pro-Display-Medium.otf
          weight: 500
        - asset: assets/SF-Pro-Display-Semibold.otf
          weight: 400
        - asset: assets/SF-Pro-Display-Regular.otf
          weight: 300

  assets:
    - assets/no-network.png

Run Code Online (Sandbox Code Playgroud)

我不知道如何解决这个问题。任何帮助,将不胜感激。

Loo*_*oii 0

升级0.2.2为我解决了这个问题。检查这个线程