showSwitchAudioDialog function

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

Implementation

Future<dynamic> showSwitchAudioDialog(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,
               clipBehavior: Clip.hardEdge,
                children: [
                  for (var item in obj.mediaDeviceList)
                    RadioListTile<MediaDeviceModel>(
                      title: Text(
                        item.name,
                        style: TextStyle(
                            color: Colors.black,
                            fontWeight: FontWeight.w800,
                            fontSize: 16.sp),
                      ),
                      value:item,
                      groupValue: obj.selectedMediaDeviceModel.value,
                      activeColor: Colors.red,
                      selected: item.status,
                      onChanged: (selected) {
                        if (kDebugMode) {
                          print("12345${selected?.selectedIndex}");
                        }
                        if(selected != null) {
                          obj.selectedMediaDeviceModel.value= selected;
                          obj.selectedDevice.value=selected.name;
                        }
                    // item=selected!;
                      //  obj.mediaDeviceList[obj.mediaDeviceList.indexWhere((element) => element.name==selected.name)] = selected;

                        //item.selectedIndex=selectedVal.;
                      //  obj.selectedDevice.value=selectedVal;
                         Get.back();
                      },
                    )

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