Flutter: Getting out of memory error. Unable to put the dispose function in the proper location

I am using a video player to play the videos I get from my stream builder. I am unable to place my dispose function in such a way that I don’t get this error.

Error is causing the emulator to crash after a certain point.What I tried:

  1. I placed the dispose after initializing the video player but has not worked because I am initializing the video player again.
  2. I tried putting in the build function of stream builder too but it does not work

My screen where I am getting this error:

class _PageViewBuilderState extends State<PageViewBuilder> {
  VideoPlayerController? INvideoPlayerController;
  @override
  void initState() {
    super.initState();
    INvideoPlayerController = VideoPlayerController.network('')
      ..addListener(() {})
      ..setLooping(true)
      ..initialize().then((value) => INvideoPlayerController!.play());
  }

  @override
  void dispose() {
    INvideoPlayerController?.dispose();
    super.dispose();
  }

  int _currentPage = 0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
          stream:
              FirebaseFirestore.instance.collection('Videourls').snapshots(),
          builder: (ctx, snapshot) {
            if (snapshot.hasError) {
              const Center(
                child: Text('Unknown Error'),
              );
            }

            return !snapshot.hasData
                ? const Center(
                    child: CircularProgressIndicator(),
                  )
                : PageView.builder(
                    scrollDirection: Axis.vertical,
                    itemCount: snapshot.data!.docs.length,
                    onPageChanged: (int page) {
                      setState(() {
                        _currentPage = page;
                      });
                    },
                    itemBuilder: (BuildContext context, int index) {
                      INvideoPlayerController = VideoPlayerController.network(
                        snapshot.data!.docs[index].get('url'),
                      )
                        ..setLooping(true)
                        ..initialize()
                            .then((value) => INvideoPlayerController!.play());
                      return Stack(alignment: Alignment.center, children: [
                        AspectRatio(
                          aspectRatio: MediaQuery.of(context).size.width /
                              MediaQuery.of(context).size.height,
                          //  INvideoPlayerController!.value.aspectRatio,
                          child: VideoPlayer(INvideoPlayerController!),
                        ),
                        Container(),
                          ]),
                        ])
                      ]);
                    },
                  );
          }),
    );
  }
}

I am trying to load videos from my firestore storage on the app.