You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
575 B
Dart
31 lines
575 B
Dart
|
3 years ago
|
class Engineer{
|
||
|
|
String id;
|
||
|
|
String name;
|
||
|
|
|
||
|
|
Engineer({
|
||
|
|
this.id,
|
||
|
|
this.name,
|
||
|
|
});
|
||
|
|
|
||
|
|
factory Engineer.fromJson(Map<String,dynamic> parsedJson){
|
||
|
|
return Engineer(
|
||
|
|
id: parsedJson["userId"],
|
||
|
|
name: parsedJson["userName"],
|
||
|
|
);
|
||
|
|
}
|
||
|
|
factory Engineer.fromEngineer(Engineer department){
|
||
|
|
return Engineer(
|
||
|
|
id: department?.id,
|
||
|
|
name: department?.name,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
@override
|
||
|
|
bool operator == (Object other) =>
|
||
|
|
identical(this, other) || other is Engineer &&
|
||
|
|
id == other.id;
|
||
|
|
|
||
|
|
|
||
|
|
@override
|
||
|
|
int get hashCode => id.hashCode;
|
||
|
|
}
|