build method

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

Render the LoadingScreen widget

Implementation

@override
Widget build(BuildContext context) {
  return Scaffold(
    backgroundColor: widget.backgroundColor,
    body: InkWell(
      child: Stack(
        fit: StackFit.expand,
        children: <Widget>[
          /// Paint the area where the inner widgets are loaded with the
          /// background to keep consistency with the screen background
          Container(
            decoration: BoxDecoration(color: widget.backgroundColor),
          ),

          /// Render the background image
          Visibility(
            visible: widget.image != null,
            child: Container(
              child: widget.image,
            ),
          ),

          /// Render the Title widget, loader and messages below each other
          Column(
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              Expanded(
                flex: 3,
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: <Widget>[
                    const Padding(
                      padding: EdgeInsets.only(top: kTextTabBarHeight - 10),
                    ),
                    widget.titleWidget ??
                        RichText(
                          text: TextSpan(
                            text: widget.title ?? 'Welcome In Our App',
                            style: widget.titleStyle ??
                                TextStyle(
                                  color: Colors.transparent.withOpacity(0.7),
                                  fontSize: 22,
                                  fontWeight: FontWeight.w700,
                                ),
                          ),
                        ),
                  ],
                ),
              ),
              Expanded(
                flex: 1,
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    /// Loader Animation Widget
                    CircularProgressIndicator(
                      valueColor: AlwaysStoppedAnimation<Color>(
                        widget.loaderColor ?? Theme.of(context).primaryColor,
                      ),
                    ),
                    const Padding(
                      padding: EdgeInsets.only(top: 20.0),
                    ),
                    Text(getMessage, style: widget.styleTextUnderTheLoader),
                  ],
                ),
              ),
            ],
          ),
        ],
      ),
    ),
  );
}