1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import 'dart:convert';
- import 'dart:core';
- import 'package:flutter/material.dart';
- import 'package:http/http.dart' as http;
- import 'package:employee_selfservice_mobile/constants.dart';
- import 'dart:developer' as developer;
-
- import 'package:shared_preferences/shared_preferences.dart';
-
- class FilingData_Post {
- late String id;
- late String amount;
- late String kk;
- late String ktp;
- late String npwp;
- late int user_id;
-
- FilingData_Post({required this.amount, required this.kk, required this.ktp, required this.npwp});
-
- static Future<String> connectToAPI(String id, String amount, String kk, String ktp, String npwp, int user_id) async {
- String URL = baseURL + "/api/filing_data";
-
- final SharedPreferences prefs = await SharedPreferences.getInstance();
-
- var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
- "data": [
- {
- "id": id,
- "amount": amount,
- "kk": kk,
- "ktp": ktp,
- "npwp": npwp,
- "user_id": user_id
- }
- ]
- }), headers: {
- "Content-Type": "application/json",
- "Api-key": apiKey
- });
-
- //developer.log(sendData.body, name: "GET ALL");
- return sendData.body;
- }
- }
|