Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

startFiling_post.dart 873B

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