first commit
This commit is contained in:
40
lib/model/layanan.dart
Normal file
40
lib/model/layanan.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
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];
|
||||
}
|
||||
Reference in New Issue
Block a user