No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

updateGPS_post.dart 817B

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:tower_app/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. }