40 lines
1.3 KiB
Dart
40 lines
1.3 KiB
Dart
|
|
|
|
import '../app/constant.dart';
|
|
import '../model/layanan_dokter.dart';
|
|
import 'base_repository.dart';
|
|
|
|
class ServiceRepositoryLayananDokter extends BaseRepository {
|
|
ServiceRepositoryLayananDokter({required super.dio});
|
|
Future<List<LayananDokter>> getData() async {
|
|
final url = "${Constant.baseUrl}antrian/layanandokter/list_service";
|
|
final resp = await getService(service: url);
|
|
|
|
final List<LayananDokter> listLayanan = List.empty(growable: true);
|
|
|
|
resp['data']['records'].forEach((e) {
|
|
final model = LayananDokter.fromJson(e);
|
|
listLayanan.add(model);
|
|
});
|
|
return listLayanan;
|
|
}
|
|
|
|
// get data by serviceID
|
|
// Future<List<DisplayModel>> getDataByServiceID(List<int> serviceID) async {
|
|
// Future<List<DisplayModelV2>> getDataByServiceID(List<int> serviceID) async {
|
|
// final url = "${Constant.baseUrl}antrian/layanandokter/list_layanan_dokter";
|
|
// final param = {"serviceId": serviceID};
|
|
|
|
// // print(param);
|
|
|
|
// final resp = await post(service: url, param: param);
|
|
// // print(resp);
|
|
// final List<DisplayModelV2> listDisplay = List.empty(growable: true);
|
|
// resp['data'].forEach((e) {
|
|
// final model = DisplayModelV2.fromJson(e);
|
|
// listDisplay.add(model);
|
|
// });
|
|
// return listDisplay;
|
|
// }
|
|
}
|