xLayout_asPage method
Layout della Scheda se è visualizzata come Pagina completa
Implementation
Widget xLayout_asPage(BuildContext context) {
// var ifMore = widget.xView.cols.where((element) => element.colKey.startsWith("li"));
// var i;
// if (ifMore.isNotEmpty) {
// i = itemInEdit_Clone[ifMore.first.colKey];
// } else {
// i = "";
// }
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 ?? "").replaceAll("App", "")), style: XStyles.xStyTextForLabel(widget.title_BackColor ?? XColors.foregroundDark)),
backgroundColor: widget.title_Color,
actions: [
Row(children: [
// (i != "" && i.length > 1)
// ? XBtnbase(
// label: "Cambia \nVisione",
// onPressed: () {
// setState(() {
// if (widget.viewSch_TYPE != null) {
// widget.viewSch_TYPE = widget.viewSch_TYPE!.not();
// } else {
// widget.viewSch_TYPE = false;
// }
// rebuildAllChildren(context);
// });
// },
// icon_Size: 25,
// elevation: 0,
// icon_WidthArea: 30,
// backGroundColor: widget.title_BackColor,
// icon_Color: widget.title_BackColor ?? XColors.foregroundDark,
// width: 100,
// )
// : Container(),
widget.allowAddDetts
? 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_AppBar_AdditionalActions())),
])
],
),
body: Stack(children: [
enteredInEditOnCell
? Container()
: xLayout_BodyBuild() != null
? xLayout_BodyBuild() ?? Container()
: this.xTabs.value.isNotEmpty || widget.viewDettsAlways
? XResizableWidget(
key: UniqueKey(),
isHorizontalSeparator: true,
title: this.xTabs.value.length <= 1 ? this.xTabs.value.first.caption : "",
separatorColor: Colors.grey[700]!,
separatorSize: 40,
xWidgets_BeforeTitle: xLayout_XResizer_AdditionalWidgets_BeforeTitle(),
xWidgets_AfterTitle: xLayout_XResizer_AdditionalWidgets_AfterTitle(),
percentages: [0.4, 0.6],
// onResized: (infoList) {
// },
children: [
widget.showHead ? xLayout_HeadAreaBuilder() : Container(),
this.xTabs.value.isEmpty
? Container(height: 0)
: this.xTabs.value.length <= 1
? this.xTabs.value.map((x) => widget.complexUI ? x.content ?? Container() : x.xElencoToView ?? Container()).first
: XfxSchedaTabbed(
margin_Horizontal: 0,
tabs_BackGroundColor: Colors.grey[900],
title_Color: widget.title_Color,
title_Visible: false,
bottomBar_Visible: false,
bottomBar_Children: [],
numberOfTabs: this.xTabs.value.length,
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,
)
],
)
: widget.showHead
? xLayout_HeadAreaBuilder()
: Container(),
isBusy ? Container(color: Colors.black.withAlpha(180)) : Container(),
isBusy ? XStatefulWidgetBase.LoaderIndicator(isBusy, label: waiterMessage) : Container(),
]),
bottomNavigationBar: (liBottomActions.length > 1) && widget.editable
? BottomNavigationBar(
items: liBottomActions,
type: BottomNavigationBarType.fixed,
currentIndex: 0,
onTap: (value) async => await _xBottomBarAction_OnTap(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
? liBottomActions.length == 1
? _buildAddBTN(liBottomActions[0])
: null
: null,
)));
}