appBar static method

PreferredSizeWidget appBar({
  1. String title = '',
  2. String message = '',
  3. List<Widget>? widgets,
  4. Widget? leading,
  5. double? leadingWidth,
  6. TextStyle? titleStyle,
  7. double? elevation = 0,
  8. double toolbarHeight = 56,
  9. Color color = Colors.transparent,
  10. SystemUiOverlayStyle systemOverlayStyle = SystemUiOverlayStyle.dark,
  11. bool centerTitle = true,
  12. Color? titleColor,
})

Implementation

static PreferredSizeWidget appBar({
  String title = '',
  String message = '',
  List<Widget>? widgets,
  Widget? leading,
  double? leadingWidth,
  TextStyle? titleStyle,
  double? elevation = 0,
  double toolbarHeight = 56,
  Color color = Colors.transparent,
  SystemUiOverlayStyle systemOverlayStyle = SystemUiOverlayStyle.dark,
  bool centerTitle = true,
  Color? titleColor,
}) {
  return AppBar(
    toolbarHeight: toolbarHeight,
    automaticallyImplyLeading: false,
    systemOverlayStyle: systemOverlayStyle,
    backgroundColor: color,
    elevation: elevation,
    scrolledUnderElevation: 0,
    leadingWidth: leadingWidth,
    surfaceTintColor: Colors.transparent,
    leading: leading != null
        ? Padding(
      padding: const EdgeInsets.only(left: 16.0, top: 6),
      child: leading,
    )
        : null,
    title: Text(
      title,
      style: titleStyle ??
          TextStyle(
            color: titleColor ?? Colors.black,
            fontSize: 18,
            fontWeight: FontWeight.w600,
          ),
    ),
    centerTitle: centerTitle,
    iconTheme: const IconThemeData(
      color: Colors.black,
    ),
    actionsPadding: const EdgeInsets.only(right: 16.0),
    actions: widgets,
  );
}