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,
titleColor: titleColor ?? colorBorderOfarea ?? Colors.white,
titleOnTop: true,
titleBackGroundColor: backGroundColorTitleContainer ?? null,
titleContainerHeight: titleContainerHeight ?? 40,
titleWidthBorder: 5,
width: width,
titleAlignOnTop: Alignment.center,
titleContainerWidth: double.infinity,
titleStyle: TextStyle(color: titleColor, fontSize: fontSizeForTitleOfArea ?? 24, fontWeight: FontWeight.bold),
colorCard: backGroundColor,
titleBorderColor: titleBorderColor,
children: [
items.length == 0
? XContainer(
borderWidth: 5,
titleBackColor: 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,
titleBackColor: colorBorderOfarea ?? Colors.black,
child: Wrap(
spacing: 1,
runSpacing: 6,
direction: wrapDirection,
//1ST GRP
children: items.map((grp1) {
var xii = XItem(
wrapDirection: firstWrapDirection ?? Axis.vertical,
width: widthFirstXItem,
height: null,
wrapSpacing: 1,
wrapRunSpacing: 1,
titleWidget: grp1.value.map(titleFirstWidget).first,
colorCard: backGroundColorFirstXItem ?? Colors.blue.withOpacity(0.2),
crossAxisAlignmentXItem: CrossAxisAlignment.start,
mainAxisAlignmentXItem: MainAxisAlignment.start,
titleAlignOnTop: titleFirstOnTop != false ? Alignment.centerLeft : null,
titleContainerWidth: titleFirstOnTop != false ? double.infinity - 20 : titleFirstContainerWidth ?? 80,
titleOnTop: titleFirstOnTop,
titleStyle: TextStyle(color: colorBorderOfarea ?? titleColor, fontSize: 20),
// 2nd GROUP
children: grp1.value.groupListsBy<K>(secondGroupListsBy).entries.map((grp2) {
return Container(
child: XItem(
wrapDirection: secondWrapDirection ?? Axis.horizontal,
width: widthSecondXItem,
titleWidget: grp2.value.map(titleSecondWidget).first,
titleColor: XColors.xcolor_ForegroundLight,
titleAlignOnTop: titleSecondOnTop != false ? Alignment.centerLeft : null,
titleContainerWidth: titleSecondOnTop == false ? titleSecondContainerWidth ?? 50 : double.infinity - 20,
titleOnTop: titleSecondOnTop,
titleBackGroundColor: Colors.transparent,
colorCard: backGroundColorSecondXItem,
// 3th GROUP
children: [
XContainer(
title: "",
borderAll: true,
titleBackColor: 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;
}