I'm building a application which retrieve video from firebase firestore using url and displayed in better player.network, the video player fine when it is in portrait mode.But when i press the fullscreenicon, i'm getting error

A VideoPlayerController was used after being disposed. Once you have called dispose() on a VideoplaverController, it can no longer be used.

Here is code:

import 'package:better_player/better_player.dart';

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:responsive_widgets/responsive_widgets.dart';

class videolsight extends StatefulWidget {
  final String courseid;
  videolsight({required this.courseid});

  @override
  _videolsightState createState() => _videolsightState();
}

class _videolsightState extends State<videolsight> {
  final CollectionReference _productRef = FirebaseFirestore.instance.collection("lsight");

  @override
  Widget build(BuildContext context) {
    ResponsiveWidgets.init(
      context,
      height: MediaQuery.of(context).size.height,
      width: MediaQuery.of(context).size.width,
      allowFontScaling: false,
    );
    return ResponsiveWidgets.builder(
      height: MediaQuery.of(context).size.height,
      width: MediaQuery.of(context).size.width,
      allowFontScaling: false,
      child: OrientationBuilder(
        builder: (context, orientation){
      if(orientation == Orientation.portrait){
        return Scaffold(
            body: Stack(
              children: [
                FutureBuilder<dynamic>(
                  future: _productRef.doc(widget.courseid).get(),
                  builder: (context, snapshot) {
                    if (snapshot.hasError) {
                      return Scaffold(
                        body: Center(
                          child: Text("Error : ${snapshot.error}"),
                        ),
                      );
                    }
                    if (snapshot.connectionState == ConnectionState.done) {

                  Map<String, dynamic> documentData = snapshot.data.data();

                  return Scaffold(

                    body: SingleChildScrollView(
                      child: Column(
                        children: [
                          Padding(
                              padding: const EdgeInsets.only(top:20,),
                              child: BetterPlayer.network(documentData["video"],

                              )
                          ),

                          Padding(
                            padding:  const EdgeInsets.only(top: 25,),
                            child: Text("Class Name : ${documentData['name']}", style:  GoogleFonts.poppins(            fontSize: 20,
                                fontWeight: FontWeight.w600
                            ),
                              textAlign: TextAlign.left,
                            ),
                          ),

                        ],
                      ),
                    ),
                  );
                }

                return Scaffold(
                  body: Center(
                    child: CircularProgressIndicator(
                      color: Color(0xff005AA6),
                    ),
                  ),
                );
              },
            ),
            Padding(
              padding: const EdgeInsets.only(top: 320,left: 10),
              child: Text("More on this Course :",style: TextStyle(

                  fontWeight: FontWeight.w800,
                  fontSize: 16
              ),

              ),
            ),
            Padding(
              padding: const EdgeInsets.only(top: 340),
              child: FutureBuilder<QuerySnapshot>(
                future: _productRef.orderBy('class',).get(),
                builder: (context, snapshot) {
                  if (snapshot.hasError) {
                    return Scaffold(
                      body: Center(
                        child: Text("Error : ${snapshot.error}"),
                      ),
                    );
                  }
                  if (snapshot.connectionState == ConnectionState.done) {
                    return ListView(
                      children: snapshot.data!.docs.map((document) {
                        return GestureDetector(
                          onTap: () {
                            Navigator.pushReplacement(context, MaterialPageRoute(
                                builder: (context) =>
                                    videolsight(courseid: document.id,)));

                          },
                          child: Container(
                              decoration: BoxDecoration(
                                borderRadius: BorderRadius.circular(18.0),
                              ),
                              margin: EdgeInsets.symmetric(
                                vertical: 1.0,
                                horizontal: 4.0,
                              ),
                              child: Row(
                                children: [
                                  Padding(
                                    padding: const EdgeInsets.all(8.0),
                                    child: Container(
                                      width: 90,
                                      height: 90,
                                      child: ClipRRect(
                                        borderRadius: BorderRadius.circular(12.0),
                                        child: SvgPicture.network(
                                          "${document['image']}",
                                          fit: BoxFit.cover,
                                          placeholderBuilder: (BuildContext context) => Scaffold(
                                            body: Center(
                                              child: Container(
                                                  width: 50,
                                                  height: 50,

                                                  child: Image.asset("assets/load.gif",) ),
                                            ),
                                          ),

                                        ),
                                      ),
                                    ),
                                  ),
                                  Padding(
                                    padding: const EdgeInsets.all(8.0),
                                    child: Container(
                                      width: MediaQuery
                                          .of(context)
                                          .size
                                          .width*0.60,
                                      child: Text(
                                        document['name'] ?? "Course",
                                        style: TextStyle(
                                            fontWeight: FontWeight.w800,
                                            fontSize: 20
                                        ),),
                                    ),
                                  ),
                                ],
                              )
                          ),
                        );
                      },).toList(),
                    );
                  }
                  return Scaffold(
                    body: Center(
                      child: CircularProgressIndicator(color: Color(0xff005AA6)),
                    ),
                  );
                },
              ),
            ),
          ],
        )
    );}
  else{
    return Scaffold(
      body:  FutureBuilder<dynamic>(
        future: _productRef.doc(widget.courseid).get(),
        builder: (context, snapshot) {
          if (snapshot.hasError) {
            return Scaffold(
              body: Center(
                child: Text("Error : ${snapshot.error}"),
              ),
            );
          }
          if (snapshot.connectionState == ConnectionState.done) {

            Map<String, dynamic> documentData = snapshot.data.data();

            return Scaffold(

              body: SingleChildScrollView(
                child: Column(
                  children: [
                    BetterPlayer.network(documentData["video"],
                      betterPlayerConfiguration: BetterPlayerConfiguration(
                        fullScreenByDefault: true,
                          controlsConfiguration: BetterPlayerControlsConfiguration(
                            fullscreenDisableIcon: Icons.cast,
                            fullscreenEnableIcon:  Icons.cast,
                          )
                      ),
                    ),

                  ],
                ),
              ),
            );
          }

          return Scaffold(
            body: Center(
              child: CircularProgressIndicator(
                color: Color(0xff005AA6),
              ),
            ),
          );
        },
      ),
    );
  }
  }
  ),
);
}
}