错误状态:意外诊断:需要一个标识符。 [严重] json_serializable:json_serializable test/widget_test.dart
Bad state: Unexpected diagnostics: Expected an identifier. [SEVERE] json_serializable:json_serializable on test/widget_test.dart
Json serilizable 不工作 我该如何解决这个问题 我不知道这个错误。我用的是 flutter build_runner: ^1.7.2
json_serializable: ^3.4.1
分析器:^0.39.17 json_annotation:^3.0.1 没有一个文件正在创建 json
Json serilizable 不工作 我该如何解决这个问题 我不知道这个错误。我用的是 flutter build_runner: ^1.7.2
json_serializable: ^3.4.1
分析器:^0.39.17 json_annotation:^3.0.1 没有一个文件正在创建 json
import 'package:dance/models/tutorials-model/video-data.dart';
import 'package:json_annotation/json_annotation.dart';
part 'metadata.g.dart';
@JsonSerializable()
class MetaData {
final String category;
final String categoryId;
final List<VideoData> data;
MetaData(this.category, this.categoryId, this.data);
factory MetaData.fromJson(Map<String, dynamic> json) => _$MetaDataFromJson(json);
Map<String, dynamic> toJson() => _$MetaDataToJson(this);
}
------------------------terminal------------------------
flutter pub run build_runner watch
[INFO] Running build...
[INFO] Generating SDK summary...
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[INFO] 2.3s elapsed, 1/17 actions completed.
[INFO] 3.4s elapsed, 1/17 actions completed.
[INFO] 4.4s elapsed, 1/17 actions completed.
[INFO] 5.4s elapsed, 1/17 actions completed.
[INFO] 6.4s elapsed, 1/17 actions completed.
[INFO] 7.4s elapsed, 1/17 actions completed.
[INFO] 8.4s elapsed, 1/17 actions completed.
[INFO] 9.4s elapsed, 1/17 actions completed.
[INFO] 10.5s elapsed, 1/17 actions completed.
[INFO] 11.5s elapsed, 1/17 actions completed.
[INFO] 12.5s elapsed, 1/17 actions completed.
[INFO] 13.5s elapsed, 1/17 actions completed.
[INFO] 14.5s elapsed, 1/17 actions completed.
[INFO] 15.5s elapsed, 1/17 actions completed.
[WARNING] No actions completed for 15.0s, waiting on:
- json_serializable:json_serializable on lib/constants/constants.dart
- json_serializable:json_serializable on lib/constants/key_provider.dart
- json_serializable:json_serializable on lib/constants/routes_name.dart
- json_serializable:json_serializable on lib/constants/url_provider.dart
- json_serializable:json_serializable on lib/extension/string_extension.dart
.. and 11 more
我遇到了类似的卡顿问题。
可能通过指定包来解决。
dependencies:
analyzer: ^0.39.14 <- This
dev_dependencies:
build_runner: ^1.10.0 <- This
重建前清理
# delete pubspec.lock
$ rm -rf pubspec.lock
# clean
$ flutter clean
Json serilizable 不工作 我该如何解决这个问题 我不知道这个错误。我用的是 flutter build_runner: ^1.7.2 json_serializable: ^3.4.1 分析器:^0.39.17 json_annotation:^3.0.1 没有一个文件正在创建 json
Json serilizable 不工作 我该如何解决这个问题 我不知道这个错误。我用的是 flutter build_runner: ^1.7.2 json_serializable: ^3.4.1 分析器:^0.39.17 json_annotation:^3.0.1 没有一个文件正在创建 json
import 'package:dance/models/tutorials-model/video-data.dart';
import 'package:json_annotation/json_annotation.dart';
part 'metadata.g.dart';
@JsonSerializable()
class MetaData {
final String category;
final String categoryId;
final List<VideoData> data;
MetaData(this.category, this.categoryId, this.data);
factory MetaData.fromJson(Map<String, dynamic> json) => _$MetaDataFromJson(json);
Map<String, dynamic> toJson() => _$MetaDataToJson(this);
}
------------------------terminal------------------------
flutter pub run build_runner watch
[INFO] Running build...
[INFO] Generating SDK summary...
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on test/widget_test.dart:
Bad state: Unexpected diagnostics:
C:\Users\Admin\Desktop\flutter-dart\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[INFO] 2.3s elapsed, 1/17 actions completed.
[INFO] 3.4s elapsed, 1/17 actions completed.
[INFO] 4.4s elapsed, 1/17 actions completed.
[INFO] 5.4s elapsed, 1/17 actions completed.
[INFO] 6.4s elapsed, 1/17 actions completed.
[INFO] 7.4s elapsed, 1/17 actions completed.
[INFO] 8.4s elapsed, 1/17 actions completed.
[INFO] 9.4s elapsed, 1/17 actions completed.
[INFO] 10.5s elapsed, 1/17 actions completed.
[INFO] 11.5s elapsed, 1/17 actions completed.
[INFO] 12.5s elapsed, 1/17 actions completed.
[INFO] 13.5s elapsed, 1/17 actions completed.
[INFO] 14.5s elapsed, 1/17 actions completed.
[INFO] 15.5s elapsed, 1/17 actions completed.
[WARNING] No actions completed for 15.0s, waiting on:
- json_serializable:json_serializable on lib/constants/constants.dart
- json_serializable:json_serializable on lib/constants/key_provider.dart
- json_serializable:json_serializable on lib/constants/routes_name.dart
- json_serializable:json_serializable on lib/constants/url_provider.dart
- json_serializable:json_serializable on lib/extension/string_extension.dart
.. and 11 more
我遇到了类似的卡顿问题。 可能通过指定包来解决。
dependencies:
analyzer: ^0.39.14 <- This
dev_dependencies:
build_runner: ^1.10.0 <- This
重建前清理
# delete pubspec.lock
$ rm -rf pubspec.lock
# clean
$ flutter clean