**コードを適切に生成するために凍結されたパッケージを作成するにはどうすればよいですか?
依存関係を変更し、より多くの方法を試しました例: キャッシュのクリア、メジャー バージョンのアップグレード..しかし、最良の場合、出力は次のようになります: 正常に実行された 0 出力 (3 または x アクション) x = 任意の数 **
pubspec.yaml
flutter:
sdk: flutter
freezed_annotation: ^0.12.0
cupertino_icons: ^1.0.2
analyzer: ^0.41.2
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: ^1.11.2
freezed: ^0.12.7
build_config: ^0.4.3
freezed_classes.dart
import 'package:freezed_annotation/freezed_annotation.dart';
part 'freezed_classes.freezed.dart';
@freezed
abstract class User with _$User{
const factory User({String name,int age}) = _User;
}
** flutter pub run build_runner watch --delete-conflicting-outputs **
PS D:\AppDevelopment\flutter\pics> flutter pub run build_runner watch --delete-conflicting-outputs
Failed to build build_runner:build_runner:
../flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:258:50: Error: The property 'displayString' is defined in multiple extensions for 'TargetKind' and neither is more specific.
- 'TargetKind' is from 'package:meta/meta_meta.dart' ('../flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart').
Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.
var kindNames = kinds.map((kind) => kind.displayString).toList()
^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:1950:14: Context: This is one of the extension members.
String get displayString {
^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart:91:14: Context: This is one of the extension members.
String get displayString {
^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:260:36: Error: The getter 'commaSeparatedWithOr' isn't defined for the class 'List<dynamic>'.
- 'List' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'commaSeparatedWithOr'. var validKinds = kindNames.commaSeparatedWithOr;
^^^^^^^^^^^^^^^^^^^^
flutter --バージョン
PS D:\AppDevelopment\flutter\pics> flutter --version
Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (5 weeks ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4
フラッタードクター
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19043.1348], locale ro-RO)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.62.3)
[√] Connected device (3 available)
! Doctor found issues in 1 category.