You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PS D:\Note\02-Computer\program\flutter\flutter_desktop_demo> flutter pub run build_runner watch
Failed to build build_runner:build_runner:
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:build_runner_core
- package:io
- package:build_runner
- package:build
- package:build_config
- package:build_daemon
- package:build_resolvers
- package:timing
- package:graphs
- package:package_config
- package:code_builder
- package:dart_style
- package:http_multi_server
- package:pubspec_parse
- package:analyzer
- package:checked_yaml
- package:shelf_web_socket
- package:web_socket_channel
- package:_fe_analyzer_shared
For solutions, see https://dart.dev/go/unsound-null-safety
/C:/Users/hxse/scoop/apps/flutter/current/.pub-cache/hosted/pub.dartlang.org/build_runner-1.11.5/bin/build_runner.dart:91:37: Error: Operator '[]' cannot be called on 'ArgResults?' because it is potentially null.
- 'ArgResults' is from 'package:args/src/arg_results.dart' ('/C:/Users/hxse/scoop/apps/flutter/2.8.1/.pub-cache/hosted/pub.dartlang.org/args-2.3.0/lib/src/arg_results.dart').
var verbose = parsedArgs.command['verbose'] as bool ?? false;
^
/C:/Users/hxse/scoop/apps/flutter/current/.pub-cache/hosted/pub.dartlang.org/build_runner-1.11.5/bin/build_runner.dart:91:49: Warning: Operand of null-aware operation '??' has type 'bool' which excludes null.
var verbose = parsedArgs.command['verbose'] as bool ?? false;
^
/C:/Users/hxse/scoop/apps/flutter/current/.pub-cache/hosted/pub.dartlang.org/build_runner-1.11.5/bin/build_runner.dart:101:9: Warning: Operand of null-aware operation '?.' has type 'StreamSubscription<dynamic>' which excludes null.
- 'StreamSubscription' is from 'dart:async'.
await logListener?.cancel();
^
/C:/Users/hxse/scoop/apps/flutter/2.8.1/.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' ('/C:/Users/hxse/scoop/apps/flutter/2.8.1/.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() ^^^^^^^^^^^^^
/C:/Users/hxse/scoop/apps/flutter/2.8.1/.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 {
^^^^^^^^^^^^^
/C:/Users/hxse/scoop/apps/flutter/2.8.1/.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 {
^^^^^^^^^^^^^
/C:/Users/hxse/scoop/apps/flutter/2.8.1/.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;
^^^^^^^^^^^^^^^^^^^^
pub finished with exit code 1
To Reproduce
flutter create .
add following code in main.dart
flutter pub run build_runner watch
import 'package:flutter/foundation.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:flutter/widgets.dart';
part 'main.g.dart';
// we create a widget using a widget decorated by `@swidget`
@swidget
Widget foo(int value) {
return Container();
}
@swidget
Widget example(
int foo,
String bar, {
ValueChanged<bool>? onChanged,
}) {
return Container();
}
void main() => runApp(
// we use the generated class
const Foo(42),
);
my pubspec.yaml
name: flutter_desktop_demo
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.15.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
functional_widget_annotation: ^0.8.0
flutter_hooks : any
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
functional_widget: ^0.8.0
build_runner: ^1.9.0
flutter_lints: ^1.0.0
# The following section is specific to Flutter.
flutter:
uses-material-design: true
Expected behavior
I just run the example code, I hope to run normally.
The text was updated successfully, but these errors were encountered:
Describe the bug
To Reproduce
my pubspec.yaml
Expected behavior
I just run the example code, I hope to run normally.
The text was updated successfully, but these errors were encountered: