scrollChild method

Widget? scrollChild(
  1. BuildContext context
)

The widget passed to the SingleChildScrollView in the parent class.

Implementation

Widget? scrollChild(BuildContext context) {
  /// Reference to the Webpage StatefulWidget
  final WebPageWidget? webPage =
      widget is WebPageWidget ? widget as WebPageWidget : null;

  /// The list of widgets finally displayed in the Webpage.
  final List<Widget> list = [];

  // Retrieve the first and foremost webpage
  final Widget? _widget = builder(context);

  if (_widget != null) {
    list.add(_widget);
  }

  // Retrieve a list of widgets that make up a webpage
  final List<Widget>? _list = buildList(context);

  if (_list != null && _list.isNotEmpty) {
    list.addAll(_list);
  }

  if (list.isEmpty) {
    list.add(const SizedBox());
  }

  // Supply a bottom bar or not?
  if (webPage != null &&
      (webPage.hasBottomBar == null || webPage.hasBottomBar == true)) {
    //
    Column? bottomColumn = webPage.bottomBar(context, webPage);

    bottomColumn ??= onBottomBar(context, webPage);

    BottomBar? _bottomBar;
    // Was a bottom bar column generated?
    if (bottomColumn != null) {
      //
      _bottomBar = BottomBar(children: bottomColumn);

      // Save the bottom bar for future use.
      _appBottomBar ??= _bottomBar;
      //
    } else if (_appBottomBar != null) {
      //
      _bottomBar = _appBottomBar!;
    }

    if (_bottomBar != null) {
      //
      list.add(SizedBox(height: screenSize.height / 10));

      list.add(_bottomBar);
    }
  }
  return Column(children: list);
}