ApiService<User, UserModel> constructor

ApiService<User, UserModel>({
  1. required BuildContext context,
})

Creates a new ApiService instance with the provided BuildContext.

Implementation

ApiService({
  required this.context,
}) : _authenticationService = Provider.of(context, listen: false) {
  _onAuthStateChangeSubscription =
      _authenticationService.authState.listen(_onAuthStateChanged);
  _onTokenChangeSubscription =
      _authenticationService.tokenState.listen(_onTokenChanged);
}