48 lines
1.2 KiB
Dart
48 lines
1.2 KiB
Dart
class StaffResponse {
|
|
final String status;
|
|
final List<StaffModel> data;
|
|
|
|
StaffResponse({required this.status, required this.data});
|
|
|
|
factory StaffResponse.fromJson(Map<String, dynamic> json) {
|
|
return StaffResponse(
|
|
status: json['status'] ?? '',
|
|
data: (json['data'] as List<dynamic>)
|
|
.map((item) => StaffModel.fromJson(item))
|
|
.toList(),
|
|
);
|
|
}
|
|
}
|
|
|
|
class StaffModel {
|
|
final int id;
|
|
final String name;
|
|
final String mobile;
|
|
final String email;
|
|
final int status;
|
|
final int generalChat;
|
|
final int createService;
|
|
|
|
StaffModel({
|
|
required this.id,
|
|
required this.name,
|
|
required this.mobile,
|
|
required this.email,
|
|
required this.status,
|
|
required this.generalChat,
|
|
required this.createService,
|
|
});
|
|
|
|
factory StaffModel.fromJson(Map<String, dynamic> json) {
|
|
return StaffModel(
|
|
id: json['id'] ?? 0,
|
|
name: json['name'] ?? '',
|
|
mobile: json['mobile'] ?? '',
|
|
email: json['email'] ?? '',
|
|
status: json['status'] ?? 0,
|
|
generalChat: json['general_chat'] ?? 0,
|
|
createService: json['create_service'] ?? 0,
|
|
);
|
|
}
|
|
}
|