VxAppBar constructor

VxAppBar(
  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. ShapeBorder shape,
  10. Color backgroundColor,
  11. Brightness brightness,
  12. IconThemeData iconTheme,
  13. IconThemeData actionsIconTheme,
  14. TextTheme textTheme,
  15. bool primary = true,
  16. bool centerTitle,
  17. double titleSpacing = NavigationToolbar.kMiddleSpacing,
  18. double toolbarOpacity = 1.0,
  19. double bottomOpacity = 1.0,
  20. bool searchBar = false,
  21. String searchHintText = 'Search here...',
  22. TextStyle searchHintStyle = const TextStyle(color: Colors.white, fontSize: 14),
  23. TextStyle searchTextStyle = const TextStyle(color: Colors.white),
  24. Color searchBarColorTheme = Colors.white,
  25. TextEditingController searchController,
  26. GestureTapCallback onTap,
  27. ValueChanged<String> onChanged,
  28. ValueChanged<String> onSubmitted}
)

Creates a material design app bar.

The arguments primary, toolbarOpacity, bottomOpacity and automaticallyImplyLeading must not be null. Additionally, if elevation is specified, it must be non-negative.

If backgroundColor, elevation, brightness, iconTheme, actionsIconTheme, or textTheme are null, then their VxAppBarTheme values will be used. If the corresponding VxAppBarTheme property is null, then the default specified in the property's documentation will be used.

Typically used in the Scaffold.appBar property.

Implementation

VxAppBar({
  Key key,
  this.leading,
  this.automaticallyImplyLeading = true,
  this.title,
  this.actions,
  this.flexibleSpace,
  this.bottom,
  this.elevation,
  this.shape,
  this.backgroundColor,
  this.brightness,
  this.iconTheme,
  this.actionsIconTheme,
  this.textTheme,
  this.primary = true,
  this.centerTitle,
  this.titleSpacing = NavigationToolbar.kMiddleSpacing,
  this.toolbarOpacity = 1.0,
  this.bottomOpacity = 1.0,
  this.searchBar = false,
  this.searchHintText = 'Search here...',
  this.searchHintStyle = const TextStyle(
    color: Colors.white,
    fontSize: 14,
  ),
  this.searchTextStyle = const TextStyle(
    color: Colors.white,
  ),
  this.searchBarColorTheme = Colors.white,
  this.searchController,
  this.onTap,
  this.onChanged,
  this.onSubmitted,
})  : assert(automaticallyImplyLeading != null),
      assert(elevation == null || elevation >= 0.0),
      assert(primary != null),
      assert(titleSpacing != null),
      assert(toolbarOpacity != null),
      assert(bottomOpacity != null),
      preferredSize = Size.fromHeight(
        kToolbarHeight + (bottom?.preferredSize?.height ?? 0),
      ),
      super(key: key);