One_ConcatenatedXItem<T> static method

Widget One_ConcatenatedXItem<T>({
  1. required double fontSizeForItem,
  2. required String title,
  3. required Color? titleColor,
  4. required List<T> items,
  5. required Widget widgetItemInList(
    1. T
    ),
  6. double? height,
  7. double? fontSizeForTitleOfArea,
  8. Axis? wrapDirectionForList,
  9. bool titleOnTop = true,
  10. bool borderAllAroundList = true,
  11. Color? backGroundColorTitleContainer,
  12. Color? backGroundColor,
  13. Color? titleBorderColor,
  14. double? titleContainerHeight,
  15. double? titleContainerWidth,
  16. AlignmentGeometry? titleAlignOnTop,
  17. AlignmentGeometry? titleAlignOnLeft,
  18. AlignmentGeometry? alignmentChild,
})

Implementation

static Widget One_ConcatenatedXItem<T>({
  ///fontSize testi dell'Item principale (Padre)
  required double fontSizeForItem,

  ///Titolo dell'Item principale (Padre)
  required String title,

  ///Colore del titolo dell'Item principale (Padre)
  required Color? titleColor,

  ///Prima lista di Items che conterrĂ  l'Item principale (Padre)
  required List<T> items,

  ///Widget per la visualizzazione per gli items della lista
  required Widget Function(T) widgetItemInList,

  ///Altezza dell'XItem
  double? height,
  double? fontSizeForTitleOfArea,
  Axis? wrapDirectionForList,
  bool titleOnTop = true,
  bool borderAllAroundList = true,
  Color? backGroundColorTitleContainer,
  Color? backGroundColor,
  Color? titleBorderColor,
  double? titleContainerHeight,
  double? titleContainerWidth,
  AlignmentGeometry? titleAlignOnTop,
  AlignmentGeometry? titleAlignOnLeft,
  AlignmentGeometry? alignmentChild,
}) {
  return XItem(
      title: title,
      titleColor: titleColor,
      titleOnTop: titleOnTop,
      colorCard: backGroundColor,
      titleWidthBorder: 5,
      titleBorderColor: titleBorderColor ?? titleColor ?? Colors.black,
      titleBackGroundColor: backGroundColorTitleContainer ?? Colors.black,
      titleAlignOnTop: titleAlignOnTop ?? Alignment.center,
      titleAlignOnLeft: titleAlignOnLeft ?? Alignment.centerLeft,
      titleContainerHeight: titleContainerHeight ?? 40,
      titleStyle: TextStyle(color: titleColor, fontSize: fontSizeForTitleOfArea, fontWeight: FontWeight.bold),
      titleContainerWidth: titleOnTop == true ? double.infinity : titleContainerWidth ?? 40,
      children: [
        items.length == 0
            // NESSUNA - VUOTO
            ? XContainer(
                borderWidth: 5,
                title: "",
                titleBackColor: titleBorderColor ?? Colors.black,
                borderAll: borderAllAroundList,
                child: Container(
                  height: 100,
                  child: Row(children: [
                    Expanded(child: Text("..nessuna..", textAlign: TextAlign.center, style: XStyles.xStyleText(fontSize: 30))),
                  ]),
                ))
            // ITEMS
            : XContainer(
                heightChildContainer: height,
                borderWidth: 5,
                title: "",
                alignmentChild: alignmentChild ?? Alignment.topCenter,
                titleBackColor: titleColor,
                child: Wrap(
                  spacing: 2,
                  runSpacing: 2,
                  direction: wrapDirectionForList ?? Axis.horizontal,
                  //LIST
                  children: items
                      .map(
                          //ITEM
                          widgetItemInList
                          //ITEM
                          )
                      .toList(),
                ))
      ]);
}