Browse Source

add actionType model

master
daivph 5 years ago
parent
commit
9f66cc09fb
4 changed files with 46 additions and 4 deletions
  1. +5
    -0
      jsons/ActionType.json
  2. +15
    -0
      lib/models/ActionType.dart
  3. +21
    -0
      lib/models/ActionType.g.dart
  4. +5
    -4
      lib/models/index.dart

+ 5
- 0
jsons/ActionType.json View File

@@ -0,0 +1,5 @@
{
"id": 9,
"name": "ACTIVE_TYPE_OTHER",
"description": "Hoạt động khác"
}

+ 15
- 0
lib/models/ActionType.dart View File

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

part 'ActionType.g.dart';

@JsonSerializable()
class ActionType {
ActionType();

num id;
String name;
String description;
factory ActionType.fromJson(Map<String,dynamic> json) => _$ActionTypeFromJson(json);
Map<String, dynamic> toJson() => _$ActionTypeToJson(this);
}

+ 21
- 0
lib/models/ActionType.g.dart View File

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

part of 'ActionType.dart';

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

ActionType _$ActionTypeFromJson(Map<String, dynamic> json) {
return ActionType()
..id = json['id'] as num
..name = json['name'] as String
..description = json['description'] as String;
}

Map<String, dynamic> _$ActionTypeToJson(ActionType instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'description': instance.description
};

+ 5
- 4
lib/models/index.dart View File

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

Loading…
Cancel
Save