forked from lxm_flutter/FlutterUnit
web
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter_unit_mac/storage/po/node_po.dart';
|
||||
|
||||
/// create by 张风捷特烈 on 2020-03-04
|
||||
/// contact me by email 1981462002@qq.com
|
||||
/// 说明: 详情页节点-展示-数据模型
|
||||
|
||||
|
||||
class NodeModel extends Equatable {
|
||||
final String name;
|
||||
final String subtitle;
|
||||
@@ -17,13 +17,19 @@ class NodeModel extends Equatable {
|
||||
|
||||
factory NodeModel.fromJson(Map<String, dynamic> map) {
|
||||
return NodeModel(
|
||||
name: map['name'],
|
||||
subtitle: map["subtitle"],
|
||||
code: map["code"]);
|
||||
name: map['name'], subtitle: map["subtitle"], code: map["code"]);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Node{name: $name, subtitle: $subtitle, code: $code}';
|
||||
}
|
||||
}
|
||||
|
||||
static NodeModel fromPo(NodePo po) {
|
||||
return NodeModel(
|
||||
name: po.name,
|
||||
subtitle: po.subtitle,
|
||||
code: po.code,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user