buildCustom method

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

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

Implementation

@override
Scaffold buildCustom({
  ChildWidgetBuilder? childBuilder,
  required BuildContext context,
  required JsonWidgetData data,
  Key? key,
}) {
  final model = createModel(
    childBuilder: childBuilder,
    data: data,
  );

  return Scaffold(
    appBar: model.appBar?.build(
      childBuilder: childBuilder,
      context: context,
    ) as PreferredSizeWidget?,
    backgroundColor: model.backgroundColor,
    body: model.body?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    bottomNavigationBar: model.bottomNavigationBar?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    bottomSheet: model.bottomSheet?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    drawer: model.drawer?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    drawerDragStartBehavior: model.drawerDragStartBehavior,
    drawerEdgeDragWidth: model.drawerEdgeDragWidth,
    drawerEnableOpenDragGesture: model.drawerEnableOpenDragGesture,
    drawerScrimColor: model.drawerScrimColor,
    endDrawer: model.endDrawer?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    endDrawerEnableOpenDragGesture: model.endDrawerEnableOpenDragGesture,
    extendBody: model.extendBody,
    extendBodyBehindAppBar: model.extendBodyBehindAppBar,
    floatingActionButton: model.floatingActionButton?.build(
      childBuilder: childBuilder,
      context: context,
    ),
    floatingActionButtonAnimator: model.floatingActionButtonAnimator,
    floatingActionButtonLocation: model.floatingActionButtonLocation,
    key: key,
    onDrawerChanged: model.onDrawerChanged,
    onEndDrawerChanged: model.onEndDrawerChanged,
    persistentFooterAlignment: model.persistentFooterAlignment,
    persistentFooterButtons: model.persistentFooterButtons == null
        ? null
        : [
            for (var d in model.persistentFooterButtons!)
              d.build(
                childBuilder: childBuilder,
                context: context,
              ),
          ],
    primary: model.primary,
    resizeToAvoidBottomInset: model.resizeToAvoidBottomInset,
    restorationId: model.restorationId,
  );
}