{
"curPage": 2,
"datas": [
{
"apkLink": "",
"author": "鸿洋",
"chapterId": 410,
"chapterName": "玉刚说",
"collect": false,
"courseId": 13,
"desc": "",
"envelopePic": "",
"fresh": false,
"id": 7604,
"link": "https://mp.weixin.qq.com/s/cCZKmqKrdCn63eWTbOuANw",
"niceDate": "2018-12-03",
"origin": "",
"projectLink": "",
"publishTime": 1543830090000,
"superChapterId": 408,
"superChapterName": "公众号",
"tags": [
{
"name": "公众号",
"url": "/wxarticle/list/410/1"
}
],
"title": "在 Retrofit 和 OkHttp 中使用网络缓存,提高访问效率",
"type": 0,
"userId": -1,
"visible": 1,
"zan": 0
},
{
"apkLink": "",
"author": "鸿洋",
"chapterId": 408,
"chapterName": "鸿洋",
"collect": false,
"courseId": 13,
"desc": "",
"envelopePic": "",
"fresh": false,
"id": 7605,
"link": "https://mp.weixin.qq.com/s/r3AWeYafyMEc1-g8BWEHBg",
"niceDate": "2018-12-03",
"origin": "",
"projectLink": "",
"publishTime": 1543766400000,
"superChapterId": 408,
"superChapterName": "公众号",
"tags": [
{
"name": "公众号",
"url": "/wxarticle/list/408/1"
}
],
"title": "非 UI 线程能调用 View.invalidate()?",
"type": 0,
"userId": -1,
"visible": 1,
"zan": 0
}
],
"offset": 20,
"over": false,
"pageCount": 289,
"size": 20,
"total": 5779
}
生成
import 'package:json_annotation/json_annotation.dart';
part 'new.g.dart';
@JsonSerializable()
class new extends Object { // 这里的new -> Ne
@JsonKey(name: 'curPage')
int curPage;
@JsonKey(name: 'datas')
List datas;
@JsonKey(name: 'offset')
int offset;
@JsonKey(name: 'over')
bool over;
@JsonKey(name: 'pageCount')
int pageCount;
@JsonKey(name: 'size')
int size;
@JsonKey(name: 'total')
int total;
new(this.curPage,this.datas,this.offset,this.over,this.pageCount,this.size,this.total,); // 这里的new -> New 1处
factory new.fromJson(Map srcJson) => _$newFromJson(srcJson); // 这里的new -> New 2处
Map toJson() => _$newToJson(this); // 这里的new -> New 1处
}
@JsonSerializable()
class Datas extends Object {
@JsonKey(name: 'apkLink')
String apkLink;
@JsonKey(name: 'author')
String author;
@JsonKey(name: 'chapterId')
int chapterId;
@JsonKey(name: 'chapterName')
String chapterName;
@JsonKey(name: 'collect')
bool collect;
@JsonKey(name: 'courseId')
int courseId;
@JsonKey(name: 'desc')
String desc;
@JsonKey(name: 'envelopePic')
String envelopePic;
@JsonKey(name: 'fresh')
bool fresh;
@JsonKey(name: 'id')
int id;
@JsonKey(name: 'link')
String link;
@JsonKey(name: 'niceDate')
String niceDate;
@JsonKey(name: 'origin')
String origin;
@JsonKey(name: 'projectLink')
String projectLink;
@JsonKey(name: 'publishTime')
int publishTime;
@JsonKey(name: 'superChapterId')
int superChapterId;
@JsonKey(name: 'superChapterName')
String superChapterName;
@JsonKey(name: 'tags')
List tags;
@JsonKey(name: 'title')
String title;
@JsonKey(name: 'type')
int type;
@JsonKey(name: 'userId')
int userId;
@JsonKey(name: 'visible')
int visible;
@JsonKey(name: 'zan')
int zan;
Datas(this.apkLink,this.author,this.chapterId,this.chapterName,this.collect,this.courseId,this.desc,this.envelopePic,this.fresh,this.id,this.link,this.niceDate,this.origin,this.projectLink,this.publishTime,this.superChapterId,this.superChapterName,this.tags,this.title,this.type,this.userId,this.visible,this.zan,);
factory Datas.fromJson(Map srcJson) => _$DatasFromJson(srcJson);
Map toJson() => _$DatasToJson(this);
}
@JsonSerializable()
class Tags extends Object {
@JsonKey(name: 'name')
String name;
@JsonKey(name: 'url')
String url;
Tags(this.name,this.url,);
factory Tags.fromJson(Map srcJson) => _$TagsFromJson(srcJson);
Map toJson() => _$TagsToJson(this);
}
N/A: version "N/A -> N/A" is not yet installed.
You need to run "nvm install N/A" to install it before using it.
N/A: version "N/A -> N/A" is not yet installed.
You need to run "nvm install N/A" to install it before using it.
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build
[INFO] Generating build script...
[INFO] Generating build script completed, took 319ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
NoSuchMethodError: The getter 'inputs' was called on null.
Receiver: null
Tried calling: inputs
dart:core Object.noSuchMethod
../flutter/.pub-cache/hosted/pub.flutter-io.cn/build_runner_core-1.0.0/lib/src/asset_graph/serialization.dart 58:20 _AssetGraphDeserializer.deserialize
package:build_runner_core/src/asset_graph/graph.dart 42:48 new AssetGraph.deserialize
package:build_runner_core/src/generate/build_definition.dart 209:38 _Loader._tryReadCachedAssetGraph.
package:build_runner_core/src/logging/logging.dart 25:30 logTimedAsync
package:build_runner_core/src/generate/build_definition.dart 207:12 _Loader._tryReadCachedAssetGraph
package:build_runner_core/src/generate/build_definition.dart 79:28 _Loader.prepareWorkspace
package:build_runner_core/src/generate/build_definition.dart 64:50 BuildDefinition.prepareWorkspace
package:build_runner_core/src/generate/build_impl.dart 107:49 BuildImpl.create
package:build_runner_core/src/generate/build_runner.dart 31:37 BuildRunner.create
package:build_runner/src/generate/build.dart 105:35 build
package:build_runner/src/entrypoint/build.dart 28:24 BuildCommand.run
package:args/command_runner.dart 196:27 CommandRunner.runCommand
package:args/command_runner.dart 111:29 CommandRunner.run.
dart:async new Future.sync
package:args/command_runner.dart 111:11 CommandRunner.run
package:build_runner/src/entrypoint/run.dart 22:31 run
.dart_tool/build/entrypoint/build.dart 18:22 main
pub finished with exit code 1
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build
[INFO] Generating build script...
[INFO] Generating build script completed, took 537ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
NoSuchMethodError: The getter 'inputs' was called on null.
Receiver: null
Tried calling: inputs
dart:core Object.noSuchMethod
../flutter/.pub-cache/hosted/pub.flutter-io.cn/build_runner_core-1.0.0/lib/src/asset_graph/serialization.dart 58:20 _AssetGraphDeserializer.deserialize
package:build_runner_core/src/asset_graph/graph.dart 42:48 new AssetGraph.deserialize
package:build_runner_core/src/generate/build_definition.dart 209:38 _Loader._tryReadCachedAssetGraph.
package:build_runner_core/src/logging/logging.dart 25:30 logTimedAsync
package:build_runner_core/src/generate/build_definition.dart 207:12 _Loader._tryReadCachedAssetGraph
package:build_runner_core/src/generate/build_definition.dart 79:28 _Loader.prepareWorkspace
package:build_runner_core/src/generate/build_definition.dart 64:50 BuildDefinition.prepareWorkspace
package:build_runner_core/src/generate/build_impl.dart 107:49 BuildImpl.create
package:build_runner_core/src/generate/build_runner.dart 31:37 BuildRunner.create
package:build_runner/src/generate/build.dart 105:35 build
package:build_runner/src/entrypoint/build.dart 28:24 BuildCommand.run
package:args/command_runner.dart 196:27 CommandRunner.runCommand
package:args/command_runner.dart 111:29 CommandRunner.run.
dart:async new Future.sync
package:args/command_runner.dart 111:11 CommandRunner.run
package:build_runner/src/entrypoint/run.dart 22:31 run
.dart_tool/build/entrypoint/build.dart 18:22 main
pub finished with exit code 1
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build
[INFO] Generating build script...
[INFO] Generating build script completed, took 496ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
NoSuchMethodError: The getter 'inputs' was called on null.
Receiver: null
Tried calling: inputs
dart:core Object.noSuchMethod
../flutter/.pub-cache/hosted/pub.flutter-io.cn/build_runner_core-1.0.0/lib/src/asset_graph/serialization.dart 58:20 _AssetGraphDeserializer.deserialize
package:build_runner_core/src/asset_graph/graph.dart 42:48 new AssetGraph.deserialize
package:build_runner_core/src/generate/build_definition.dart 209:38 _Loader._tryReadCachedAssetGraph.
package:build_runner_core/src/logging/logging.dart 25:30 logTimedAsync
package:build_runner_core/src/generate/build_definition.dart 207:12 _Loader._tryReadCachedAssetGraph
package:build_runner_core/src/generate/build_definition.dart 79:28 _Loader.prepareWorkspace
package:build_runner_core/src/generate/build_definition.dart 64:50 BuildDefinition.prepareWorkspace
package:build_runner_core/src/generate/build_impl.dart 107:49 BuildImpl.create
package:build_runner_core/src/generate/build_runner.dart 31:37 BuildRunner.create
package:build_runner/src/generate/build.dart 105:35 build
package:build_runner/src/entrypoint/build.dart 28:24 BuildCommand.run
package:args/command_runner.dart 196:27 CommandRunner.runCommand
package:args/command_runner.dart 111:29 CommandRunner.run.
dart:async new Future.sync
package:args/command_runner.dart 111:11 CommandRunner.run
package:build_runner/src/entrypoint/run.dart 22:31 run
.dart_tool/build/entrypoint/build.dart 18:22 main
pub finished with exit code 1
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build
[INFO] Generating build script...
[INFO] Generating build script completed, took 448ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
NoSuchMethodError: The getter 'inputs' was called on null.
Receiver: null
Tried calling: inputs
dart:core Object.noSuchMethod
../flutter/.pub-cache/hosted/pub.flutter-io.cn/build_runner_core-1.0.0/lib/src/asset_graph/serialization.dart 58:20 _AssetGraphDeserializer.deserialize
package:build_runner_core/src/asset_graph/graph.dart 42:48 new AssetGraph.deserialize
package:build_runner_core/src/generate/build_definition.dart 209:38 _Loader._tryReadCachedAssetGraph.
package:build_runner_core/src/logging/logging.dart 25:30 logTimedAsync
package:build_runner_core/src/generate/build_definition.dart 207:12 _Loader._tryReadCachedAssetGraph
package:build_runner_core/src/generate/build_definition.dart 79:28 _Loader.prepareWorkspace
package:build_runner_core/src/generate/build_definition.dart 64:50 BuildDefinition.prepareWorkspace
package:build_runner_core/src/generate/build_impl.dart 107:49 BuildImpl.create
package:build_runner_core/src/generate/build_runner.dart 31:37 BuildRunner.create
package:build_runner/src/generate/build.dart 105:35 build
package:build_runner/src/entrypoint/build.dart 28:24 BuildCommand.run
package:args/command_runner.dart 196:27 CommandRunner.runCommand
package:args/command_runner.dart 111:29 CommandRunner.run.
dart:async new Future.sync
package:args/command_runner.dart 111:11 CommandRunner.run
package:build_runner/src/entrypoint/run.dart 22:31 run
.dart_tool/build/entrypoint/build.dart 18:22 main
pub finished with exit code 1
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner clean
[INFO] Generating build script...
[INFO] Generating build script completed, took 329ms
[WARNING] Deleting cache and generated source files.
This shouldn't be necessary for most applications, unless you have made intentional edits to generated files (i.e. for testing). Consider filing a bug at https://github.com/dart-lang/build/issues/new if you are using this to work around an apparent (and reproducible) bug.
[INFO] Cleaning up source outputs...
[WARNING] Failed to deserialize AssetGraph. Skipping cleanup of generated files in source directories.
[INFO] Cleaning up source outputs completed, took 142ms
[INFO] Cleaning up cache directory...
[INFO] Cleaning up cache directory completed, took 22ms
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build
[INFO] Generating build script...
[INFO] Generating build script completed, took 317ms
[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 2.2s
[INFO] Checking for unexpected pre-existing outputs....
[INFO] Found 1 declared outputs which already exist on disk. This is likely because the`.dart_tool/build` folder was deleted, or you are submitting generated files to your source repository.
[SEVERE] Conflicting outputs were detected and the build is unable to prompt for permission to remove them. These outputs must be removed manually or the build can be run with `--delete-conflicting-outputs`. The outputs are: lib/data.g.dart
pub finished with exit code 78
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build --delete-conflicting-output
Could not find an option named "delete-conflicting-output".
Usage: build_runner build [arguments] [directories]
-h, --help Print this usage information.
--[no-]assume-tty Enables colors and interactive input when the script does not appear to be running directly in a terminal, for instance when it is a subprocess
--delete-conflicting-outputs By default, the user will be prompted to delete any files which already exist but were not known to be generated by this specific build script.
Enabling this option skips the prompt and deletes the files. This should typically be used in continues integration servers and tests, but not otherwise.
--low-resources-mode Reduce the amount of memory consumed by the build process. This will slow down builds but allow them to progress in resource constrained environments.
-c, --config Read `build..yaml` instead of the default `build.yaml`
--[no-]track-performance Enables performance tracking and the /$perf page.
--log-performance A directory to write performance logs to, must be in the current package. Implies `--track-performance`.
-o, --output A directory to copy the fully built package to. Or a mapping from a top-level directory in the package to the directory to write a filtered build output to. For example "web:deploy".
-v, --verbose Enables verbose logging.
-r, --[no-]release Build with release mode defaults for builders.
--define Sets the global `options` config for a builder by key.
--[no-]symlink Symlink files in the output directories, instead of copying.
Run "build_runner help" to see global options.
pub finished with exit code 64
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build --delete-conflicting-output
Could not find an option named "delete-conflicting-output".
Usage: build_runner build [arguments] [directories]
-h, --help Print this usage information.
--[no-]assume-tty Enables colors and interactive input when the script does not appear to be running directly in a terminal, for instance when it is a subprocess
--delete-conflicting-outputs By default, the user will be prompted to delete any files which already exist but were not known to be generated by this specific build script.
Enabling this option skips the prompt and deletes the files. This should typically be used in continues integration servers and tests, but not otherwise.
--low-resources-mode Reduce the amount of memory consumed by the build process. This will slow down builds but allow them to progress in resource constrained environments.
-c, --config Read `build..yaml` instead of the default `build.yaml`
--[no-]track-performance Enables performance tracking and the /$perf page.
--log-performance A directory to write performance logs to, must be in the current package. Implies `--track-performance`.
-o, --output A directory to copy the fully built package to. Or a mapping from a top-level directory in the package to the directory to write a filtered build output to. For example "web:deploy".
-v, --verbose Enables verbose logging.
-r, --[no-]release Build with release mode defaults for builders.
--define Sets the global `options` config for a builder by key.
--[no-]symlink Symlink files in the output directories, instead of copying.
Run "build_runner help" to see global options.
pub finished with exit code 64
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner clean
[INFO] Generating build script...
[INFO] Generating build script completed, took 488ms
[WARNING] Deleting cache and generated source files.
This shouldn't be necessary for most applications, unless you have made intentional edits to generated files (i.e. for testing). Consider filing a bug at https://github.com/dart-lang/build/issues/new if you are using this to work around an apparent (and reproducible) bug.
[INFO] Cleaning up source outputs...
[WARNING] No asset graph found. Skipping cleanup of generated files in source directories.
[INFO] Cleaning up source outputs completed, took 20ms
[INFO] Cleaning up cache directory...
[INFO] Cleaning up cache directory completed, took 4ms
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build --delete-conflicting-outputs
[INFO] Generating build script...
[INFO] Generating build script completed, took 577ms
[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 691ms
[INFO] Checking for unexpected pre-existing outputs....
[INFO] Deleting 1 declared outputs which already existed on disk.
[INFO] Checking for unexpected pre-existing outputs. completed, took 4ms
[INFO] Running build...
[INFO] 1.1s elapsed, 0/16 actions completed.
[INFO] 2.1s elapsed, 0/16 actions completed.
[INFO] 3.2s elapsed, 0/16 actions completed.
[INFO] 11.1s elapsed, 15/16 actions completed.
[INFO] 12.3s elapsed, 16/16 actions completed.
[INFO] Running build completed, took 13.2s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 83ms
[INFO] Succeeded after 13.3s with 2 outputs (101 actions)
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$ flutter packages pub run build_runner build --delete-conflicting-outputs
[INFO] Generating build script...
[INFO] Generating build script completed, took 378ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 141ms
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 772ms
[INFO] Running build...
[INFO] Running build completed, took 751ms
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 45ms
[INFO] Succeeded after 806ms with 2 outputs (3 actions)
chenhailong@chenhailongdeMacBook-Pro:~/development/my_app$