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.
33 lines
779 B
Dart
33 lines
779 B
Dart
import 'package:test_sa/models/lookup.dart';
|
|
|
|
class PPMCheckList{
|
|
Lookup status;
|
|
String title;
|
|
String comment;
|
|
String measuredValue;
|
|
|
|
PPMCheckList({
|
|
this.title,
|
|
this.status,
|
|
this.comment,
|
|
this.measuredValue,
|
|
});
|
|
|
|
Map<String, String> toMap() {
|
|
return {
|
|
if(status != null) 'status': status?.id.toString(),
|
|
if(title != null) 'title': title,
|
|
if(comment != null) 'comment': comment,
|
|
if(measuredValue != null) 'measuredValue': measuredValue,
|
|
};
|
|
}
|
|
|
|
factory PPMCheckList.fromMap(Map<String, dynamic> map) {
|
|
return PPMCheckList(
|
|
status: Lookup.fromJson(map['status']),
|
|
title: map['title'] as String,
|
|
comment: map['comment'] as String,
|
|
measuredValue: map['measuredValue'] as String,
|
|
);
|
|
}
|
|
} |