part of 'devices_cubit.dart'; class ApiDevicesState extends ServerInstallationDependendState { const ApiDevicesState(this._devices, this.status); const ApiDevicesState.initial() : this(const [], LoadingStatus.uninitialized); final List _devices; final LoadingStatus status; 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(); ApiDevicesState copyWith({ final List? devices, final LoadingStatus? status, }) => ApiDevicesState( devices ?? _devices, status ?? this.status, ); @override List get props => [_devices]; }