import 'dart:async';

import '../feature/home/device_alias_model.dart';

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

class HomeBloc extends BlocBase {

  final allDevicesAliasMap = StreamController<Map<String,List<DeviceWithAlias>>>.broadcast();
  StreamSink<Map<String,List<DeviceWithAlias>>> get sinkAllDevicesAliasMap =>
      allDevicesAliasMap.sink;
  Stream<Map<String,List<DeviceWithAlias>>> get streamAllDevicesAliasMap =>
      allDevicesAliasMap.stream;

  final allDevicesAliasJoinedMap = StreamController<Map<String,List<DeviceWithAlias>>>.broadcast();
  StreamSink<Map<String,List<DeviceWithAlias>>> get sinkAllDevicesAliasJoinedMap =>
      allDevicesAliasJoinedMap.sink;
  Stream<Map<String,List<DeviceWithAlias>>> get streamAllDevicesAliasJoinedMap =>
      allDevicesAliasJoinedMap.stream;

  final countNotification = StreamController<int>.broadcast();
  StreamSink<int> get sinkCountNotification => countNotification.sink;
  Stream<int> get streamCountNotification => countNotification.stream;

  final hasJoinedDevice = StreamController<bool?>.broadcast();
  StreamSink<bool?> get sinkHasJoinedDevice => hasJoinedDevice.sink;
  Stream<bool?> get streamHasJoinedDevice => hasJoinedDevice.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() {}
}
