Browse Source

add model historyAction

master
daivph 5 years ago
parent
commit
90c5560bb1
6 changed files with 98 additions and 47 deletions
  1. +9
    -0
      jsons/HistoryAction.json
  2. +19
    -0
      lib/models/HistoryAction.dart
  3. +29
    -0
      lib/models/HistoryAction.g.dart
  4. +1
    -0
      lib/models/index.dart
  5. +38
    -45
      pubspec.lock
  6. +2
    -2
      pubspec.yaml

+ 9
- 0
jsons/HistoryAction.json View File

@@ -0,0 +1,9 @@
{
"id": 1,
"ageDay": 24,
"cropId": 1,
"executeDate": "2020-08-20T02:34:18Z",
"description": "test",
"activityTypeId": 1,
"activityTypeName": "ACTIVE_TYPE_NURSERY"
}

+ 19
- 0
lib/models/HistoryAction.dart View File

@@ -0,0 +1,19 @@
import 'package:json_annotation/json_annotation.dart';

part 'HistoryAction.g.dart';

@JsonSerializable()
class HistoryAction {
HistoryAction();

num id;
num ageDay;
num cropId;
String executeDate;
String description;
num activityTypeId;
String activityTypeName;
factory HistoryAction.fromJson(Map<String,dynamic> json) => _$HistoryActionFromJson(json);
Map<String, dynamic> toJson() => _$HistoryActionToJson(this);
}

+ 29
- 0
lib/models/HistoryAction.g.dart View File

@@ -0,0 +1,29 @@
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'HistoryAction.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

HistoryAction _$HistoryActionFromJson(Map<String, dynamic> json) {
return HistoryAction()
..id = json['id'] as num
..ageDay = json['ageDay'] as num
..cropId = json['cropId'] as num
..executeDate = json['executeDate'] as String
..description = json['description'] as String
..activityTypeId = json['activityTypeId'] as num
..activityTypeName = json['activityTypeName'] as String;
}

Map<String, dynamic> _$HistoryActionToJson(HistoryAction instance) =>
<String, dynamic>{
'id': instance.id,
'ageDay': instance.ageDay,
'cropId': instance.cropId,
'executeDate': instance.executeDate,
'description': instance.description,
'activityTypeId': instance.activityTypeId,
'activityTypeName': instance.activityTypeName
};

+ 1
- 0
lib/models/index.dart View File

@@ -1,5 +1,6 @@
export 'Supply.dart' ;
export 'Plot.dart' ;
export 'ResourceHelper.dart' ;
export 'HistoryAction.dart' ;
export 'ActionType.dart' ;
export 'OtherAction.dart' ;

+ 38
- 45
pubspec.lock View File

@@ -1,20 +1,13 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "7.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "0.39.17"
version: "0.36.4"
archive:
dependency: transitive
description:
@@ -63,14 +56,14 @@ packages:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.1.6"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
version: "0.4.1+1"
build_daemon:
dependency: transitive
description:
@@ -84,21 +77,21 @@ packages:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.11"
version: "1.2.1"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
version: "1.6.9"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.0"
version: "3.1.1"
built_collection:
dependency: transitive
description:
@@ -134,13 +127,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
cli_util:
dependency: transitive
description:
name: cli_util
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
code_builder:
dependency: transitive
description:
@@ -189,7 +175,7 @@ packages:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.6"
version: "1.2.9"
dio:
dependency: "direct main"
description:
@@ -310,6 +296,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
front_end:
dependency: transitive
description:
name: front_end
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.19"
get:
dependency: "direct main"
description:
@@ -407,14 +400,28 @@ packages:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "2.3.0"
json_model:
dependency: "direct dev"
description:
name: json_model
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2"
json_serializable:
dependency: "direct dev"
description:
name: json_serializable
url: "https://pub.dartlang.org"
source: hosted
version: "3.4.1"
version: "2.3.0"
kernel:
dependency: transitive
description:
name: kernel
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.19"
keyboard_dismisser:
dependency: "direct main"
description:
@@ -485,6 +492,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
package_resolver:
dependency: transitive
description:
name: package_resolver
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.10"
path:
dependency: transitive
description:
@@ -590,20 +604,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
retrofit:
dependency: transitive
description:
name: retrofit
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.4"
retrofit_generator:
dependency: "direct dev"
description:
name: retrofit_generator
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.7+6"
rxdart:
dependency: "direct main"
description:
@@ -678,7 +678,7 @@ packages:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.6"
version: "0.9.4+4"
source_span:
dependency: transitive
description:
@@ -735,13 +735,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+2"
tuple:
dependency: transitive
description:
name: tuple
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
typed_data:
dependency: transitive
description:

+ 2
- 2
pubspec.yaml View File

@@ -42,9 +42,9 @@ dev_dependencies:
flutter_test:
sdk: flutter
#flutter packages pub run build_runner build --delete-conflicting-outputs
retrofit_generator: ^1.3.7
# retrofit_generator: ^1.3.7
# flutter packages pub run json_model
# json_model: ^0.0.2
json_model: ^0.0.2
build_runner: any
json_serializable: any

Loading…
Cancel
Save