xLayout_asPage method

Widget xLayout_asPage(
  1. BuildContext context
)

Layout della Scheda se รจ visualizzata come Pagina completa

Implementation

Widget xLayout_asPage(BuildContext context) {
  if (widget.title_Color != null) {
    print(widget.title_Color!.value);
  } else {
    print(null);
  }
  return WillPopScope(
      onWillPop: () async => await xCMD_Back(),
      child: GestureDetector(
          onTap: () => FocusScope.of(context).unfocus(),
          child: Scaffold(
            backgroundColor: widget.backGroundColor ?? Colors.black,
            // resizeToAvoidBottomInset: false,
            appBar: AppBar(
              key: widget.key_AppBar,
              toolbarHeight: xLayout_AppBar_AdditionalActions() != [] ? null : 40,
              iconTheme: IconThemeData(color: widget.title_BackColor ?? XColors.foregroundDark),
              title: widget.title_Widget ?? Text(((widget.title ?? "").replaceAll("App", "")), style: XStyles.xStyTextForLabel(textColor: widget.title_BackColor ?? XColors.foregroundDark)),
              backgroundColor: widget.title_Color,
              actions: [
                Row(children: [
                  Container(
                      margin: EdgeInsets.only(bottom: 4, top: 5, right: 5),
                      child: Row(
                          children: xLayout_AppBar_AdditionalActions()
                              .map((e) => e != null
                                  ? XActionWidget(e, xApp: widget.xApp) //
                                  : Container())
                              .toList())),
                  xUI_BtnSaveVisible && editedPage.value
                      ? XActionWidget(XActionsBase.save, xApp: widget.xApp, onPressed: () async {
                          super.setState(() {
                            xWaiterMessage = "Sto salvando i tuoi dati..";
                            isBusy = true;
                          });
                          await xCMD_Save();
                          super.setState(() {
                            xWaiterMessage = "";
                            isBusy = false;
                          });
                        })
                      : Container(),
                ])
              ],
            ),
            body: Stack(children: [
              xLayout_BodyBuild() != null
                  ? xLayout_BodyBuild() ?? Container()
                  : this.xTabs.value.isNotEmpty || widget.allowViewDettsAlways || this.xTabs.value.any((element) => element.xElencoToView != null && element.xElencoToView!.liDetts!.isNotEmpty)
                      ? XResizableWidget(
                          key: widget.key_Head,
                          isHorizontalSeparator: true,
                          title: xResizable_Title ?? (this.xTabs.value.length <= 1 && this.xTabs.value.isNotEmpty ? this.xTabs.value.first.caption : ""),
                          separatorColor: (widget.title_Color ?? Colors.grey[700]!),
                          separatorSize: 42,
                          onResized: (infoList) {
                            if (isKeyboardVisible.not()) {
                              xResizable_Percent_TopArea = infoList.first.percentage < 0.1 ? 0.1 : double.parse(infoList.first.percentage.toStringAsFixed(1));
                              xResizable_Percent_BottomArea = infoList.last.percentage < 0.1 ? 0.1 : double.parse(infoList.last.percentage.toStringAsFixed(1));
                            }
                          },
                          xWidgets_BeforeTitle: xLayout_XResizer_AdditionalWidgets_BeforeTitle(),
                          xWidgets_AfterTitle: xLayout_XResizer_AdditionalWidgets_AfterTitle(),
                          percentages: [
                              xResizable_Percent_TopArea == 1.0 ? (xResizable_Percent_TopArea - 0.1) : (xResizable_Percent_TopArea),
                              xResizable_Percent_BottomArea == 1.0 ? (xResizable_Percent_BottomArea - 0.1) : (xResizable_Percent_BottomArea)
                            ],
                          children: [
                              widget.xHead_Show ? xLayout_HeadAreaBuilder(xclView: widget.xView) : Container(),
                              StatefulBuilder(
                                  key: widget.key_Rows,
                                  builder: (context, setState) => Stack(alignment: Alignment.bottomCenter, children: [
                                        this.xTabs.value.length <= 1
                                            ? this.xTabs.value.isNotEmpty
                                                ? (this.xTabs.value.map((x) => widget.complexUI ? x.content ?? Container() : x.xElencoToView ?? Container()).first)
                                                : Container()
                                            : XfxSchedaTabbed(
                                                margin_Horizontal: 0,
                                                tabs_BackGroundColor: Colors.grey[900],
                                                title_Color: widget.title_Color,
                                                currentTabIdx: ((xTabs.value.isEmpty || xTab_Active == null) ? (xTabs.value.isEmpty ? 0 : xTabs.value.first.idx) : xTab_Active!.idx),
                                                title_Visible: false,
                                                bottomBar_Visible: false,
                                                bottomBar_Children: [],
                                                numberOfTabs: this.xTabs.value.length,
                                                tabBar_OnTap: (idx) => xTab_Active = this.xTabs.value.firstWhere((element) => element.idx == idx),
                                                isScrollableTabs: this.xTabs.value.length >= 4 ? true : false,
                                                children: this.xTabs.value.map((x) => widget.complexUI ? x.content ?? Container() : x.xElencoToView ?? Container()).toList(),
                                                xTabs: this.xTabs.value,
                                              ),
                                        Column(crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end, children: xLayout_BottomArea_OverSch() ?? []),
                                      ]))
                            ])
                      : widget.xHead_Show
                          ? xLayout_HeadAreaBuilder(xclView: widget.xView)
                          : Container(height: 0),
              isBusy ? Container(color: Colors.black.withAlpha(160)) : Container(),
              isBusy ? XStatefulWidgetBase.LoaderIndicator(isBusy, label: xWaiterMessage) : Container(),
            ]),
            bottomNavigationBar: (liBottomActions.length > 1) && widget.editable
                ? BottomNavigationBar(
                    key: widget.key_BottomBar,
                    items: liBottomActions,
                    type: BottomNavigationBarType.fixed,
                    currentIndex: 0,
                    onTap: (value) async => await xBottomBarAction_OnTap_INTERNAL(value, setState),
                    enableFeedback: true,
                    showUnselectedLabels: true,
                    selectedFontSize: 15,
                    selectedLabelStyle: XStyles.xStyleText(fontSize: 14, colorText: XColors.foregroundLight),
                    backgroundColor: Colors.grey[900],
                    unselectedItemColor: XColors.foregroundLight,
                    unselectedFontSize: 10,
                    useLegacyColorScheme: false,
                    unselectedLabelStyle: XStyles.xStyleText(fontSize: 14, colorText: XColors.foregroundLight),
                    iconSize: 20,
                  )
                : null,
            floatingActionButton: widget.editable
                ? xLayout_FloatingAddBTN_Widget() == null
                    ? (liBottomActions.length == 1 ? xLayout_FloatingAddBTN(liBottomActions[0]) : null)
                    : xLayout_FloatingAddBTN_Widget()
                : null,
          )));
}