xLayout_asPage method
Implementation
xLayout_asPage(BuildContext context) {
return StatefulBuilder(builder: (context, setState) {
return WillPopScope(
onWillPop: () => cmd_Back(),
child: GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold(
appBar: AppBar(
iconTheme: IconThemeData(color: widget.title_BackColor ?? XColors.foregroundDark),
title: Text(widget.title ?? "", style: XStyles.xStyTextForLabel(widget.title_BackColor ?? XColors.foregroundDark)),
backgroundColor: widget.title_Color,
actions: [
Row(children: [
widget.detts_allowAdd
? Container(
margin: EdgeInsets.only(bottom: 5, top: 5, right: 5),
child: Row(children: [
XBtnbase(
icon: Icons.add,
onPressed: () async {
setState(() {
waiterMessage = "Sto caricando...";
isBusy = true;
});
await xOnAddDett(itemInEdit_Clone).then((value) {
super.setState(() {
waiterMessage = "";
isBusy = false;
});
});
},
icon_Size: 25,
elevation: 0,
icon_WidthArea: 30,
backGroundColor: widget.title_BackColor,
icon_Color: widget.title_BackColor ?? XColors.foregroundDark,
height: 40,
width: 40,
)
]))
: Container(),
Container(margin: EdgeInsets.only(bottom: 8, right: 5), child: Row(children: xLayout_ActionsListWidgets())),
])
],
),
body: Stack(children: [
enteredInEditOnCell
? Container()
: xLayout_BodyBuild() != null
? xLayout_BodyBuild() ?? Container()
: xTabs.value.isNotEmpty
? XResizableWidget(
isHorizontalSeparator: true,
separatorColor: Color.fromARGB(255, 75, 75, 75),
separatorSize: 30,
percentages: [widget.headerHeight, 1.0 - widget.headerHeight],
title: xTabs.value.length == 1 ? xTabs.value.first.caption : "",
children: [
xLayout_HeadAreaBuilder(),
xTabs.value.isEmpty
? Container(height: 0)
: xTabs.value.length <= 1
? xTabs.value.map((x) => x.content!).first
: XfxSchedaTabbed(
key: GlobalKey(),
currentTabIdx: currentTabIndex,
margin_Horizontal: 0,
// tabs_BackGroundColor: Colors.transparent,
title_Visible: false,
bottomBar_Visible: false,
bottomBar_Children: [],
numberOfTabs: xTabs.value.length,
isScrollableTabs: xTabs.value.length > 3 ? true : false,
children: xTabs.value.map((x) => x.content!).toList(),
xTabs: xTabs.value,
)
])
: xLayout_HeadAreaBuilder(),
isBusy ? Container(color: Colors.black.withAlpha(180)) : Container(),
isBusy ? XStatefulWidgetBase.LoaderIndicator(isBusy, label: waiterMessage) : Container(),
]),
bottomNavigationBar: (liBottomActions.isNotEmpty)
? BottomNavigationBar(
items: _xFillBottomBarActions(editedPage.value),
type: BottomNavigationBarType.fixed,
currentIndex: 0,
onTap: (value) async => await onTapBottomBar(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,
)));
});
}