toWidget method

  1. @override
AppBar toWidget(
  1. AnyWidgetContext context
)
override

Implementation

@override
AppBar toWidget(AnyWidgetContext context) {
  assert(() {
    final w = bottom?.toWidget(context);
    if (null == w) return true;
    if (w is! PreferredSizeWidget) {
      throw AssertionError(
          'Trying to add an Scaffold.appBar that does not implement PreferredSizeWidget');
    }
    return true;
  }(), '');
  return AppBar(
    key: key?.toFlutter(context),
    leading: leading?.toWidget(context),
    automaticallyImplyLeading: automaticallyImplyLeading ?? true,
    title: title?.toWidget(context),
    actions: actions?.getChildren(context) ?? const <Widget>[],
    flexibleSpace: flexibleSpace?.toWidget(context),
    bottom: bottom?.toWidget(context) as PreferredSizeWidget?,
    elevation: elevation,
    shadowColor: shadowColor?.toFlutter(context),
    shape: shape?.toFlutter(context),
    backgroundColor: backgroundColor?.toFlutter(context),
    foregroundColor: foregroundColor?.toFlutter(context),
    iconTheme: iconTheme?.toFlutter(context),
    actionsIconTheme: actionsIconTheme?.toFlutter(context),
    primary: primary ?? true,
    centerTitle: centerTitle,
    excludeHeaderSemantics: excludeHeaderSemantics ?? false,
    titleSpacing: titleSpacing,
    toolbarOpacity: toolbarOpacity ?? 1.0,
    bottomOpacity: bottomOpacity ?? 1.0,
    toolbarHeight: toolbarHeight,
    leadingWidth: leadingWidth,
    toolbarTextStyle: toolbarTextStyle?.toFlutter(context),
    titleTextStyle: titleTextStyle?.toFlutter(context),
    systemOverlayStyle: systemOverlayStyle?.toFlutter(context),
  );
}