step 18 : history widget atas cmp
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:app_petty_cash/model/list_type_model.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
import '../model/history_transaksi_model.dart';
|
||||
import '../model/list_category_model.dart';
|
||||
import 'base_repository.dart';
|
||||
|
||||
@@ -93,4 +94,31 @@ class TransaksiRepository extends BaseRepository {
|
||||
|
||||
return resp['status'];
|
||||
}
|
||||
|
||||
// list history transaksi
|
||||
Future<List<HistoryTransaksiModel>> getListHistoryTransaksi(
|
||||
String companyid,
|
||||
String tglAwal,
|
||||
String tglAkhir,
|
||||
String categoryid,
|
||||
) async {
|
||||
final service =
|
||||
"${Constant.baseUrlDevone}/homescreen/list_transaction/?companyid=$companyid&startdate=$tglAwal&enddate=$tglAkhir&kategoriid=$categoryid";
|
||||
// https://devone.aplikasi.web.id/one-api-pettycash/pettycash/history/list_transaction/?companyid=1&startdate=2023-12-01&enddate=2023-12-30&kategoriid=0
|
||||
final resp = await get(
|
||||
// param: {
|
||||
// "": "",
|
||||
// },
|
||||
service: service,
|
||||
);
|
||||
|
||||
print("url list history transaksi : $service");
|
||||
|
||||
final result = List<HistoryTransaksiModel>.empty(growable: true);
|
||||
resp['data'].forEach((e) {
|
||||
final model = HistoryTransaksiModel.fromJson(e);
|
||||
result.add(model);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user