import 'package:flutter/foundation.dart';

import '../networking/dio_http_service.dart';
import '../networking/restful_api_client.dart';
import '../networking/restful_api_client_all_request.dart';
import '../preference/data_preference.dart';

class LogoutService {
  LogoutService._();
  static final RestfulAPIClient _client = RestfulAPIClient(DioHttpService().dio);
  static Future<void> logout() async {
    if (!DataPreference.instance.logged) return;
    try {
      await _client.logout();
    } catch (e) {
      if (kDebugMode) {
        print('LogoutService.logout failed: $e');
      }
    }
  }
}
