Three_ConcatenatedXItem<T, K> static method
Widget?
Three_ConcatenatedXItem<T, K>({
- required Axis wrapDirection,
- required double fontSizeForItem,
- required String title,
- required Color? titleColor,
- required Iterable<
MapEntry< items,dynamic, List< >T> > - required Widget titleFirstWidget(
- T
- required K secondGroupListsBy(
- T
- required dynamic titleSecondWidget(
- T
- required Widget thirdWidget(
- T
- bool groupByForLastLevel = false,
- K groupListsBy_LastItems(
- T
- Widget thirdWidgetForGroupBy()?,
- bool titleFirstOnTop = true,
- bool titleSecondOnTop = false,
- bool? borderAllAroundList,
- Color? backGroundColorTitleContainer,
- Color? backGroundColor,
- Color? backGroundColorFirstXItem,
- Color? backGroundColorSecondXItem,
- Color? colorBorderOfarea,
- Color? colorBorderOfFirstWidget,
- Color? titleBorderColor,
- double? width,
- double? height,
- double? titleContainerHeight,
- double? fontSizeForTitleOfArea,
- double? widthFirstXItem,
- double? widthSecondXItem,
- double? titleFirstContainerWidth,
- double? titleSecondContainerWidth,
- Axis? firstWrapDirection,
- Axis? secondWrapDirection,
- 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;
}