showYouTubeDialog function

void showYouTubeDialog(
  1. BuildContext context
)

Implementation

void showYouTubeDialog(BuildContext context) {
  final youtubeController = YoutubePlayerController.fromVideoId(
    videoId: Constants.YOUTUBE_ID,
    autoPlay: false,
  );
  showDialog(
    context: context,
    builder: (context) {
      return  SingleChildScrollView(child:  Column(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.end,
            children: [
              Padding(padding: const EdgeInsets.fromLTRB(0, 30, 30, 0),
                child: GestureDetector(
                  child:   const Icon(Icons.close,size: 30,color: Colors.white,),
                  onTap: (){
                    Navigator.pop(context);
                  },
                ),
              ),

            ],
          ),
          Dialog(
            shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
            child:  SizedBox(

              width: context.x/1.2,
              child:  YoutubePlayer(
                enableFullScreenOnVerticalDrag: true,

                controller: youtubeController,

              ),
            ),
          )
        ],
      ),);
    },
  );
}