SuperAppBar constructor

SuperAppBar({
  1. Widget? title,
  2. Widget? actions,
  3. double height = kToolbarHeight,
  4. double? leadingWidth,
  5. Widget? leading,
  6. bool automaticallyImplyLeading = true,
  7. double titleSpacing = 15,
  8. String previousPageTitle = "Back",
  9. bool alwaysShowTitle = false,
  10. SuperSearchBar? searchBar,
  11. SuperLargeTitle? largeTitle,
  12. SuperAppBarBottom? bottom,
  13. Color? backgroundColor,
  14. Border? border,
  15. Color? shadowColor,
})

Implementation

SuperAppBar({
  this.title,
  this.actions,
  this.height = kToolbarHeight,
  this.leadingWidth,
  this.leading,
  this.automaticallyImplyLeading = true,
  this.titleSpacing = 15,
  this.previousPageTitle = "Back",
  this.alwaysShowTitle = false,
  this.searchBar,
  this.largeTitle,
  this.bottom,
  this.backgroundColor,
  this.border,
  this.shadowColor,
}) {
  searchBar = searchBar ?? SuperSearchBar();
  largeTitle = largeTitle ?? SuperLargeTitle();
  bottom = bottom ?? SuperAppBarBottom();

  if (!searchBar!.enabled) {
    searchBar!.height = 0;
  }
  if (!largeTitle!.enabled) {
    largeTitle!.height = 0;
  }
  if (!bottom!.enabled) {
    bottom!.height = 0;
  }
  title ??= Text(largeTitle!.largeTitle);

  if (title is Text) {
    if ((title as Text).style == null) {
      title = Text(
        "${(title as Text).data}",
        style: const TextStyle(),
      );
    }
  }
}