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.
cloudsolutions-atoms/lib/models/fault_description.dart

47 lines
1.1 KiB
Dart

import 'package:test_sa/models/base.dart';
class FaultDescription extends Base {
FaultDescription({
this.id,
this.defectName,
this.workPerformed,
this.estimatedTime,
}) : super(name: defectName, identifier: id?.toString());
FaultDescription.fromJson(dynamic json) {
id = json['id'];
identifier = id.toString();
defectName = json['defectName'];
name = defectName;
workPerformed = json['workPerformed'];
estimatedTime = json['estimatedTime'];
}
num? id;
String? defectName;
String? workPerformed;
String? estimatedTime;
FaultDescription copyWith({
num? id,
String? defectName,
String? workPerformed,
String? estimatedTime,
}) =>
FaultDescription(
id: id ?? this.id,
defectName: defectName ?? this.defectName,
workPerformed: workPerformed ?? this.workPerformed,
estimatedTime: estimatedTime ?? this.estimatedTime,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['defectName'] = defectName;
map['workPerformed'] = workPerformed;
map['estimatedTime'] = estimatedTime;
return map;
}
}