This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
LocalSpend-Tracker/lib/common/apifunctions/request_logout_api.dart
2019-08-27 12:18:02 +01:00

29 lines
541 B
Dart

import 'dart:async';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:local_spend/common/functions/get_token.dart';
import 'package:local_spend/common/functions/save_logout.dart';
Future<bool> requestLogoutAPI() async {
saveLogout();
final url = "https://dev.localspend.co.uk/api/logout";
var token;
await getToken().then((result) {
token = result;
});
Map<String, String> body = {
"Token": token,
};
await http.post(
url,
body: json.encode(body),
);
return true;
}