import 'dart:async';

import 'device_alias_model.dart';

import '../../product/base/bloc/base_bloc.dart';

class HomeBloc extends BlocBase {
  
  final allDevicesAlias = StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkAllDevicesAlias =>
      allDevicesAlias.sink;
  Stream<List<DeviceWithAlias>> get streamAllDevicesAlias =>
      allDevicesAlias.stream;

  final onlineDevicesAlias =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkOnlineDevicesAlias =>
      onlineDevicesAlias.sink;
  Stream<List<DeviceWithAlias>> get streamOnlineDevicesAlias =>
      onlineDevicesAlias.stream;

  final offlineDevicesAlias =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkOfflineDevicesAlias =>
      offlineDevicesAlias.sink;
  Stream<List<DeviceWithAlias>> get streamOfflineDevicesAlias =>
      offlineDevicesAlias.stream;

  final warningDevicesAlias =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkWarningDevicesAlias =>
      warningDevicesAlias.sink;
  Stream<List<DeviceWithAlias>> get streamWarningDevicesAlias =>
      warningDevicesAlias.stream;

  final notUseDevicesAlias =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkNotUseDevicesAlias =>
      notUseDevicesAlias.sink;
  Stream<List<DeviceWithAlias>> get streamNotUseDevicesAlias =>
      notUseDevicesAlias.stream;

  final allDevicesAliasJoined =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkAllDevicesAliasJoined =>
      allDevicesAliasJoined.sink;
  Stream<List<DeviceWithAlias>> get streamAllDevicesAliasJoined =>
      allDevicesAliasJoined.stream;

  final onlineDevicesAliasJoined =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkOnlineDevicesAliasJoined =>
      onlineDevicesAliasJoined.sink;
  Stream<List<DeviceWithAlias>> get streamOnlineDevicesAliasJoined =>
      onlineDevicesAliasJoined.stream;

  final offlineDevicesAliasJoined =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkOfflineDevicesAliasJoined =>
      offlineDevicesAliasJoined.sink;
  Stream<List<DeviceWithAlias>> get streamOfflineDevicesAliasJoined =>
      offlineDevicesAliasJoined.stream;

  final warningDevicesAliasJoined =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkWarningDevicesAliasJoined =>
      warningDevicesAliasJoined.sink;
  Stream<List<DeviceWithAlias>> get streamWarningDevicesAliasJoined =>
      warningDevicesAliasJoined.stream;

  final notUseDevicesAliasJoined =
      StreamController<List<DeviceWithAlias>>.broadcast();
  StreamSink<List<DeviceWithAlias>> get sinkNotUseDevicesAliasJoined =>
      notUseDevicesAliasJoined.sink;
  Stream<List<DeviceWithAlias>> get streamNotUseDevicesAliasJoined =>
      notUseDevicesAliasJoined.stream;

  final countNotitication = StreamController<int>.broadcast();
  StreamSink<int> get sinkCountNotitication => countNotitication.sink;
  Stream<int> get streamCountNotitication => countNotitication.stream;

    final ownerDevicesStatus =
      StreamController<Map<String, List<DeviceWithAlias>>>.broadcast();
  StreamSink<Map<String, List<DeviceWithAlias>>>
      get sinkOwnerDevicesStatus => ownerDevicesStatus.sink;
  Stream<Map<String, List<DeviceWithAlias>>> get streamOwnerDevicesStatus =>
      ownerDevicesStatus.stream;


  @override
  void dispose() {}
}
