Files
display-counter-cpone/lib/model/service_model.dart
2025-02-04 19:39:14 +07:00

76 lines
2.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;
int counterID;
String? counterCode;
String? counterIP;
String? counterIsDedicated;
String? counterLocationID;
String? counterMaxQueue;
String? counterIsActive;
String? locationID;
String? locationName;
String? serviceID;
bool value;
bool sound;
Layanan({
// required this.name,
// required this.id,
// required this.priority,
// required this.isConsultDoctor,
// this.doctorName = '',
// this.value = false,
// this.img,
// required this.code
required this.counterCode,
required this.counterID,
required this.counterIP,
required this.counterIsDedicated,
required this.counterMaxQueue,
required this.counterIsActive,
required this.locationID,
required this.locationName,
required this.serviceID,
this.value = false,
this.sound = false,
});
Layanan.fromJson(Map<String, dynamic> json)
: counterID = int.parse(json['counterID']),
counterCode = json['counterCode'].toString(),
counterIP = json['counterIP'].toString(),
value = false,
sound = false,
counterIsDedicated = json['counterIsDedicated'].toString(),
counterMaxQueue = json['counterMaxQueue'].toString(),
locationID = json['locationID'].toString(),
locationName = json['locationName'].toString(),
serviceID = json['serviceID'].toString(),
counterIsActive = json['counterIsActive'].toString();
Map<String, dynamic> toJson() => {
'counterID': counterID,
'counterCode': counterCode,
'counterIP': counterIP,
'counterIsDedicated': counterIsDedicated,
'counterMaxQueue': counterMaxQueue,
'counterIsActive': counterIsActive,
'locationID':locationID,
'locationName': locationName,
'value': value,
'sound':sound
};
@override
List<Object?> get props => [counterID];
}