build method

Widget build (Widget bodyWidget)

Implementation

Widget build(Widget bodyWidget) {
  if (appBarVisibility && nestedAppBarVisibility) {
    throw Exception(
        "Both app bar widget and nested app bar widget are being used simultaneously. \n" +
            "Make app bar widget or nested app bar widget invisible for resolving this issue.");
  }

  /// Creates a visual scaffold for material design widgets.
  return Scaffold(
    key: scaffoldKey,
    primary: primary,
    appBar: this.appBarVisibility ? this.appBar : null,
    floatingActionButtonLocation: fabLocation,
    bottomNavigationBar:
        this.bottomNavigationBarVisibility ? this.bottomNavigationBar : null,
    drawer: this.drawerVisibility ? this.drawer : null,
    floatingActionButton: this.floatingActionButtonVisibility
        ? this.floatingActionButton
        : null,
    body: Container(
      decoration: BoxDecoration(
        color: backgroundType == BackgroundType.solidColor
            ? backgroundColor ?? colorPalette.primaryColor
            : null,
        gradient: backgroundType == BackgroundType.gradient
            ? LinearGradient(
                begin: Alignment.topCenter,
                end: Alignment.bottomCenter,
                colors: gradientBackgroundColors,
              )
            : null,
      ),
      child: nestedAppBarVisibility ? this.nestedAppBar : bodyWidget,
    ),
  );
}