build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Constructs a FillScreen with a required child widget that fills the main content area.

Emphasizes simplicity for content-heavy screens with efficient filling via Expanded and low-overhead const initialization.

Implementation

@override
Widget build(BuildContext context) {
  /// Builds the screen layout using a full-screen [Scaffold] wrapped in [Expanded] for flexible content filling.
  ///
  /// Constructs a [Row] layout optionally including a sidebar via [PylonBuilder], followed by an [Expanded] [Scaffold] that:
  /// - Applies [overrideBackgroundColor] and handles navigation types ([NavigationType.drawer]) for primary content.
  /// - Stacks background ([background]) with content using [Stack] and [PylonRemove] for injector isolation ([InjectScreenFooter], [ArcaneSidebarInjector]).
  /// - Uses [Column] with [SafeArea] and [GlassStopper] for header/footer placement, ensuring theme propagation from [ArcaneTheme].
  /// - Centers the [child] in a [BackdropGroup] within [Gutter], supporting [fab] via [FabSocket] and [foreground] overlays.
  /// - Optimizes performance with [StackFit.expand] and [StackFit.passthrough] for minimal rebuilds in content-heavy scenarios.
  ///
  /// Integrates [Container]-like expansion for full layouts, referencing [Expanded], [Flexible], [SafeArea], and [ColorScheme] for efficient, theme-aware rendering.
  Widget? footer = this.footer ?? InjectScreenFooter.getFooterWidget(context);
  PylonBuilder? isidebar = context.pylonOr<ArcaneSidebarInjector>()?.builder;
  PylonBuilder? sidebar = this.sidebar ?? isidebar;
  Widget s = Row(
    children: [
      if (sidebar != null) sidebar(context),
      Expanded(
          child: Scaffold(
              overrideBackgroundColor: overrideBackgroundColor,
              primary:
                  context.pylonOr<NavigationType>() != NavigationType.drawer,
              child: Stack(
                fit: StackFit.expand,
                children: [
                  if (background != null)
                    PylonRemove<InjectScreenFooter>(
                        builder: (context) =>
                            PylonRemove<ArcaneSidebarInjector>(
                                builder: (context) => background!)),
                  Column(
                    crossAxisAlignment: CrossAxisAlignment.stretch,
                    mainAxisSize: MainAxisSize.max,
                    children: [
                      if (header != null)
                        SafeBar(
                            top: true,
                            builder: (context) => GlassStopper(
                                builder: (context) => PylonRemove<
                                        InjectScreenFooter>(
                                    builder: (context) =>
                                        PylonRemove<ArcaneSidebarInjector>(
                                            builder: (context) => header!)),
                                stopping: false)),
                      Expanded(
                          child: Column(
                        crossAxisAlignment: CrossAxisAlignment.stretch,
                        mainAxisSize: MainAxisSize.max,
                        children: [
                          Expanded(
                            child: Stack(
                              fit: StackFit.passthrough,
                              children: [
                                Positioned.fill(
                                    child: PylonRemove<InjectScreenFooter>(
                                        builder: (context) => PylonRemove<
                                                ArcaneSidebarInjector>(
                                            builder: (context) => Gutter(
                                                enabled: gutter ??
                                                    ArcaneTheme.of(context)
                                                        .gutter
                                                        .enabled,
                                                child: footer != null
                                                    ? child
                                                    : child)))),
                                if (fab != null)
                                  FabSocket(
                                      child: PylonRemove<InjectScreenFooter>(
                                          builder: (context) => PylonRemove<
                                                  ArcaneSidebarInjector>(
                                              builder: (context) => fab!))),
                                if (foreground != null)
                                  PylonRemove<InjectScreenFooter>(
                                      builder: (context) =>
                                          PylonRemove<ArcaneSidebarInjector>(
                                              builder: (context) =>
                                                  foreground!)),
                              ],
                            ),
                          ),
                          if (footer != null)
                            SafeBar(
                                bottom: true,
                                builder: (context) => GlassStopper(
                                    builder: (context) =>
                                        PylonRemove<InjectScreenFooter>(
                                            builder: (context) => PylonRemove<
                                                    ArcaneSidebarInjector>(
                                                builder: (context) =>
                                                    footer)),
                                    stopping: false)),
                        ],
                      ))
                    ],
                  )
                ],
              )))
    ],
  );

  s = BackdropGroup(backdropKey: globalBlurBackdropKey, child: s);
  return s;
}