import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:proxibuy/data/models/auth/user_info_model.dart';

part 'user_info_state.dart';

class UserInfoCubit extends Cubit<UserInfoState> {
  UserInfoCubit() : super(UserInfoInitial());

  void getUserInfo() async {
    emit(UserInfoLoadng());
    try {
      // final response = await AuthRepository.fetchUserInfo();
      emit(UserInfoSuccess(
          user: UserInfoModel.fromJson({
        "sub": "f39c8216-388a-44e1-85a8-4f996e66e604",
        "email_verified": true,
        "name": "demo demo",
        "preferred_username": "demo",
        "given_name": "demo",
        "family_name": "demo",
        "email": "demo@gmail.com"
      })));
    } catch (e) {
      emit(UserInfoFail(message: e));
    }
  }
}
