part of 'device_bloc.dart';

abstract class DeviceState extends Equatable {
  const DeviceState();

  @override
  List<Object> get props => [];
}

class DeviceInitial extends DeviceState {}

class DisplayDevice extends DeviceState {
  List<Device> devices;
  bool loading;
  String msg;

  DisplayDevice({required this.devices, required this.loading, required this.msg});

  factory DisplayDevice.loading() {
    return DisplayDevice(devices: <Device>[], loading: true, msg: '');
  }

  factory DisplayDevice.data(List<Device> data) {
    return DisplayDevice(devices: data, loading: false, msg: '');
  }

  factory DisplayDevice.error(String msg) {
    return DisplayDevice(devices: <Device>[], loading: false, msg: msg);
  }

  @override
  List<Object> get props => [devices, loading, msg];
}
