Stack_Default function

Widget Stack_Default({
  1. required Widget header,
  2. required List<Widget> content,
  3. required Widget bumper,
  4. Alignment alignment = Alignment.topCenter,
  5. bool scroll = true,
  6. bool isLoading = false,
})

Implementation

Widget Stack_Default({
  required Widget header,
  required List<Widget> content,
  required Widget bumper,
  Alignment alignment = Alignment.topCenter,
  bool scroll = true,
  bool isLoading = false,
}) {
    return PopScope(
        canPop: false,
        child: Scaffold(
            resizeToAvoidBottomInset: scroll,
            body: SafeArea(
                child: Column(
                mainAxisAlignment: isLoading ? MainAxisAlignment.center : MainAxisAlignment.start,
                children: isLoading ? [loadingCircle()] : [
                        header,
                        !scroll ? Expanded(
                            child: Content(
                                content,
                                alignment: alignment
                            )
                        ) : Expanded(
                            child: SingleChildScrollView(
                                child: Content(content),
                            ),
                        ),
                        bumper,
                    ],
                ),
            ),
        ),
    );
}