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 json) : name = (json['serviceName'] as String).replaceAll("
", "\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 toJson() => { 'serviceName': name, 'serviceID': id, 'serviceID': code, 'servicePriority': priority, 'value': value }; @override List get props => [id]; }