Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

updateGPS_post.dart 835B

12345678910111213141516171819202122232425262728293031323334
  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. class UpdateGPS_Post {
  8. late String id;
  9. late String map;
  10. late int user_id;
  11. UpdateGPS_Post({required this.id});
  12. static Future<String> connectToAPI(String id, String map, int user_id) async {
  13. String URL = baseURL + "/api/update_gps";
  14. var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
  15. "data": [
  16. {
  17. "id": id,
  18. "map": map,
  19. "user_id": user_id
  20. }
  21. ]
  22. }), headers: {
  23. "Content-Type": "application/json",
  24. "Api-key": apiKey
  25. });
  26. //developer.log(sendData.body, name: "GET ALL");
  27. return sendData.body;
  28. }
  29. }