From b345b35abd52fbdf16ae675296de799440dd2deb Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 3 Jun 2021 16:20:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20json=20annotation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.lock | 2 +- pubspec.yaml | 2 +- tool/grind.dart | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index fe11134..0e82d13 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -600,7 +600,7 @@ packages: source: hosted version: "0.6.3" json_annotation: - dependency: transitive + dependency: "direct main" description: name: json_annotation url: "https://pub.flutter-io.cn" diff --git a/pubspec.yaml b/pubspec.yaml index dda885a..936b5c8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,6 +70,7 @@ dependencies: shimmer: ^2.0.0-nullsafety.0 badges: ^2.0.0-nullsafety.1 + json_annotation: ^4.0.1 equatable: ^2.0.0 #打开文件 open_file: ^3.2.1 @@ -82,7 +83,6 @@ dev_dependencies: #json序列化 json_serializable: ^4.1.1 build_runner: ^2.0.3 - json_model: flutter: uses-material-design: true diff --git a/tool/grind.dart b/tool/grind.dart index 12b24e9..2c802c1 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -51,3 +51,8 @@ void sort() { void format() { DartFmt.format(libDir); } + +@Task('生成model') +void gen() async { + await Pub.run('build_runner', arguments: ['build']); +}