showRoomSettingDialog function

Future showRoomSettingDialog(
  1. dynamic context,
  2. EnxController obj
)

Implementation

Future showRoomSettingDialog(context, EnxController obj) {
  return showModalBottomSheet(backgroundColor: Colors.transparent,
      context: context,
      builder: (BuildContext context) {
        return Obx(() => Padding(
          padding:  const EdgeInsets.only(bottom: 120.0,left: 10,right: 10),
          child: Container(
            decoration:  BoxDecoration(color:Colors.white,border: Border.all(
                width: 1.0
            ),
              borderRadius: const BorderRadius.all(
                  Radius.circular(15.0) //                 <--- border radius here
              ),
            ),
            child: ListView(
                shrinkWrap: true,
                children: [

                  Center(
                    child: Padding(
                      padding:  EdgeInsets.all(20.h),
                      child: Text(
                        "Screen Share Control",
                        style: TextStyle(
                          fontSize: 18.sp,
                          color: Theme.of(context).primaryColor,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                    ),
                  ),
                  Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Center(
                      child: DropdownButton<String>( // updated
                          onChanged: (newValue) {
                            obj.selected.value = newValue!; //updated
                          },
                          value: obj.selected.value, //updated
                          items: [
                            for (var value in obj.listType)
                              DropdownMenuItem(
                                value: value,
                                child: Text(
                                  value, //updated
                                ),
                              ),
                          ]),
                    ),
                  ),


                 Center(
                      child: Padding(
                        padding: const EdgeInsets.all(8.0),
                        child: DecoratedBox(
                          decoration: BoxDecoration(
                            gradient: const LinearGradient(
                                colors: [
                                  Colors.pinkAccent,
                                  Colors.pink,
                                  CustomColors.themeColor,
                                ]),
                            borderRadius: BorderRadius.circular(15),),
                          child: ElevatedButton(
                            child: const Text("Apply",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 / 3, 40)),
                            onPressed: () {
                             EnxPubMode enxPubMode= EnxPubMode.all;

                              if(obj.selected.value=='Everyone'){
                                enxPubMode=   EnxPubMode.all;
                              }else if(obj.selected.value=='Moderator Only'){
                                enxPubMode=   EnxPubMode.moderators;
                              }else if(obj.selected.value=='Moderator grants Permission'){
                                enxPubMode=   EnxPubMode.authorize;
                              }
                             obj.setPermissionInShareMode(enxPubMode);
                              Get.back();

                            },
                          ),
                        ),
                      ),
                    ),


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