You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
760B

  1. part of 'device_bloc.dart';
  2. abstract class DeviceState extends Equatable {
  3. const DeviceState();
  4. @override
  5. List<Object> get props => [];
  6. }
  7. class DeviceInitial extends DeviceState {}
  8. class DisplayDevice extends DeviceState {
  9. List<Device> devices;
  10. bool loading;
  11. String msg;
  12. DisplayDevice({this.devices, this.loading, this.msg});
  13. factory DisplayDevice.loading() {
  14. return DisplayDevice(devices: null, loading: true, msg: null);
  15. }
  16. factory DisplayDevice.data(List<Device> data) {
  17. return DisplayDevice(devices: data, loading: false, msg: null);
  18. }
  19. factory DisplayDevice.error(String msg) {
  20. return DisplayDevice(devices: null, loading: false, msg: msg);
  21. }
  22. @override
  23. List<Object> get props => [devices, loading, msg];
  24. }