XConcatenatedWidget<T, K> function
Widget
XConcatenatedWidget<T, K>({
- required BuildContext context,
- String? mainArea_Title,
- Color? mainArea_TitleColor,
- double? mainArea_TitleFontSize,
- Color? mainArea_TitleBorderColor,
- Color? mainArea_TitleContainerBackGroundColor,
- double? mainArea_TitleContainerHeight,
- double? mainArea_TitleContainerWidth,
- Color? mainArea_BorderColor,
- double? mainArea_Width,
- double? mainArea_Height,
- Axis? mainArea_WrapDirection,
- bool? mainArea_borderAllAroundList,
- bool? mainArea_TitleOnTop,
- Alignment? mainArea_AlignmentChild,
- TextStyle? mainArea_TitleStyle,
- WrapAlignment? mainArea_WrapAlignment,
- Iterable<
MapEntry< ? rootGRP_GroupItems,dynamic, List< >T> > - List<
T> ? rootGRP_Items, - 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 rootGRP_TitleWidget(
- T
- K rootGRP_groupListsBy_Key(
- T
- Widget rootGRP_WidgetForGroupBy()?,
- Axis? middleGRP_WrapDirection,
- Color? middleGRP_ItemBackGroundColor,
- bool middleGRP_TitleOnTop = false,
- dynamic middleGRP_TitleWidget(
- T
- double? middleGRP_ItemWidth,
- double? middleGRP_ItemHeight,
- double? middleGRP_TitleContainerWidth,
- Alignment? middleGRP_TitleAlign,
- K middleGRP_groupListsBy_Key(
- T
- Widget middleGRP_WidgetForGroupBy()?,
- Axis? lastItem_WrapDirection,
- Widget lastItem_Widget(
- T
- K lastItem_groupBy_Key(
- T
- Widget lastItem_WidgetForGroupBy()?,
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;
}