t static method
Widget
t(
- State<
StatefulWidget> myState, { - required Widget content,
- String? title = "",
- AssetImage? assetBackground,
- double? assetBackgroundOpacity,
- Color? colorBackground,
- Widget? widgetBackground,
- Widget? toolbar,
- double? toolbar_height,
- Widget? floatBottom,
- ValueChanged<
ProgressCircleState> ? onChangeProgressState, - Color? statusBarColorCustom,
- Color? homeButtonsBackgroundColor,
- GlobalKey<
State< ? scaffoldKey,StatefulWidget> > - Widget? drawer,
- DrawerCallback? onDrawerChanged,
- ScrollController? scrollController,
- bool? resizeToAvoidBottomInset,
Implementation
static Widget t (
State myState,
{
//body
required Widget content,
//page info
String? title = "", //page title show when app be at recent apps in android,
//page title show at tab of new page in "Web"
//background
AssetImage? assetBackground, //image set to background of page pages "AssetImage"
double? assetBackgroundOpacity,
Color? colorBackground,
Widget? widgetBackground, //make widget to set as fixed background while scrolling moving
//toolbar (top view )
Widget? toolbar,
double? toolbar_height ,
//float_bottom ( bottom view )
Widget? floatBottom,
// navigation: is the fixed view at align parent bottom of screen
Widget? navigationBottom ,
double? navigationBottom_height ,
/**
* TODO? need to do this in future
*/
//footer
Widget? footer, //the footer used at web
double? footer_height,
//progress
ValueChanged<ProgressCircleState>? onChangeProgressState,
//color
Color? statusBarColorCustom,
Color? homeButtonsBackgroundColor,
//drawer menu
GlobalKey? scaffoldKey, // = GlobalKey()
Widget? drawer,
DrawerCallback? onDrawerChanged,
//scroll
ScrollController? scrollController,
//keybaord
bool? resizeToAvoidBottomInset
}){
//state manager
FastorStateManagement.instance().addState( myState );
// check null
title ??= "";
//step 1 - toolbar height
if( toolbar != null ){
toolbar_height ??= 70;
}
//step 2 - toolbar view
toolbar ??= EmptyView.zero();
//set default navigation height
if( navigationBottom != null ) {
navigationBottom_height ??= 70;
}
//navigation view
navigationBottom ??= EmptyView.zero();
//floatBottom view
floatBottom ??= EmptyView.zero();
//background (color or image )
var myBackground = _getBackground( myState.context, colorBackground,
assetBackground, assetBackgroundOpacity, widgetBackground );
//scroll all page
Widget scrollAllPage = ScrollViewPage.t( myState.context, content,
scrollController: scrollController,
toolbarHeight: toolbar_height,
footer_height: navigationBottom_height );
// choose stack of page mobile app
Stack stack = _putEveryBarToStack(myState.context, myBackground, scrollAllPage, floatBottom,
navigationBottom, navigationBottom_height,
toolbar, onChangeProgressState );
var pageStack = _statusBar(myState.context, stack, title , statusBarColorCustom);
//scaffold
var scaffold = Scaffold(
resizeToAvoidBottomInset: resizeToAvoidBottomInset ,
//
body: pageStack,
//drawer menu
key: scaffoldKey,
drawer: drawer,
onDrawerChanged: onDrawerChanged
);
return _getHomeButtonTheme( homeButtonsBackgroundColor, scaffold );
}