Flutter:Google 图标未出现

Moh*_*iem 5 icons android flutter flutter-dependencies flutter-layout

我创建了一个 flutter 项目,当我尝试使用它添加图标时,即使在 pubspec 中icons.[icon here]也没有显示uses-material-design: true

Code of Icon

import 'package:flutter/material.dart';
import 'package:search_choices/search_choices.dart';

class DonateFood extends StatefulWidget {
  const DonateFood({Key? key}) : super(key: key);

  @override
  _DonorOtherState createState() => _DonorOtherState();
}

class _DonorOtherState extends State<DonateFood> {
  @override
  Widget build(BuildContext context) {
    String dropdownValue = 'Food Type';
    return Scaffold(
      body: Container(
        child: const Center(
          child: Icon(
            Icons.six_mp_sharp,
            size: 100,
          ),
        ),
      ),
    );
  }
}

Run Code Online (Sandbox Code Playgroud)

在此输入图像描述 Pubspec.yaml

name: feedme
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# 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.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  firebase_core: "^1.10.0"
  firebase_performance: "^0.7.1"
  firebase_database: ^7.2.1
  firebase_auth: ^3.0.1
  font_awesome_flutter: ^9.1.0
  flutter_facebook_auth: ^3.5.0+1
  google_sign_in: ^5.0.0
  cloud_firestore: ^2.4.0
  google_fonts: ^2.1.0
  flutter_neumorphic: ^3.1.0
  auto_size_text: ^3.0.0-nullsafety.0
  splashscreen: ^1.3.5
  flutter_google_places: ^0.3.0
  places_service: ^0.1.0+2
  provider: ^6.0.1
  http: ^0.13.3
  geolocator: ^7.7.1
  google_maps_flutter: ^2.0.9
  top_snackbar_flutter: ^1.0.2
  firebase_storage: ^10.1.0
  search_choices: ^2.0.14




dev_dependencies:
  flutter_test:
    sdk: flutter

  lint: ^1.0.0


# 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: rHeavy
      fonts:
        - asset: Fonts/SF-Pro-Rounded-Heavy.otf
    - family: rRegular
      fonts:
        - asset: Fonts/SF-Pro-Rounded-Regular.otf
    - family: rBold
      fonts:
        - asset: Fonts/SF-Pro-Rounded-Bold.otf
    - family: rLight
      fonts:
        - asset: Fonts/SF-Pro-Rounded-Light.otf
    - family: rSemibold
      fonts:
        - asset: Fonts/SF-Pro-Rounded-Semibold.otf
    - family: tMedium
      fonts:
        - asset: Fonts/SF-Pro-Text-Medium.otf
    - family: tSemibold
      fonts:
        - asset: Fonts/SF-Pro-Text-Semibold.otf
    - family: tRegular
      fonts:
        - asset: Fonts/SF-Pro-Text-Regular.otf
    - family: dMedium
      fonts:
        - asset: Fonts/SF-Pro-Display-Medium.otf

  assets:
    - Images/
Run Code Online (Sandbox Code Playgroud)