buildHeader method

Widget buildHeader(
  1. BuildContext context
)

Implementation

Widget buildHeader(BuildContext context) {
  return Container(
    color: widget.headerBackgroundColor,
    child: Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: [
        Column(
          verticalDirection: VerticalDirection.up,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            if (widget.loadingProgress != null ||
                widget.loadingProgressIndeterminate)
              SizedBox(
                // to make it float
                height: 0,
                child: Stack(
                  clipBehavior: Clip.none,
                  fit: StackFit.passthrough,
                  children: [
                    Positioned(
                      left: 0,
                      right: 0,
                      child: LinearProgressIndicator(
                        backgroundColor: Colors.transparent,
                        value: widget.loadingProgressIndeterminate
                            ? null
                            : widget.loadingProgress,
                        showSparks: false,
                      ),
                    ),
                  ],
                ),
              ),
            Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
              for (var i = 0; i < widget.headers.length; i++)
                Data.inherit(
                  data: ScaffoldBarData(
                    childIndex: i,
                    childrenCount: widget.headers.length,
                  ),
                  child: widget.headers[i],
                ),
            ]),
          ],
        ),
        if (widget.loadingProgress != null && widget.showLoadingSparks)
          SizedBox(
            // to make it float
            height: 0,
            child: Stack(
              clipBehavior: Clip.none,
              fit: StackFit.passthrough,
              children: [
                Positioned(
                  left: 0,
                  right: 0,
                  child: LinearProgressIndicator(
                    backgroundColor: Colors.transparent,
                    value: widget.loadingProgressIndeterminate
                        ? null
                        : widget.loadingProgress,
                    showSparks: true,
                  ),
                ),
              ],
            ),
          ),
      ],
    ),
  );
}