confirmationScreen function

Widget confirmationScreen(
  1. dynamic context,
  2. EnxController obj
)

Implementation

Widget confirmationScreen(context, EnxController obj) {

  int safeAreaHeight =  (Get.window.viewPadding.bottom.toInt() == 0) ? 20 : Get.window.viewPadding.bottom.toInt();
  return Container(
    color: Colors.white,
    child: Column(
      children: [
        MediaQuery.of(context).orientation==Orientation.portrait?
        Stack(
          alignment: Alignment.bottomCenter,

          children: [
            SizedBox(
              width: MediaQuery.of(context).size.width-MediaQuery.of(context).padding.left + MediaQuery.of(context).padding.right,
              height:Platform.isIOS? MediaQuery.of(context).size.height-safeAreaHeight: Get.height-Get.window.viewPadding.top/2.5-Get.window.viewPadding.bottom ,

          child:obj.isSelected[1]||obj.isSelected[2]?Container(color: Colors.grey,child: const Icon(Icons.videocam_off_outlined),) :Platform.isAndroid
              ? EnxPlayerWidget(
            0,
            local: true,
            zMediaOverlay: false,
            height: MediaQuery.of(context).size.height ~/ 1.6,
          )
              : EnxPlayerWidget(0,
            local: true,
            width: (MediaQuery.of(context).size.width-MediaQuery.of(context).padding.left +
                MediaQuery.of(context).padding.right).toInt(),
            height: (MediaQuery.of(context).size.height-safeAreaHeight).toInt(),),
        ),
          Padding(
            padding:  EdgeInsets.all(MediaQuery.of(context).size.width/35),
            child: Card(
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(MediaQuery.of(context).size.width/20),
              ),
            elevation: 15,
              child: Padding(
                padding:  EdgeInsets.only(left:MediaQuery.of(context).size.width/20,top:MediaQuery.of(context).size.width/18,bottom: MediaQuery.of(context).size.width/18,right: MediaQuery.of(context).size.width/20),
                child: Wrap(
                  crossAxisAlignment: WrapCrossAlignment.center,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        ToggleButtons(
                          children: <Widget>[
                            obj.isSelected.first?Icon(Icons.mic_off_outlined):Icon(Icons.mic_none_outlined),
                            obj.isSelected[1]? Icon(Icons.videocam_off_outlined):Icon(Icons.video_call_outlined),
                              Padding(
                              padding: EdgeInsets.all(MediaQuery.of(context).size.width/48),
                              child:const Row(
                                children: [
                                  Icon(Icons.mic_none_outlined),
                                  Text("Audio Only"),
                                ],
                              ),
                            ),

                          ],
                          isSelected: obj.isSelected,
                          onPressed: (int index) {
                            if(index==2) {
                              obj.isSelect.value[index] = !obj.isSelect.value[index];
                              if(obj.isVideoSelected.value) {
                                obj.isSelect.value[1]=obj.isSelect.value[1];
                              } else {
                                obj.isSelect.value[1]=!obj.isSelect.value[1];
                              }

                            }
                            else{
                              if(obj.isSelect[2]) {
                                if(obj.isSelect[1]) {
                                  obj.isSelect.value[1] = obj.isSelect.value[1];
                                }
                              } else {
                                if(index==1){
                                  obj.isVideoSelected.value=!obj.isVideoSelected.value;
                                }
                                obj.isSelect.value[index] = !obj.isSelect.value[index];
                              }
                            }
                            obj.isSelect.refresh();
                          },
                          // region example 1
                          color: Colors.grey,
                          selectedColor: CustomColors.themeColor,
                          // endregion
                          // region example 2
                          borderColor: Colors.grey,
                          selectedBorderColor: CustomColors.themeColor,

                           constraints: BoxConstraints(
                              minHeight: 40, minWidth: MediaQuery.of(context).size.width/5),
                          // endregion
                        ),
                        GestureDetector(
                          onTap: (){
                            obj.settingListItem();
                            Get.to(() => SettingScreen(obj),
                                transition: Transition.leftToRight,
                                duration: const Duration(seconds: 1));

                          },
                          child: Container(
                            decoration: BoxDecoration(
                                border: Border.all(color: Colors.grey),),
                              child:  Padding(
                                padding: EdgeInsets.all(MediaQuery.of(context).size.width/50),
                                child: Icon(Icons.settings_outlined),
                              )),
                        ),
                      ],
                    ),

                    Padding(
                      padding:  EdgeInsets.only(top:MediaQuery.of(context).size.width/20),
                      child: Center(
                        child: DecoratedBox(
                         decoration: BoxDecoration(
                           gradient: const LinearGradient(
                                   colors: [
                                     Colors.pinkAccent,
                                     Colors.pink,
                                     CustomColors.themeColor,
                                     ]),
                            borderRadius: BorderRadius.circular(15),),
                          child: ElevatedButton(
                            child: const Text("Join Now",style: TextStyle(color: Colors.white,fontWeight: FontWeight.w400,fontSize: 15),),
                            style: ElevatedButton.styleFrom(
                                backgroundColor: Colors.transparent,
                                disabledForegroundColor: Colors.transparent.withOpacity(0.38),
                                disabledBackgroundColor: Colors.transparent.withOpacity(0.12),
                                shadowColor: Colors.transparent,
                                elevation: 5,
                                shape:RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(15.0),) ,
                                fixedSize: Size(MediaQuery.of(context).size.width / 2, 50)),
                            onPressed: () {
                              obj.isConfirmation.value=false;
                              obj.configureRoom();
                            },
                          ),
                        ),
                      ),
                    ),
                  ]
                ),
              ),
            ),
          ),
          ],):
          Row(
           crossAxisAlignment: CrossAxisAlignment.center,
            children:[
            SizedBox(
          width: MediaQuery.of(context).size.width/2,
          height: MediaQuery.of(context).size.height-35,
          child:obj.isSelected[1]||obj.isSelected[2]?Container(color: Colors.grey,child: const Icon(Icons.videocam_off_outlined),) :Platform.isAndroid
              ? EnxPlayerWidget(
            0,
            local: true,
            zMediaOverlay: false,
            height: MediaQuery.of(context).size.height ~/ 1.6,
          )
              : AspectRatio(
              aspectRatio: 3 / 2,
              child: EnxPlayerWidget(
                0,
                local: true,
                height: MediaQuery.of(context).size.height ~/ 1.6,
                width: MediaQuery.of(context).size.width.toInt(),
              )),
        ),
              SizedBox(
          width:MediaQuery.of(context).size.width/2,
            child: Wrap(
              alignment: WrapAlignment.center,
              children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  ToggleButtons(

                    children: <Widget>[
                      obj.isSelected.first?Icon(Icons.mic_off_outlined):Icon(Icons.mic_none_outlined),
                      obj.isSelected[1]? Icon(Icons.videocam_off_outlined):Icon(Icons.video_call_outlined),
                       Padding(
                        padding: EdgeInsets.all(MediaQuery.of(context).size.height/55),
                        child:const Row(
                          children: [
                            Icon(Icons.mic_none_outlined),
                            Text("Audio Only"),
                          ],
                        ),
                      ),

                    ],
                    isSelected: obj.isSelected,
                    onPressed: (int index) {
                      if(index==2) {
                        obj.isSelect.value[index] = !obj.isSelect.value[index];
                        if(obj.isVideoSelected.value) {
                          obj.isSelect.value[1]=obj.isSelect.value[1];
                        } else {
                          obj.isSelect.value[1]=!obj.isSelect.value[1];
                        }

                      }
                      else{
                        if(obj.isSelect[2]) {
                          if(obj.isSelect[1]) {
                            obj.isSelect.value[1] = obj.isSelect.value[1];
                          }
                        } else {
                          if(index==1){
                            obj.isVideoSelected.value=!obj.isVideoSelected.value;
                          }
                          obj.isSelect.value[index] = !obj.isSelect.value[index];
                        }
                      }
                      obj.isSelect.refresh();
                    },
                    // region example 1
                    color: Colors.grey,
                    selectedColor: CustomColors.themeColor,
                    // endregion
                    // region example 2
                    borderColor: Colors.grey,
                    selectedBorderColor: CustomColors.themeColor,
                    constraints: BoxConstraints(
                        minHeight: 40, minWidth: MediaQuery.of(context).size.width/8),
                    // endregion
                  ),
                  GestureDetector(
                    onTap: (){
                      obj.settingListItem();
                      Get.to(() => SettingScreen(obj),
                          transition: Transition.leftToRight,
                          duration: const Duration(seconds: 1));
                    },
                    child: Container(
                        decoration: BoxDecoration(
                          border: Border.all(color: Colors.grey),),
                        child:  Padding(
                          padding: EdgeInsets.all(MediaQuery.of(context).size.height/45),
                          child: Icon(Icons.settings_outlined),
                        )),
                  ),
                ],
              ),
              Padding(
                padding:  EdgeInsets.only(top:MediaQuery.of(context).size.height/10,left:MediaQuery.of(context).size.height/8,right: MediaQuery.of(context).size.height/8 ),
                child: Center(
                  child: DecoratedBox(
                    decoration: BoxDecoration(
                      gradient: const LinearGradient(
                          colors: [
                            Colors.pinkAccent,
                            Colors.pink,
                            CustomColors.themeColor,
                          ]),
                      borderRadius: BorderRadius.circular(15),),
                    child: ElevatedButton(
                      child: const Text("Join Now",style: TextStyle(color: Colors.white,fontWeight: FontWeight.w400,fontSize: 15),),
                      style: ElevatedButton.styleFrom(
                          backgroundColor: Colors.transparent,
                          disabledForegroundColor: Colors.transparent.withOpacity(0.38),
                          disabledBackgroundColor: Colors.transparent.withOpacity(0.12),
                          shadowColor: Colors.transparent,
                          elevation: 5,
                          shape:RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(15.0),) ,
                          fixedSize: Size(MediaQuery.of(context).size.width / 2, 50)),
                      onPressed: () {
                        obj.isConfirmation.value=false;
                        obj.configureRoom();
                      },
                    ),
                  ),
                ),
              ),],),
          )
          ],)

      ],
    ),
  );
}