wrapInScaffold method

  1. @override
Widget wrapInScaffold(
  1. BuildContext context,
  2. PlatformLayoutInfo info
)
override

A modal page doesn't need a scaffold, and doesn't take up as much space as possible

Implementation

@override
Widget wrapInScaffold(BuildContext context, PlatformLayoutInfo info) {
  final SunnyPage widget = state.widget;
  final overrideBg = widget.isWhiteBg ? sunnyColors.white : null;
  var pageGuts = (widget.fab != null ||
          widget.underlay != null ||
          widget.overlay != null)
      ? Stack(
          children: [
            if (widget.underlay != null) widget.underlay!,
            buildPageGuts(context, info),
            if (widget.fab != null) widget.fab!(context),
            if (widget.overlay != null) widget.overlay!,
          ],
        )
      : buildPageGuts(context, info, shrinkWrap: shrinkWrap);
  return Container(
    color: overrideBg ?? sunnyColors.scaffoldBackground,
    child: pageGuts,
  );
}