xLayout_xActionsItem_ViewDett method

Widget xLayout_xActionsItem_ViewDett(
  1. XFDataItem item,
  2. bool dett_Active,
  3. void parentSetState(
    1. void ()
    ),
  4. XView xView_Scheda, {
  5. String? title,
})

Implementation

Widget xLayout_xActionsItem_ViewDett(XFDataItem item, bool dett_Active, void Function(void Function()) parentSetState, XView xView_Scheda, {String? title}) {
  return Container(
      child: PopupMenuButton(
          padding: EdgeInsets.all(0),
          icon: Container(padding: EdgeInsets.all(8), decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: Colors.grey[800]), child: Icon(Icons.edit)),
          iconSize: 22,
          itemBuilder: (context) {
            return [
              PopupMenuItem(
                  height: 40,
                  child: XBtnbase(
                      decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey[700]!))),
                      height: 40,
                      width: 180,
                      label: "Vedi Dettagli",
                      icon_WidthArea: 30,
                      label_Style: XStyles.xStyTextForSubLabel(textColor: Colors.blue),
                      icon: Icons.visibility,
                      icon_Size: 23,
                      icon_Color: Colors.blue,
                      toolTip_Message: "Vedi i dettagli di questa riga",
                      onPressed: () {
                        parentSetState(() {
                          item.isShowDetails = true;
                          item.isSel = item.isSel.not();
                        });
                      })),
              PopupMenuItem(
                  height: 40,
                  child: XBtnbase(
                      decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey[700]!))),
                      height: 40,
                      width: 180,
                      label: "Modifica",
                      icon_WidthArea: 30,
                      label_Style: XStyles.xStyTextForSubLabel(textColor: Colors.yellow),
                      icon: Icons.edit,
                      icon_Size: 23,
                      icon_Color: Colors.yellow,
                      toolTip_Message: "Modifica questa riga",
                      onPressed: () async {
                        super.setState(() => enteredInEditOnCell = true);
                        await showDialog(
                            context: context,
                            builder: (context) {
                              return XAlertDialog(
                                  colorBackGround: XSchedaState.color_BackGround_EditDialog,
                                  actionsBTNarea_Padding: EdgeInsets.symmetric(horizontal: 5),
                                  title_Text: title != null ? "Scheda ${title}" : "Scheda",
                                  btnNO_label: "Annulla",
                                  btnYES_label: "Salva",
                                  btnNO_OnPressed: () => Navigator.pop(context),
                                  btnYES_OnPressed: () => Navigator.pop(context, item),
                                  child: XScheda(
                                    item,
                                    xView_Scheda,
                                    xHeader_AreaBorder: false,
                                    modePage_Active: false,
                                  ));
                            });
                        super.setState(() => enteredInEditOnCell = false);
                      }))
            ];
          }));
}