buildCustom method

  1. @override
Widget buildCustom({
  1. ChildWidgetBuilder? childBuilder,
  2. required BuildContext context,
  3. required JsonWidgetData data,
  4. Key? key,
})
override

Custom builder that subclasses must override and implement to return the actual Widget to be placed on the tree.

Implementation

@override
Widget buildCustom({
  ChildWidgetBuilder? childBuilder,
  required BuildContext context,
  required JsonWidgetData data,
  Key? key,
}) {
  assert(
    data.children?.isNotEmpty != true,
    '[JsonAppBarBuilder] does not support children.',
  );

  return AppBar(
    actions: actions == null
        ? null
        : [
            for (var data in actions!)
              data.build(
                childBuilder: childBuilder,
                context: context,
              ),
          ],
    actionsIconTheme: actionsIconTheme,
    automaticallyImplyLeading: automaticallyImplyLeading,
    backgroundColor: backgroundColor,
    bottom: bottom?.build(
      childBuilder: childBuilder,
      context: context,
    ) as PreferredSizeWidget?,
    bottomOpacity: bottomOpacity,
    centerTitle: centerTitle,
    elevation: elevation,
    excludeHeaderSemantics: excludeHeaderSemantics,
    flexibleSpace: flexibleSpace?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    foregroundColor: foregroundColor,
    iconTheme: iconTheme,
    key: key,
    leading: leading?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    leadingWidth: leadingWidth,
    notificationPredicate: notificationPredicate,
    primary: primary,
    scrolledUnderElevation: scrolledUnderElevation,
    shadowColor: shadowColor,
    shape: shape,
    surfaceTintColor: surfaceTintColor,
    systemOverlayStyle: systemOverlayStyle,
    title: title?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    titleTextStyle: titleTextStyle,
    toolbarTextStyle: toolbarTextStyle,
    titleSpacing: titleSpacing,
    toolbarHeight: toolbarHeight,
    toolbarOpacity: toolbarOpacity,
  );
}