Implementation
Widget? xLayout_ItemWidget(K item) {
return widget.schedaMode == true
? XElencoItem(item, widget.view!,
funct: widget.functInItem,
showingDetails: item.isShowDetails,
margin: EdgeInsets.symmetric(vertical: 2),
backGroundColor_ChildMain: (item.isShowDetails ? Colors.grey[900] : widget.item_BackGroundColor ?? (widget.appBar_Color == null ? widget.item_BackGroundColor ?? Color.fromARGB(255, 23, 23, 23) : widget.appBar_Color!.withAlpha(30))),
backGroundColor_ChildDetails: (item.isShowDetails ? Colors.grey[900] : widget.item_BackGroundColor ?? (widget.appBar_Color == null ? widget.item_BackGroundColor ?? Color.fromARGB(255, 23, 23, 23) : widget.appBar_Color!.withAlpha(30))),
onDoubleTapItem: widget.onDoubleTapItem,
showTrailingArrow: false,
widgets_LeftArea: xLayout_WidgetsLeftArea_Item(item, setState),
onTapItem: widget.onTapItem != null ? () => widget.onTapItem!(item) : null,
onLongTapItem: () => xOnLongTapItem(item),
xLayout_Item_RowWidgets: (xCol, item) => xLayout_Item_RowWidgets(xCol, item),
edited: widget.edited!,
//Widget che raffigura i dettagli che sono dentro la riga espansa
childDetails: Column(mainAxisSize: MainAxisSize.min, children: [(widget.liDettsSubArea_Widgets != null ? widget.liDettsSubArea_Widgets!(item) ?? Container() : Container())]))
: (widget.elDettsMode_SchItem != null && widget.elDettsMode_SchItem!)
? xLayout_DettItemWidget(item) ??
XElencoItem(item, widget.view!,
funct: widget.functInItem,
showingDetails: item.isShowDetails,
margin: EdgeInsets.symmetric(vertical: 2),
backGroundColor_ChildMain: (item.isShowDetails ? Colors.grey[900] : widget.item_BackGroundColor ?? (widget.appBar_Color == null ? widget.item_BackGroundColor ?? Color.fromARGB(255, 23, 23, 23) : widget.appBar_Color!.withAlpha(30))),
backGroundColor_ChildDetails: (item.isShowDetails ? Colors.grey[900] : widget.item_BackGroundColor ?? (widget.appBar_Color == null ? widget.item_BackGroundColor ?? Color.fromARGB(255, 23, 23, 23) : widget.appBar_Color!.withAlpha(30))),
onDoubleTapItem: widget.onDoubleTapItem,
widgets_LeftArea: xLayout_WidgetsLeftArea_Item(item, setState),
showTrailingArrow: true,
xLayout_Item_RowWidgets: (xCol, item) => xLayout_Item_RowWidgets(xCol, item),
onTapItem: widget.onTapItem != null ? () => widget.onTapItem!(item) : null,
onLongTapItem: () => xOnLongTapItem(item),
// onLongTapItem: widget.onLongTapItem != null ? widget.onLongTapItem!(item) : null,
edited: widget.edited!,
// onTapItem: () async {
// xOnTapItem(item);
// if (widget.onTapItem != null) {
// widget.onTapItem!();
// }
// (widget.schNameToOpen != null
// ? Navigator.pushNamed(context, widget.schNameToOpen!, arguments: item).then((value) {
// setState(() {
// isBusy = false;
// });
// rebuildAllChildren(context);
// }) //
// : setState(() => item.isShowDetails = item.isShowDetails.not()));
// },
//Widget che raffigura la riga che si espande
// childMain: Container(
// // decoration: item.isShowDetails ? BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: Colors.white))) : null,
// padding: EdgeInsets.symmetric(horizontal: 2, vertical: 8),
// child: Row(children: [
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: widget.view!.cols.groupListsBy((element) => element.originY).entries.map((e) {
// return Wrap(
// spacing: 3,
// runSpacing: 5,
// children: e.value.map((e) {
// return xLayout_Item_RowWidgets(e, item);
// }).toList());
// }).toList())),
// li.isNotEmpty ? Text((widget.viewDetts!.title ?? "") + ": " + (li.isNotEmpty ? (li.length.toString()) : "0"), style: XStyles.xStyTextForDescr(Colors.white), textAlign: TextAlign.end, overflow: TextOverflow.ellipsis) : Container(),
// xLayout_BTN_Function(item),
// (t != null && t.isNotEmpty) ? xLayout_BTN_ExpandedItem(item) : Container()
// ])),
//Widget che raffigura i dettagli che sono dentro la riga espansa
childDetails: Container(width: MediaQuery.of(context).size.width, child: XScheda(widget.key, item, widget.viewDetts!, modePage_Active: false)))
: xLayout_DettItemWidget(item) ??
XElencoItem(item, widget.view!,
funct: widget.functInItem,
showingDetails: item.isShowDetails,
margin: EdgeInsets.symmetric(vertical: 2),
backGroundColor_ChildMain: (item.isShowDetails ? Colors.grey[900] : widget.item_BackGroundColor ?? (widget.appBar_Color == null ? widget.item_BackGroundColor ?? Color.fromARGB(255, 23, 23, 23) : widget.appBar_Color!.withAlpha(30))),
backGroundColor_ChildDetails: (item.isShowDetails ? Colors.grey[900] : widget.item_BackGroundColor ?? (widget.appBar_Color == null ? widget.item_BackGroundColor ?? Color.fromARGB(255, 23, 23, 23) : widget.appBar_Color!.withAlpha(30))),
onDoubleTapItem: widget.onDoubleTapItem,
edited: widget.edited!,
showTrailingArrow: false,
widgets_LeftArea: xLayout_WidgetsLeftArea_Item(item, setState),
onLongTapItem: () => xOnLongTapItem(item),
onTapItem: () async {
await xOnTapItem(item);
if (widget.onTapItem != null) {
widget.onTapItem!(item);
}
(widget.schNameToOpen != null && widget.schedaMode == false
? Navigator.pushNamed(context, widget.schNameToOpen!, arguments: item).then((value) {
setState(() {
isBusy = false;
widget.xOnReturnBack != null ? widget.xOnReturnBack!(setState) : null;
widget.edited!.value;
});
rebuildAllChildren(context);
}) //
: setState(() => item.isShowDetails = item.isShowDetails.not()));
},
xLayout_Item_RowWidgets: (xCol, item) => xLayout_Item_RowWidgets(xCol, item),
//Widget che raffigura la riga che si espande
// childMain: Container(
// decoration: item.isShowDetails ? BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: Colors.white))) : null,
// padding: EdgeInsets.symmetric(horizontal: 2, vertical: 8),
// child: Row(children: [
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: widget.view!.cols.groupListsBy((element) => element.originY).entries.map((e) {
// return Wrap(
// spacing: 3,
// runSpacing: 5,
// children: e.value.map((e) {
// return xLayout_Item_RowWidgets(e, item);
// }).toList());
// }).toList())),
// li.isNotEmpty ? Text((widget.viewDetts!.title ?? "") + ": " + (li.isNotEmpty ? (li.length.toString()) : "0"), style: XStyles.xStyTextForDescr(Colors.white), textAlign: TextAlign.end, overflow: TextOverflow.ellipsis) : Container(),
// xLayout_BTN_Function(item),
// (t != null && t.isNotEmpty) ? xLayout_BTN_ExpandedItem(item) : Container()
// ])),
//Widget che raffigura i dettagli che sono dentro la riga espansa
childDetails: Column(mainAxisSize: MainAxisSize.min, children: [(widget.liDettsSubArea_Widgets != null ? widget.liDettsSubArea_Widgets!(item) ?? Container() : Container())]));
}