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

30 lines
541 B
Dart
Raw Normal View History

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';
2019-08-27 11:18:02 +00:00
Future<bool> requestLogoutAPI() async {
saveLogout();
2019-08-20 12:54:45 +00:00
final url = "https://dev.localspend.co.uk/api/logout";
var token;
await getToken().then((result) {
token = result;
});
Map<String, String> body = {
"Token": token,
};
2019-08-27 11:18:02 +00:00
await http.post(
url,
body: json.encode(body),
);
2019-08-27 11:18:02 +00:00
return true;
}