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