import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';

import 'client/base_app_client.dart';

class BaseService {
  String error;
  bool hasError = false;
  BaseAppClient baseAppClient = BaseAppClient();
  AuthenticatedUser user;

  AppSharedPreferences sharedPref = AppSharedPreferences();

  BaseService() {
    _getUser();
  }

  _getUser() async {
    var userData = await sharedPref.getObject(USER_PROFILE);
    if (userData != null) user = AuthenticatedUser.fromJson(userData);
  }
}
