t static method

Widget t(
  1. State<StatefulWidget> myState, {
  2. required Widget content,
  3. String? title = "",
  4. AssetImage? assetBackground,
  5. double? assetBackgroundOpacity,
  6. Color? colorBackground,
  7. Widget? widgetBackground,
  8. Widget? toolbar,
  9. double? toolbar_height,
  10. Widget? floatBottom,
  11. Widget? navigationBottom,
  12. double? navigationBottom_height,
  13. Widget? footer,
  14. double? footer_height,
  15. ValueChanged<ProgressCircleState>? onChangeProgressState,
  16. Color? statusBarColorCustom,
  17. Color? homeButtonsBackgroundColor,
  18. GlobalKey<State<StatefulWidget>>? scaffoldKey,
  19. Widget? drawer,
  20. DrawerCallback? onDrawerChanged,
  21. ScrollController? scrollController,
  22. 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 );
}