1234567891011121314151617181920212223242526272829303132 |
- import 'dart:convert';
- import 'dart:core';
- import 'package:flutter/material.dart';
- import 'package:http/http.dart' as http;
- import 'package:tower_app/constants.dart';
- import 'dart:developer' as developer;
-
- import 'package:shared_preferences/shared_preferences.dart';
-
- class GetHistory_Post {
- late int user_id;
-
- GetHistory_Post({required this.user_id});
-
- static Future<String> connectToAPI(int user_id) async {
- String URL = baseURL + "/api/history";
-
- var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
- "data": [
- {
- "user_id": user_id
- }
- ]
- }), headers: {
- "Content-Type": "application/json",
- "Api-key": apiKey
- });
-
- //developer.log(sendData.body, name: "GET ALL");
- return sendData.body;
- }
- }
|