I have created this Homework bloc class where i get image from gallery and render that image to ui here in eventImageSink i pass event and with this _eventImageStream listen and add image to _stateImageSink and with the help of stateImageStream i am rendering image in my ui with Stream builder but.

enum GetImage { fetchImage }

class HomeworkBloc {
  final ImagePicker imagePicker = ImagePicker();
  List<XFile>? selectedImages;
  List<XFile>? pickedImages;
  final _imageStateStreamController = StreamController<List<XFile>>.broadcast();

  StreamSink<List<XFile>> get _stateImageSink =>
      _imageStateStreamController.sink;

  Stream<List<XFile>> get stateImageStream =>
      _imageStateStreamController.stream;

  final _imageEventStreamController = StreamController<GetImage>();

  StreamSink<GetImage> get eventImageSink => _imageEventStreamController.sink;

  Stream<GetImage> get _eventImageStream => _imageEventStreamController.stream;

  HomeworkBloc() {
    _eventImageStream.listen((event) async {
      if (event == GetImage.fetchImage) {
        if (pickedImages != null) {
          _stateImageSink.add(pickedImages!);
        }
      }
    });
  }

  void selectImage() async {
    selectedImages = await imagePicker.pickMultiImage(
        maxHeight: 800, maxWidth: 800, imageQuality: 100);
    List<XFile> temp = pickedImages ?? [];
    pickedImages = selectedImages;
    pickedImages?.addAll(temp);
  }
}

And i have user stream builder to load image like this

StreamBuilder<List<XFile>?>(
            stream: hB.stateImageStream,
            builder: (ctx, snapShot) {
              if (!snapShot.hasData) {
                return const Center(
                  child: Text("no Data"),
                );
              } else if (snapShot.hasData) {
                return GridView.builder(
                    shrinkWrap: true,
                    itemCount: snapShot.data!.length,
                    gridDelegate:
                        const SliverGridDelegateWithFixedCrossAxisCount(
                            crossAxisCount: 3,
                            crossAxisSpacing: 5,
                            mainAxisSpacing: 5),
                    itemBuilder: (ctx, i) {
                      return Container(
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(10)),
                          child: Stack(
                            children: [
                              Image.file(File(snapShot.data![i].path)),
                              Stack(
                                children: [
                                  Container(
                                    height: 40,
                                    width: 40,
                                    color: Colors.red.withOpacity(0.3),
                                    child: IconButton(
                                        onPressed: () {
                                          setState(() {
                                            snapShot.data!.removeAt(i);
                                          });
                                        },
                                        icon: const Icon(Icons.delete_forever,
                                            color: Colors.white)),
                                  )
                                ],
                              ),
                            ],
                          ));
                    });
              } else {
                return Container();
              }
            },
          ))

Now i am confused that how to pass event to eventImageStream that i have selected new images so render in Ui need some guidence here thanks.