appBar static method

PreferredSizeWidget appBar({
  1. String? titleStr,
  2. Widget? title,
  3. Widget? left,
  4. Widget? right,
  5. dynamic backTap()?,
  6. bool canGoBack = true,
  7. Color foregroundColor = const Color(0xff333333),
  8. IconThemeData? iconTheme = const IconThemeData(color: Color(0xff37383b)),
  9. IconThemeData? actionsIconTheme = const IconThemeData(color: Color(0xff37383b)),
  10. BoxDecoration? backDecoration,
  11. TextStyle titleTextStyle = const TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: Color(0xff37383b)),
  12. SystemUiOverlayStyle statusStyle = SystemUiOverlayStyle.dark,
})

导航栏 已添加字段不满足时,请自行补充;无特殊需要,只赋值自己需要的内容即可

Implementation

static  PreferredSizeWidget appBar ({
  String? titleStr,
  Widget? title,
  Widget? left,
  Widget? right,
  Function()? backTap,
  bool canGoBack = true,
  Color foregroundColor = const Color(0xff333333),
  IconThemeData? iconTheme = const IconThemeData(color: Color(0xff37383b)),
  IconThemeData? actionsIconTheme = const IconThemeData(color: Color(0xff37383b)),
  BoxDecoration? backDecoration,
  TextStyle titleTextStyle = const TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: Color(0xff37383b)),
  SystemUiOverlayStyle statusStyle = SystemUiOverlayStyle.dark}) {
  return JJAppNavigationBar(
    backDecoration: backDecoration,
    titleStr: titleStr,
    title: title,
    left: left,
    right: right,
    backTap: backTap,
    canGoBack: canGoBack,
    //flexibleSpace: widget.flexibleSpace,
    //bottom: widget.bottom,
    elevation: 0,
    //scrolledUnderElevation: widget.scrolledUnderElevation,
    shadowColor: Colors.transparent,
    //surfaceTintColor: widget.surfaceTintColor,
    //shape: widget.shape,
    backgroundColor: Colors.transparent,
    foregroundColor: foregroundColor,
    iconTheme: iconTheme,
    actionsIconTheme: actionsIconTheme,
    //primary: widget.primary,
    centerTitle: true,
    // excludeHeaderSemantics: widget.excludeHeaderSemantics,
    // titleSpacing: widget.titleSpacing,
    // toolbarOpacity: widget.toolbarOpacity,
    // bottomOpacity: widget.bottomOpacity,
    // toolbarHeight: widget.toolbarHeight,
    // leadingWidth: widget.leadingWidth,
    // toolbarTextStyle: widget.toolbarTextStyle,
    titleTextStyle: titleTextStyle,
    systemOverlayStyle: statusStyle,
  );
}