xLayout_AreaElenco method

Widget xLayout_AreaElenco()

Implementation

Widget xLayout_AreaElenco() {
  return StatefulBuilder(builder: (context, setState) {
    return Container(
        margin: EdgeInsets.symmetric(horizontal: widget.margin_Horizontal ?? 2),
        child: Column(children: [
          widget.searchBar_Active && list.length > 5
              ? Row(children: [
                  Expanded(
                      child: XSearchBar(
                          marginOfSearchBox: EdgeInsets.symmetric(vertical: 2),
                          paddingOfContent: EdgeInsets.only(left: 5),
                          hintStyle: XStyles.xStyTextForSubLabel(widget.searchBar_ColorHint ?? Colors.white),
                          textStyle: XStyles.xStyTextForSubLabel(widget.searchBar_ColorText ?? Colors.white),
                          colorIconForClear: widget.searchBar_ColorIconClear ?? Colors.white,
                          colorIconForSearch: widget.searchBar_ColorIconSearch ?? Colors.white,
                          autoFocus: false,
                          onTextChanged: (value) {
                            setState(() {
                              if (value == "") {
                                searchController.text = "";
                                filterCurrent = filterAll;
                              } else {
                                filterCurrent = value;
                              }
                            });
                          },
                          onPressedClear: () {
                            setState(() {
                              filterCurrent = filterAll;
                              searchController.text = "";
                            });
                          },
                          border: UnderlineInputBorder(borderSide: BorderSide(color: widget.searchBar_ColorBorder ?? widget.searchBar_ColorHint ?? widget.searchBar_ColorText ?? XColors.foregroundLight)),
                          disabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: widget.searchBar_ColorBorder ?? widget.searchBar_ColorHint ?? widget.searchBar_ColorText ?? XColors.foregroundLight)),
                          enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: widget.searchBar_ColorBorder ?? widget.searchBar_ColorHint ?? widget.searchBar_ColorText ?? XColors.foregroundLight)),
                          controller: searchController,
                          colorOfSearchBox: widget.searchBar_Color,
                          hintText: widget.searchBar_hintText ?? "cerca..",
                          iconForSearch: null))
                ])
              : Container(),
          widget.title_OnTop_Visible == true
              ? Row(
                  children: [
                    Expanded(
                        child: XContainerWithLabel(
                      widget.title_Text,
                      height: widget.heightContainerElTitle,
                      color: widget.colorBackgroundContainerElTitle ?? widget.searchBar_Color ?? XColors.backGroundTitleContainerForElenco,
                      textStyle: widget.title_Style ?? XStyles.xStyTextForTextBase(XColors.foregroundDark),
                    )),
                    widget.BTNtitle_Visible == true
                        ? Container(
                            margin: widget.BTNtitle_Margin ?? EdgeInsets.only(left: 5),
                            height: widget.BTNtitle_Height ?? 25,
                            width: widget.BTNtitle_Width ?? 70,
                            child: XBtnbase(
                              label: widget.BTNtitle_Label ?? "Add New",
                              onPressed: widget.BTNtitle_OnPressed,
                              decoration: BoxDecoration(color: widget.BTNtitle_Color),
                            ),
                          )
                        : Container(),
                  ],
                )
              : Container(),
          SizedBox(height: widget.headers_Visible == true && widget.headers_Visible != null ? 3 : 0),
          widget.headers_Visible == true && widget.headers_Visible != null ? Row(children: widget.headers!) : Container(),
          SizedBox(height: widget.headers_Visible == true && widget.headers_Visible != null ? 5 : 0),
          widget.filters_Visible == true && widget.filters_Visible != null ? Row(children: widget.filters!) : Container(),
          SizedBox(height: widget.filters_Visible == true && widget.filters_Visible != null ? 5 : 0),
          Expanded(
              flex: widget.flexForList ?? 18,
              child: (widget.schedaMode ?? false).not()
                  ? RefreshIndicator(
                      triggerMode: RefreshIndicatorTriggerMode.anywhere,
                      onRefresh: widget.onRefresh_ScrollDownList != null ? () => widget.onRefresh_ScrollDownList!(context) : () async {},
                      child: Scrollbar(
                          thumbVisibility: true,
                          controller: scroll_controller,
                          child: ListView(
                            children: widget.liDetts != null
                                ? widget.liDetts!.where((element) => widget.searchBar_whereMethod != null ? widget.searchBar_whereMethod!(element, filterCurrent) : element != null).map((e) {
                                    return widget.item_Widget != null
                                        ? widget.item_Widget!(e) ?? Container() //
                                        : xLayout_ItemWidget(e) ?? Container();
                                  }).toList()
                                : list.where((element) => widget.searchBar_whereMethod != null ? widget.searchBar_whereMethod!(element, filterCurrent) : element != null).map((e) {
                                    return widget.item_Widget != null
                                        ? widget.item_Widget!(e) ?? Container() //
                                        : xLayout_ItemWidget(e) ?? Container();
                                  }).toList(),
                            controller: scroll_controller,
                          )))
                  : Scrollbar(
                      thumbVisibility: true,
                      controller: scroll_controller,
                      child: ListView(
                        children: widget.liDetts != null
                            ? widget.liDetts!.where((element) => widget.searchBar_whereMethod != null ? widget.searchBar_whereMethod!(element, filterCurrent) : element != null).map((e) {
                                return widget.item_Widget != null
                                    ? widget.item_Widget!(e) ?? Container() //
                                    : xLayout_ItemWidget(e) ?? Container();
                              }).toList()
                            : list.where((element) => widget.searchBar_whereMethod != null ? widget.searchBar_whereMethod!(element, filterCurrent) : element != null).map((e) {
                                return widget.item_Widget != null
                                    ? widget.item_Widget!(e) ?? Container() //
                                    : xLayout_ItemWidget(e) ?? Container();
                              }).toList(),
                        controller: scroll_controller,
                      )))
        ]));
  });
}