GSI - Employe Self Service Mobile
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.
|
|
import 'dart:convert'; import 'dart:core'; 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 CheckOut_Post { late String session; late String coordinate;
CheckOut_Post({required this.session});
static Future<String> connectToAPI(String coordinate) async { String URL = baseURL + "/api/v1/check_out";
final SharedPreferences prefs = await SharedPreferences.getInstance(); final session = prefs.getString('session');
var sendData = await http.post(Uri.parse(URL), body: jsonEncode({ "data": [ { "session": session, "coordinate" : coordinate } ] }), headers: { "Content-Type": "application/json", "Api-key": apiKey });
//developer.log(sendData.body, name: "Get Check Out Result");
return sendData.body; } }
|