69 lines
1.3 KiB
Dart
69 lines
1.3 KiB
Dart
|
|
/*
|
|
class Employee {
|
|
final String id;
|
|
final String name;
|
|
//final bool value;
|
|
Employee({
|
|
@required this.id,
|
|
@required this.name,
|
|
//@required this.value,
|
|
});
|
|
|
|
factory Employee.fromJson(Map<String, dynamic> json) {
|
|
return Employee(
|
|
id: json['_id'] as String,
|
|
name: json['name'] as String,
|
|
//value: json['value'] as bool,
|
|
);
|
|
}
|
|
}
|
|
*/
|
|
class EmployeeLs {
|
|
String id;
|
|
String name;
|
|
bool value;
|
|
EmployeeLs({
|
|
required this.id,
|
|
required this.name,
|
|
required this.value,
|
|
});
|
|
|
|
factory EmployeeLs.fromJson(Map<String, dynamic> json) {
|
|
return EmployeeLs(
|
|
id: json['_id'] as String,
|
|
name: json['name'] as String,
|
|
value: json['value'] ?? false //as bool,
|
|
);
|
|
}
|
|
}
|
|
|
|
class WorkLs {
|
|
String id;
|
|
String title;
|
|
String body;
|
|
String state;
|
|
//bool value;
|
|
WorkLs({
|
|
required this.id,
|
|
required this.title,
|
|
required this.body,
|
|
required this.state,
|
|
// @required this.value,
|
|
});
|
|
@override
|
|
String toString() {
|
|
return '$title ';
|
|
}
|
|
|
|
factory WorkLs.fromJson(Map<String, dynamic> json) {
|
|
return WorkLs(
|
|
id: json['_id'] as String,
|
|
title: json['title'] as String,
|
|
body: json['body'] as String,
|
|
state: json['state'] as String,
|
|
// value: json['value'] as bool,
|
|
);
|
|
}
|
|
}
|