41 lines
1.1 KiB
Dart
41 lines
1.1 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
class Layanan extends Equatable {
|
|
int id;
|
|
String name;
|
|
String code;
|
|
bool value;
|
|
int priority;
|
|
String isConsultDoctor;
|
|
String doctorName;
|
|
String? img;
|
|
|
|
Layanan(
|
|
{required this.name,
|
|
required this.id,
|
|
required this.priority,
|
|
required this.isConsultDoctor,
|
|
this.doctorName = '',
|
|
this.value = false,
|
|
this.img,
|
|
required this.code});
|
|
Layanan.fromJson(Map<String, dynamic> json)
|
|
: name = (json['serviceName'] as String).replaceAll("</br>", "\n"),
|
|
code = json['serviceCode'].toString(),
|
|
priority = int.parse(json['servicePriority']),
|
|
value = false,
|
|
isConsultDoctor = json['serviceIsConsultDoctor'].toString(),
|
|
doctorName = json['serviceDoctorName'].toString(),
|
|
id = int.parse(json['serviceID']);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'serviceName': name,
|
|
'serviceID': id,
|
|
'serviceID': code,
|
|
'servicePriority': priority,
|
|
'value': value
|
|
};
|
|
@override
|
|
List<Object?> get props => [id];
|
|
}
|