GFAppBar constructor
GFAppBar({
- Key? key,
- Widget? leading,
- bool automaticallyImplyLeading = true,
- Widget? title,
- List<
Widget> ? actions, - Widget? flexibleSpace,
- PreferredSizeWidget? bottom,
- double? elevation,
- ShapeBorder? shape,
- Color? backgroundColor,
- Brightness? brightness,
- IconThemeData? iconTheme,
- IconThemeData? actionsIconTheme,
- TextTheme? textTheme,
- bool primary = true,
- bool? centerTitle,
- double titleSpacing = NavigationToolbar.kMiddleSpacing,
- double toolbarOpacity = 1.0,
- double bottomOpacity = 1.0,
- bool searchBar = false,
- String searchHintText = 'Search...',
- TextStyle searchHintStyle = const TextStyle(color: Colors.white, fontSize: 14),
- TextStyle searchTextStyle = const TextStyle(color: Colors.white),
- Color searchBarColorTheme = Colors.white,
- TextEditingController? searchController,
- GestureTapCallback? onTap,
- ValueChanged<
String> ? onChanged, - 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 GFAppBarTheme
values will be used. If the corresponding GFAppBarTheme property is null,
then the default specified in the property's documentation will be used.
Typically used in the Scaffold.appBar property.
Implementation
GFAppBar({
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...',
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(elevation == null || elevation >= 0.0),
preferredSize = Size.fromHeight(
kToolbarHeight + (bottom?.preferredSize.height ?? 0),
),
super(key: key);