part of 'devices_bloc.dart'; sealed class DevicesState extends Equatable { DevicesState({ required final List devices, }) : _hashCode = devices.hashCode; final int _hashCode; List get _devices => getIt().apiData.devices.data ?? const []; List get devices => _devices; ApiToken get thisDevice => _devices.firstWhere( (final device) => device.isCaller, orElse: () => ApiToken( name: 'Error fetching device', isCaller: true, date: DateTime.now(), ), ); List get otherDevices => _devices.where((final device) => !device.isCaller).toList(); } class DevicesInitial extends DevicesState { DevicesInitial() : super(devices: const []); @override List get props => [_hashCode]; } class DevicesLoaded extends DevicesState { DevicesLoaded({required super.devices}); @override List get props => [_hashCode]; } class DevicesError extends DevicesState { DevicesError() : super(devices: const []); @override List get props => [_hashCode]; } class DevicesDeleting extends DevicesState { DevicesDeleting({required super.devices}); @override List get props => [_hashCode]; }