first commit
This commit is contained in:
23
lib/repository/sampling_location_repository.dart
Normal file
23
lib/repository/sampling_location_repository.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:queuedisplay/model/sampling_location_model.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
import 'base_repository.dart';
|
||||
|
||||
class SamplingLocationRepository extends BaseRepository {
|
||||
SamplingLocationRepository({required super.dio});
|
||||
Future<List<SamplingLocation>> getData() async {
|
||||
final url =
|
||||
"${Constant.baseUrl}mockup/fo/antrian/AntrianByStationAndLocation/getLocationName";
|
||||
final resp = await getService(service: url);
|
||||
|
||||
final List<SamplingLocation> listLocation = List.empty(growable: true);
|
||||
|
||||
// print(resp);
|
||||
|
||||
resp['data']['records'].forEach((e) {
|
||||
final model = SamplingLocation.fromJson(e);
|
||||
listLocation.add(model);
|
||||
});
|
||||
return listLocation;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user