How to write test cases for immutable states of BLoC build with buit_value in flutter

i try to write tests for my code where i am using BLoC as state management and inside bloc i created variable states using buil_value, which is

import 'package:built_value/built_value.dart';
import 'package:equatable/equatable.dart';
import '../../domain/entity/user_entity.dart';

part 'login_state.g.dart';

abstract class LoginState implements Built<LoginState,LoginStateBuilder> {
  bool? get isSuccess;
  bool? get isLoading;
  String? get error;
  UserEntity? get user;
  bool? get isOffline;
  LoginState._();

  factory LoginState([void Function(LoginStateBuilder) updates]) = _$LoginState;
  factory LoginState.initial() {
    return LoginState((b) => b
      ..isLoading = false
      ..isSuccess = false
      ..isOffline = false
      ..error = ''
      ..user = UserEntity()
    );
  }}

i am using clean code architecture where data layer, domain layer and presentation layer are properly define and implemented,
but when i try to write test for my code i couldn’t able to do that maybe because im creating states in different way and also cant make states equatable because im already generating code through built value and its not allowing it,
so if i cant write test cases by using this method, then what is the best approach to do that?
my test case is

import 'login_test.mocks.dart';

@GenerateMocks([LoginUseCase])
void main() {
  late LoginBloc loginBloc;
  late MockLoginUseCase mockLoginUseCase;

  setUp(() {
    mockLoginUseCase = MockLoginUseCase();
    loginBloc = LoginBloc(loginUseCase: mockLoginUseCase);
  });

  group('LoginBloc Tests', () {
    final email = '[email protected]';
    final password = 'password';
    final loginParams = LoginParams(email: email, password: password);
    final userEntity = UserEntity(id: 1, email: email, name: 'Test User'); // Adjust based on your UserEntity

    blocTest<LoginBloc, LoginState>(
      'emits [isLoading: true, isSuccess: false, error: ""] then [isLoading: false, isSuccess: true, user: userEntity, error: ""] when LoginUserEvent is added and login is successful',
      setUp: () {
        when(mockLoginUseCase.execute(params: loginParams))
            .thenAnswer((_) async => Right(userEntity));
      },
      build: () => loginBloc,
      act: (bloc) => bloc.add(LoginUserEvent(params: loginParams)),
      expect: () => [
        LoginState.initial().rebuild((b) => b
          ..isLoading = true
          ..isSuccess = false
          ..error = ''),
        LoginState.initial().rebuild((b) => b
          ..isLoading = false
          ..isSuccess = true
          ..user = userEntity
          ..error = ''),
      ],
    );

    blocTest<LoginBloc, LoginState>(
      'emits [isLoading: true, isSuccess: false, error: ""] then [isLoading: false, isSuccess: false, error: "Login Failed"] when LoginUserEvent is added and login fails',
      setUp: () {
        when(mockLoginUseCase.execute(params: loginParams))
            .thenAnswer((_) async => Left(ErrorModel(statusCode: 400, status: "error", message: "Login Failed")));
      },
      build: () => loginBloc,
      act: (bloc) => bloc.add(LoginUserEvent(params: loginParams)),
      expect: () => [
        LoginState.initial().rebuild((b) => b
          ..isLoading = true
          ..isSuccess = false
          ..error = ''),
        LoginState.initial().rebuild((b) => b
          ..isLoading = false
          ..isSuccess = false
          ..error = 'Login Failed'),
      ],
    );
  });
}

and the error code im facing is

Error resuming isolate isolates/2042399400965491: 106 Isolate must be paused
r
package:bloc_test/src/bloc_test.dart 236:7  testBloc

Expected: [
            _$LoginState:LoginState {  
            isSuccess=false,  
            isLoading=true,  
            error=,  
            user=Instance of 'UserEntity',  
            isOffline=false,  
          },
            _$LoginState:LoginState {  
            isSuccess=true,  
            isLoading=false,  
            error=,  
            user=Instance of 'UserEntity',  
            isOffline=false,  
          }
          ]
  Actual: [
            _$LoginState:LoginState {  
            isSuccess=false,  
            isLoading=true,  
            error=,  
            user=Instance of 'UserEntity',  
            isOffline=false,  
          },
            _$LoginState:LoginState {  
            isSuccess=true,  
            isLoading=false,  
            error=,  
            user=Instance of 'UserEntity',  
            isOffline=false,  
          }
          ]
   Which: at location [0] is _$LoginState:<LoginState {
            isSuccess=false,
            isLoading=true,
            error=,
            user=Instance of 'UserEntity',
            isOffline=false,
          }> instead of _$LoginState:<LoginState {
            isSuccess=false,
            isLoading=true,
            error=,
            user=Instance of 'UserEntity',
            isOffline=false,
          }>

WARNING: Please ensure state instances extend Equatable, override == and hashCode, or implement Comparable.
Alternatively, consider using Matchers in the expect of the blocTest rather than concrete state instances.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật