Three_ConcatenatedXItem<T, K> static method

Widget? Three_ConcatenatedXItem<T, K>({
  1. required Axis wrapDirection,
  2. required double fontSizeForItem,
  3. required String title,
  4. required Color? titleColor,
  5. required Iterable<MapEntry<dynamic, List<T>>> items,
  6. required Widget titleFirstWidget(
    1. T
    ),
  7. required K secondGroupListsBy(
    1. T
    ),
  8. required dynamic titleSecondWidget(
    1. T
    ),
  9. required Widget thirdWidget(
    1. T
    ),
  10. bool groupByForLastLevel = false,
  11. K groupListsBy_LastItems(
    1. T
    )?,
  12. Widget thirdWidgetForGroupBy(
    1. MapEntry<K, List<T>>
    )?,
  13. bool titleFirstOnTop = true,
  14. bool titleSecondOnTop = false,
  15. bool? borderAllAroundList,
  16. Color? backGroundColorTitleContainer,
  17. Color? backGroundColor,
  18. Color? backGroundColorFirstXItem,
  19. Color? backGroundColorSecondXItem,
  20. Color? colorBorderOfarea,
  21. Color? colorBorderOfFirstWidget,
  22. Color? titleBorderColor,
  23. double? width,
  24. double? height,
  25. double? titleContainerHeight,
  26. double? fontSizeForTitleOfArea,
  27. double? widthFirstXItem,
  28. double? widthSecondXItem,
  29. double? titleFirstContainerWidth,
  30. double? titleSecondContainerWidth,
  31. Axis? firstWrapDirection,
  32. Axis? secondWrapDirection,
  33. Axis? thirdWrapDirection,
})

Implementation

static Widget? Three_ConcatenatedXItem<T, K>({
  ///WrapDirection dell'Item principale (Padre)
  required Axis wrapDirection,

  ///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 Iterable<MapEntry<dynamic, List<T>>> items,

  ///Widget per il titolo degli Items della prima lista
  required Widget Function(T) titleFirstWidget,

  ///Raggruppamento per ...., da mettere la propietà o le propietà per fare il groupBy per la seconda lista
  required K Function(T) secondGroupListsBy,

  ///Widget per il titolo degli Items della seconda lista
  required dynamic Function(T) titleSecondWidget,

  ///Widget per la visualizzazione delle Items finali della terza lista
  required Widget Function(T) thirdWidget,

  ///Da settare true nel caso si voglia un groupBy anche per la terza lista
  bool groupByForLastLevel = false,

  ///Raggruppamento per ...., da mettere la propietà o le propietà per fare il groupBy per la terza lista
  K Function(T)? groupListsBy_LastItems,

  ///Widget da riempire nel caso la propietà groupByForLastLevel sia true
  Widget Function(MapEntry<K, List<T>>)? thirdWidgetForGroupBy,
  bool titleFirstOnTop = true,
  bool titleSecondOnTop = false,
  bool? borderAllAroundList,
  Color? backGroundColorTitleContainer,
  Color? backGroundColor,
  Color? backGroundColorFirstXItem,
  Color? backGroundColorSecondXItem,
  Color? colorBorderOfarea,
  Color? colorBorderOfFirstWidget,
  Color? titleBorderColor,

  ///Larghezza dell'XItem Principale (Padre)
  double? width,

  ///Altezza dell'XItem Principale (Padre)
  double? height,
  double? titleContainerHeight,
  double? fontSizeForTitleOfArea,
  double? widthFirstXItem,
  double? widthSecondXItem,
  double? titleFirstContainerWidth,
  double? titleSecondContainerWidth,
  Axis? firstWrapDirection,
  Axis? secondWrapDirection,
  Axis? thirdWrapDirection,
}) {
  var xi = XItem(title: title, title_Color: titleColor ?? colorBorderOfarea ?? Colors.white, title_OnTop: true, title_BackGroundColor: backGroundColorTitleContainer ?? null, title_ContainerHeight: titleContainerHeight ?? 40, title_WidthBorder: 5, width: width, title_AlignOnTop: Alignment.center, title_ContainerWidth: double.infinity, title_Style: TextStyle(color: titleColor, fontSize: fontSizeForTitleOfArea ?? 24, fontWeight: FontWeight.bold), card_Color: backGroundColor, title_BorderColor: titleBorderColor, children: [
    items.length == 0
        ? XContainer(
            borderWidth: 5,
            title_BackColor: colorBorderOfarea ?? Colors.black,
            borderAll: borderAllAroundList ?? true,
            child: Container(
              height: 100,
              child: Row(children: [Expanded(child: Text("..nessuna..", textAlign: TextAlign.center, style: XStyles.xStyleText(fontSize: 30)))]),
            ))
        : XContainer(
            alignmentChild: Alignment.topLeft,
            heightChildContainer: height,
            borderWidth: 5,
            title_BackColor: colorBorderOfarea ?? Colors.black,
            child: Wrap(
                spacing: 1,
                runSpacing: 6,
                direction: wrapDirection,
                //1ST GRP
                children: items.map((grp1) {
                  var xii = XItem(
                      wrap_Direction: firstWrapDirection ?? Axis.vertical,
                      width: widthFirstXItem,
                      height: null,
                      wrap_Spacing: 1,
                      wrap_RunSpacing: 1,
                      title_Widget: grp1.value.map(titleFirstWidget).first,
                      card_Color: backGroundColorFirstXItem ?? Colors.blue.withOpacity(0.2),
                      crossAxisAlignmentXItem: CrossAxisAlignment.start,
                      mainAxisAlignmentXItem: MainAxisAlignment.start,
                      title_AlignOnTop: titleFirstOnTop != false ? Alignment.centerLeft : null,
                      title_ContainerWidth: titleFirstOnTop != false ? double.infinity - 20 : titleFirstContainerWidth ?? 80,
                      title_OnTop: titleFirstOnTop,
                      title_Style: TextStyle(color: colorBorderOfarea ?? titleColor, fontSize: 20),
                      // 2nd GROUP
                      children: grp1.value.groupListsBy<K>(secondGroupListsBy).entries.map((grp2) {
                        return Container(
                            child: XItem(
                          wrap_Direction: secondWrapDirection ?? Axis.horizontal,
                          width: widthSecondXItem,
                          title_Widget: grp2.value.map(titleSecondWidget).first,
                          title_Color: XColors.foregroundLight,
                          title_AlignOnTop: titleSecondOnTop != false ? Alignment.centerLeft : null,
                          title_ContainerWidth: titleSecondOnTop == false ? titleSecondContainerWidth ?? 50 : double.infinity - 20,
                          title_OnTop: titleSecondOnTop,
                          title_BackGroundColor: Colors.transparent,
                          card_Color: backGroundColorSecondXItem,
                          // 3th GROUP
                          children: [
                            XContainer(
                                title: "",
                                borderAll: true,
                                title_BackColor: colorBorderOfFirstWidget != null ? colorBorderOfFirstWidget : Colors.transparent,
                                backGroundColorInternalWidget: Colors.transparent,
                                child: Wrap(
                                  direction: thirdWrapDirection ?? Axis.horizontal,
                                  children: groupByForLastLevel == false
                                      ? grp2.value.map(thirdWidget).toList()
                                      : //
                                      grp2.value.groupListsBy<K>(groupListsBy_LastItems!).entries.map(thirdWidgetForGroupBy!).toList(),
                                )),
                          ],
                        ));
                      }).toList());
                  return xii;
                }).toList())),
  ]);
  return xi;
}