XConcatenatedWidget<T, K> function

Widget XConcatenatedWidget<T, K>({
  1. required BuildContext context,
  2. String? mainArea_Title,
  3. Color? mainArea_TitleColor,
  4. double? mainArea_TitleFontSize,
  5. Color? mainArea_TitleBorderColor,
  6. Color? mainArea_TitleContainerBackGroundColor,
  7. double? mainArea_TitleContainerHeight,
  8. double? mainArea_TitleContainerWidth,
  9. Color? mainArea_BorderColor,
  10. double? mainArea_Width,
  11. double? mainArea_Height,
  12. Axis? mainArea_WrapDirection,
  13. bool? mainArea_borderAllAroundList,
  14. bool? mainArea_TitleOnTop,
  15. Alignment? mainArea_AlignmentChild,
  16. TextStyle? mainArea_TitleStyle,
  17. WrapAlignment? mainArea_WrapAlignment,
  18. Iterable<MapEntry<dynamic, List<T>>>? rootGRP_GroupItems,
  19. List<T>? rootGRP_Items,
  20. double? rootGRP_ItemfontSize,
  21. Axis? rootGRP_WrapDirection,
  22. bool rootGRP_TitleOnTop = true,
  23. double? rootGRP_TitleContainerWidth,
  24. Color? rootGRP_TitleBackGroundColor,
  25. Color? rootGRP_BorderColor,
  26. double? rootGRP_ItemWidth,
  27. double? rootGRP_ItemHeight,
  28. Color? rootGRP_ItemBackGroundColor,
  29. Alignment? rootGRP_TitleAlign,
  30. Widget rootGRP_TitleWidget(
    1. T
    )?,
  31. K rootGRP_groupListsBy_Key(
    1. T
    )?,
  32. Widget rootGRP_WidgetForGroupBy(
    1. MapEntry<K, List<T>>
    )?,
  33. Axis? middleGRP_WrapDirection,
  34. Color? middleGRP_ItemBackGroundColor,
  35. bool middleGRP_TitleOnTop = false,
  36. dynamic middleGRP_TitleWidget(
    1. T
    )?,
  37. double? middleGRP_ItemWidth,
  38. double? middleGRP_ItemHeight,
  39. double? middleGRP_TitleContainerWidth,
  40. Alignment? middleGRP_TitleAlign,
  41. K middleGRP_groupListsBy_Key(
    1. T
    )?,
  42. Widget middleGRP_WidgetForGroupBy(
    1. MapEntry<K, List<T>>
    )?,
  43. Axis? lastItem_WrapDirection,
  44. Widget lastItem_Widget(
    1. T
    )?,
  45. K lastItem_groupBy_Key(
    1. T
    )?,
  46. Widget lastItem_WidgetForGroupBy(
    1. MapEntry<K, List<T>>
    )?,
})

Implementation

Widget XConcatenatedWidget<T, K>({
  ///MAIN AREA ///MAIN AREA ///MAIN AREA ///MAIN AREA ///MAIN AREA ///MAIN AREA ///MAIN AREA ///MAIN AREA ///MAIN AREA
  required BuildContext context,

  ///Titolo dell'Item principale (Padre)
  String? mainArea_Title,

  ///Colore del titolo dell'Item principale (Padre)
  Color? mainArea_TitleColor,
  double? mainArea_TitleFontSize,
  Color? mainArea_TitleBorderColor,
  Color? mainArea_TitleContainerBackGroundColor,
  double? mainArea_TitleContainerHeight,
  double? mainArea_TitleContainerWidth,
  Color? mainArea_BorderColor,

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

  ///Altezza dell'XItem Principale (Padre)
  double? mainArea_Height,

  ///WrapDirection dell'Item principale (Padre)
  Axis? mainArea_WrapDirection,
  bool? mainArea_borderAllAroundList,
  bool? mainArea_TitleOnTop,
  Alignment? mainArea_AlignmentChild,
  TextStyle? mainArea_TitleStyle,
  WrapAlignment? mainArea_WrapAlignment,

  ///ROOT LIST ///ROOT LIST ///ROOT LIST ///ROOT LIST ///ROOT LIST ///ROOT LIST ///ROOT LIST ///ROOT LIST ///ROOT LIST

  ///Prima lista di Items che conterrà l'Item principale (Padre)
  Iterable<MapEntry<dynamic, List<T>>>? rootGRP_GroupItems,
  List<T>? rootGRP_Items,

  ///fontSize testi dell'Item principale (Padre)
  double? rootGRP_ItemfontSize,
  Axis? rootGRP_WrapDirection,
  bool rootGRP_TitleOnTop = true,
  double? rootGRP_TitleContainerWidth,
  Color? rootGRP_TitleBackGroundColor,
  Color? rootGRP_BorderColor,
  double? rootGRP_ItemWidth,
  double? rootGRP_ItemHeight,
  Color? rootGRP_ItemBackGroundColor,
  Alignment? rootGRP_TitleAlign,

  ///Widget per il titolo degli Items della prima lista
  Widget Function(T)? rootGRP_TitleWidget,
  K Function(T)? rootGRP_groupListsBy_Key,
  Widget Function(MapEntry<K, List<T>>)? rootGRP_WidgetForGroupBy,

  ///MIDDLE LIST ///MIDDLE LIST ///MIDDLE LIST ///MIDDLE LIST ///MIDDLE LIST ///MIDDLE LIST ///MIDDLE LIST ///MIDDLE LIST

  ///Widget per il titolo degli Items della seconda lista
  Axis? middleGRP_WrapDirection,
  Color? middleGRP_ItemBackGroundColor,
  bool middleGRP_TitleOnTop = false,
  dynamic Function(T)? middleGRP_TitleWidget,
  double? middleGRP_ItemWidth,
  double? middleGRP_ItemHeight,
  double? middleGRP_TitleContainerWidth,
  Alignment? middleGRP_TitleAlign,
  K Function(T)? middleGRP_groupListsBy_Key,
  Widget Function(MapEntry<K, List<T>>)? middleGRP_WidgetForGroupBy,

  ///LAST ITEMS ///LAST ITEMS ///LAST ITEMS ///LAST ITEMS ///LAST ITEMS ///LAST ITEMS ///LAST ITEMS ///LAST ITEMS

  Axis? lastItem_WrapDirection,
  Widget Function(T)? lastItem_Widget,

  ///Widget per la visualizzazione delle Items finali della terza lista
  K Function(T)? lastItem_groupBy_Key,

  ///Widget da riempire nel caso la propietà lastItem_groupListsBy_Key sia piena
  Widget Function(MapEntry<K, List<T>>)? lastItem_WidgetForGroupBy,
}) {
  var xi = XItem(
      //Setup della MAIN Area
      title: mainArea_Title,
      title_Color: mainArea_TitleColor ?? mainArea_BorderColor ?? Colors.white,
      title_OnTop: mainArea_TitleOnTop ?? true,
      title_BackGroundColor: mainArea_TitleContainerBackGroundColor ?? null,
      title_ContainerHeight: mainArea_TitleContainerHeight,
      title_WidthBorder: 5,
      width: mainArea_Width,
      title_BorderColor: mainArea_TitleBorderColor ?? mainArea_TitleColor ?? Colors.black,
      title_AlignOnTop: Alignment.center,
      title_ContainerWidth: mainArea_TitleContainerWidth ?? double.infinity,
      title_Style: mainArea_TitleStyle ?? XStyles.xStyleText(colorText: mainArea_TitleColor, fontSize: mainArea_TitleFontSize ?? 24, activeBold: true),
      card_Color: Colors.transparent,
      children: [
        rootGRP_GroupItems == null
            ? rootGRP_Items!.length == 0
                ? XContainer(
                    borderWidth: 5,
                    title_BackColor: mainArea_BorderColor ?? Colors.black,
                    borderAll: mainArea_borderAllAroundList ?? true,
                    child: Container(
                      height: 100,
                      child: Row(children: [Expanded(child: Text("..nessuna..", textAlign: TextAlign.center, style: XStyles.xStyleText(fontSize: 30)))]),
                    ))
                : XContainer(
                    heightChildContainer: mainArea_Height,
                    borderWidth: 5,
                    title: "",
                    alignmentChild: mainArea_AlignmentChild ?? Alignment.topCenter,
                    title_BackColor: mainArea_TitleColor,
                    child: Wrap(
                      spacing: 2,
                      runSpacing: 2,
                      direction: rootGRP_WrapDirection ?? Axis.horizontal,
                      //LIST
                      children: rootGRP_Items
                          .map(
                              //ITEM
                              lastItem_Widget!
                              //ITEM
                              )
                          .toList(),
                    ))
            : rootGRP_GroupItems.length == 0
                ? XContainer(
                    borderWidth: 5,
                    title_BackColor: mainArea_BorderColor ?? Colors.black,
                    borderAll: mainArea_borderAllAroundList ?? true,
                    child: Container(
                      height: 100,
                      child: Row(children: [Expanded(child: Text("..nessuna..", textAlign: TextAlign.center, style: XStyles.xStyleText(fontSize: 30)))]),
                    ))
                : XContainer(
                    alignmentChild: mainArea_AlignmentChild ?? Alignment.topCenter,
                    heightChildContainer: mainArea_Height,
                    borderWidth: 5,
                    title_BackColor: mainArea_BorderColor ?? Colors.black,
                    child: Wrap(
                        spacing: 1,
                        runSpacing: 6,
                        direction: mainArea_WrapDirection ?? Axis.vertical,
                        alignment: mainArea_WrapAlignment ?? WrapAlignment.center,
                        //ROOT LIST //ROOT LIST //ROOT LIST //ROOT LIST //ROOT LIST

                        //Se middleGRP_TitleWidget è != null
                        children: rootGRP_GroupItems.map((grp1) {
                          var xii = XItem(

                              //Setup del ROOT item
                              wrap_Direction: rootGRP_WrapDirection ?? Axis.vertical,
                              width: rootGRP_ItemWidth,
                              height: rootGRP_ItemHeight,
                              wrap_Spacing: 1,
                              wrap_RunSpacing: 1,
                              title_Widget: grp1.value.map(rootGRP_TitleWidget!).first,
                              card_Color: rootGRP_ItemBackGroundColor ?? Colors.blue.withOpacity(0.2),
                              crossAxisAlignmentXItem: CrossAxisAlignment.start,
                              mainAxisAlignmentXItem: MainAxisAlignment.start,
                              title_AlignOnTop: rootGRP_TitleOnTop != false ? rootGRP_TitleAlign ?? Alignment.centerLeft : null,
                              title_ContainerWidth: rootGRP_TitleOnTop != false ? rootGRP_TitleContainerWidth ?? double.infinity - 20 : rootGRP_TitleContainerWidth ?? 80,
                              title_OnTop: rootGRP_TitleOnTop,
                              title_BackGroundColor: rootGRP_TitleBackGroundColor,
                              title_BorderColor: rootGRP_BorderColor != null ? rootGRP_BorderColor : Colors.transparent,
                              title_Style: XStyles.xStyleText(colorText: mainArea_BorderColor ?? mainArea_TitleColor, fontSize: 20),
                              //MIDDLE LIST //MIDDLE LIST //MIDDLE LIST //MIDDLE LIST //MIDDLE LIST
                              children: middleGRP_groupListsBy_Key != null && middleGRP_TitleWidget != null
                                  //Se la key per il raggruppamento della lista di mezzo non è null faccio il raggruppamento
                                  ? grp1.value.groupListsBy<K>(middleGRP_groupListsBy_Key).entries.map((grp2) {
                                      return XItem(
                                        wrap_Direction: middleGRP_WrapDirection ?? Axis.horizontal,
                                        width: middleGRP_ItemWidth,
                                        title_Widget: grp2.value.map(middleGRP_TitleWidget).first,
                                        title_Color: XColors.foregroundLight,
                                        title_AlignOnTop: middleGRP_TitleOnTop != false ? middleGRP_TitleAlign ?? Alignment.centerLeft : null,
                                        title_ContainerWidth: middleGRP_TitleOnTop == false ? middleGRP_TitleContainerWidth ?? 50 : double.infinity - 20,
                                        title_OnTop: middleGRP_TitleOnTop,
                                        title_BackGroundColor: Colors.transparent,
                                        card_Color: middleGRP_ItemBackGroundColor,
                                        // LAST ITEMS // LAST ITEMS // LAST ITEMS // LAST ITEMS // LAST ITEMS
                                        children: [
                                          XContainer(
                                              title: "",
                                              borderAll: true,
                                              title_BackColor: rootGRP_BorderColor != null ? rootGRP_BorderColor : Colors.transparent,
                                              backGroundColorInternalWidget: Colors.transparent,
                                              child: Container(
                                                  child: Wrap(
                                                direction: lastItem_WrapDirection ?? Axis.horizontal,
                                                children: lastItem_WidgetForGroupBy == null
                                                    ? grp2.value.map(lastItem_Widget!).toList() //
                                                    : grp2.value.groupListsBy<K>(lastItem_groupBy_Key!).entries.map(lastItem_WidgetForGroupBy).toList(),
                                              ))),
                                        ],
                                      );
                                    }).toList()

                                  //ROOT LIST //ROOT LIST //ROOT LIST //ROOT LIST //ROOT LIST

                                  //Se middleGRP_TitleWidget è == null setto solo la lista finale dei LastITEMS
                                  : [
                                      Container(
                                          width: rootGRP_ItemWidth,
                                          decoration: BoxDecoration(color: rootGRP_ItemBackGroundColor, border: rootGRP_BorderColor != null ? Border.all(width: 2, color: rootGRP_BorderColor) : null),
                                          child: Wrap(
                                            direction: lastItem_WrapDirection ?? Axis.horizontal,
                                            children: lastItem_WidgetForGroupBy == null ? grp1.value.map(lastItem_Widget ?? (value) => Container()).toList() : grp1.value.groupListsBy<K>(lastItem_groupBy_Key!).entries.map(lastItem_WidgetForGroupBy).toList(),
                                          ))
                                    ]);

                          return xii;
                        }).toList())),
      ]);
  return xi;
}