appBarWidget function

AppBar appBarWidget(
  1. String title, {
  2. @Deprecated('Use titleWidget instead') Widget? child,
  3. Widget? titleWidget,
  4. List<Widget>? actions,
  5. Color? color,
  6. bool center = false,
  7. Color? textColor,
  8. int textSize = 20,
  9. bool showBack = true,
  10. Color? shadowColor,
  11. double? elevation,
  12. Widget? backWidget,
  13. @Deprecated('Use systemOverlayStyle instead') Brightness? brightness,
  14. SystemUiOverlayStyle? systemUiOverlayStyle,
  15. TextStyle? titleTextStyle,
  16. PreferredSizeWidget? bottom,
  17. Widget? flexibleSpace,
})

Default AppBar

Implementation

AppBar appBarWidget(
  String title, {
  @Deprecated('Use titleWidget instead') Widget? child,
  Widget? titleWidget,
  List<Widget>? actions,
  Color? color,
  bool center = false,
  Color? textColor,
  int textSize = 20,
  bool showBack = true,
  Color? shadowColor,
  double? elevation,
  Widget? backWidget,
  @Deprecated('Use systemOverlayStyle instead') Brightness? brightness,
  SystemUiOverlayStyle? systemUiOverlayStyle,
  TextStyle? titleTextStyle,
  PreferredSizeWidget? bottom,
  Widget? flexibleSpace,
}) {
  return AppBar(
    centerTitle: center,
    title: titleWidget ??
        Text(
          title,
          style: titleTextStyle ??
              (boldTextStyle(
                  color: textColor ?? textPrimaryColorGlobal, size: textSize)),
        ),
    actions: actions,
    automaticallyImplyLeading: showBack,
    backgroundColor: color ?? appBarBackgroundColorGlobal,
    leading: showBack
        ? (backWidget ?? BackButton(color: textColor ?? textPrimaryColorGlobal))
        : null,
    shadowColor: shadowColor,
    elevation: elevation ?? defaultAppBarElevation,
    systemOverlayStyle: systemUiOverlayStyle,
    bottom: bottom,
    flexibleSpace: flexibleSpace,
  );
}