CommPageScaffoldWidget static method

dynamic CommPageScaffoldWidget(
  1. BuildContext context, {
  2. Color? backgroundColor = ColorUtils.color_transparent,
  3. Color? statusFontColor = ColorUtils.color_white,
  4. PreferredSizeWidget? appBar,
  5. Widget? body,
  6. Widget? bottomNavigationBar,
  7. Widget? floatingActionButton,
  8. FloatingActionButtonLocation? floatingActionButtonLocation,
  9. bool? isShowBg = true,
  10. bool? isShowFloatingActionButton = false,
  11. Function? floatingActionButtonTap,
  12. double? pageWidth,
  13. double? pageHeight,
  14. String? appBarBgPath,
  15. String? iconCreateRoundPath,
})

Implementation

static CommPageScaffoldWidget(BuildContext context,
    {
      Color? backgroundColor:ColorUtils.color_transparent,
      Color? statusFontColor:ColorUtils.color_white,
      PreferredSizeWidget? appBar,Widget? body,
      Widget? bottomNavigationBar,
      Widget? floatingActionButton,
      FloatingActionButtonLocation? floatingActionButtonLocation,
      bool? isShowBg:true,
      bool? isShowFloatingActionButton:false,
      Function? floatingActionButtonTap,
      double? pageWidth,
      double? pageHeight,
      String? appBarBgPath,
      String? iconCreateRoundPath,
    }){
  var designSize = MediaQuery.of(context).size;
  var paddingBottom = MediaQuery.of(context).padding.bottom;
  var paddingRight = MediaQuery.of(context).padding.right;
  LogUtil.e('CommPageScaffoldWidget-->paddingBottom=$paddingBottom,paddingRight=$paddingRight');
  return AnnotatedRegion<SystemUiOverlayStyle>(
    value: (statusFontColor==ColorUtils.color_white)?SystemUiOverlayStyle.light:SystemUiOverlayStyle.dark,
    child: Material(
      child:Stack(
        children: [
          (!(isShowBg??false))?Container():Positioned(
            top: PxUtils.px_0,
            left: PxUtils.px_0,
            child: Container(
              height: PxUtils.px_58+PxUtils.statusBarHeight,//固定高度为appbar的高度+状态栏的高度
              child: (appBarBgPath??'').isEmpty?
                  Container(
                    width: pageWidth??(designSize.width-paddingRight),
                    height: PxUtils.px_58+PxUtils.statusBarHeight,
                    color: ColorUtils.color_dcbe9b,
                  ):
              ImageUtils.loadAssetImage(
                appBarBgPath,
                width: pageWidth??(designSize.width-paddingRight),

              ),
            )
          ),
          Container(
            width: pageWidth??(designSize.width-paddingRight),
            height: pageHeight??(designSize.height-paddingBottom),
            child: KeyBoardOnTouchDownWidget(context, child: Scaffold(
                backgroundColor:ColorUtils.color_transparent,
                floatingActionButton:(!(isShowFloatingActionButton??false))?null:
                (floatingActionButton??SimpleButton(
                  child:(iconCreateRoundPath??'').isEmpty?
                      Icon(Icons.add_circle_outline_rounded,size: PxUtils.px_100,):
                   ImageUtils.loadAssetImage(
                      iconCreateRoundPath,
                      width: PxUtils.px_100
                  ),
                  onPressed: (){
                    if(floatingActionButtonTap!=null)floatingActionButtonTap();
                  },
                )),
                //floatingActionButtonLocation的位置
                floatingActionButtonLocation:(!(isShowFloatingActionButton??false))?null:
                (floatingActionButtonLocation??CustomFloatingActionButtonLocation(
                    FloatingActionButtonLocation.endFloat,
                    0,
                    -PxUtils.px_50
                )),
                appBar: appBar,
                bottomNavigationBar: bottomNavigationBar,
                body: Container(
                  color: backgroundColor??ColorUtils.color_f2f2f2,
                  child: body,
                )
            )),
          )
        ],
      )
      // Container(
      //   decoration: BoxDecoration(
      //     image: DecorationImage(
      //         fit: BoxFit.fitWidth,
      //         alignment: Alignment.topCenter,
      //         image: AssetImage(DrawableUtils.app_bar_bg)
      //     ),
      //   ),
      //
      //   child: KeyBoardOnTouchDownWidget(context, child: Scaffold(
      //       backgroundColor:ColorUtils.color_transparent,
      //       floatingActionButton:floatingActionButton,
      //       floatingActionButtonLocation: floatingActionButtonLocation,
      //       appBar: appBar,
      //       body: Container(
      //         color: backgroundColor??ColorUtils.color_f2f2f2,
      //         child: body,
      //       )
      //   )),
      // ),
    ),
  );
}