Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

detailSlipGaji_post.dart 981B

123456789101112131415161718192021222324252627282930313233343536
  1. import 'dart:convert';
  2. import 'dart:core';
  3. import 'package:http/http.dart' as http;
  4. import 'package:employee_selfservice_mobile/constants.dart';
  5. import 'dart:developer' as developer;
  6. import 'package:shared_preferences/shared_preferences.dart';
  7. class DetailSlipGaji_Post {
  8. late String batch_id;
  9. late String session;
  10. DetailSlipGaji_Post({required this.session});
  11. static Future<String> connectToAPI(String batch_id) async {
  12. String URL = baseURL + "/api/v1/detail_slip_gaji";
  13. final SharedPreferences prefs = await SharedPreferences.getInstance();
  14. final session = prefs.getString('session');
  15. var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
  16. "data": [
  17. {
  18. "batch_id" : batch_id,
  19. "session": session
  20. }
  21. ]
  22. }), headers: {
  23. "Content-Type": "application/json",
  24. "Api-key": apiKey
  25. });
  26. developer.log(sendData.body, name: "Detail Slip Gaji Result");
  27. return sendData.body;
  28. }
  29. }