AppBar constructor

AppBar(
  1. {Key? key,
  2. Widget? leading,
  3. bool automaticallyImplyLeading = true,
  4. Widget? title,
  5. List<Widget>? actions,
  6. Widget? flexibleSpace,
  7. PreferredSizeWidget? bottom,
  8. double? elevation,
  9. double? scrolledUnderElevation,
  10. ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate,
  11. Color? shadowColor,
  12. Color? surfaceTintColor,
  13. ShapeBorder? shape,
  14. Color? backgroundColor,
  15. Color? foregroundColor,
  16. IconThemeData? iconTheme,
  17. IconThemeData? actionsIconTheme,
  18. bool primary = true,
  19. bool? centerTitle,
  20. bool excludeHeaderSemantics = false,
  21. double? titleSpacing,
  22. double toolbarOpacity = 1.0,
  23. double bottomOpacity = 1.0,
  24. double? toolbarHeight,
  25. double? leadingWidth,
  26. TextStyle? toolbarTextStyle,
  27. TextStyle? titleTextStyle,
  28. SystemUiOverlayStyle? systemOverlayStyle,
  29. bool forceMaterialTransparency = false,
  30. Clip? clipBehavior}
)

Creates a Material Design app bar.

If elevation is specified, it must be non-negative.

Typically used in the Scaffold.appBar property.

Implementation

AppBar({
  super.key,
  this.leading,
  this.automaticallyImplyLeading = true,
  this.title,
  this.actions,
  this.flexibleSpace,
  this.bottom,
  this.elevation,
  this.scrolledUnderElevation,
  this.notificationPredicate = defaultScrollNotificationPredicate,
  this.shadowColor,
  this.surfaceTintColor,
  this.shape,
  this.backgroundColor,
  this.foregroundColor,
  this.iconTheme,
  this.actionsIconTheme,
  this.primary = true,
  this.centerTitle,
  this.excludeHeaderSemantics = false,
  this.titleSpacing,
  this.toolbarOpacity = 1.0,
  this.bottomOpacity = 1.0,
  this.toolbarHeight,
  this.leadingWidth,
  this.toolbarTextStyle,
  this.titleTextStyle,
  this.systemOverlayStyle,
  this.forceMaterialTransparency = false,
  this.clipBehavior,
}) : assert(elevation == null || elevation >= 0.0),
     preferredSize = _PreferredAppBarSize(toolbarHeight, bottom?.preferredSize.height);