scaffold function

Widget scaffold({
  1. required Widget body,
  2. Key? key,
  3. PreferredSizeWidget? appBar,
  4. Widget? drawer,
  5. Widget? endDrawer,
  6. Widget? floatingActionButton,
  7. Widget? bottomNavigationBar,
  8. EdgeInsets? padding,
  9. Color? color,
  10. BoxDecoration? decoration,
  11. bool resizeToAvoidBottomInset = false,
  12. bool extendBodyBehindAppBar = false,
  13. FloatingActionButtonLocation floatingActionButtonLocation = FloatingActionButtonLocation.endFloat,
  14. BoxConstraints? constraints,
  15. Alignment? alignment,
})

Implementation

Widget scaffold({
  required final Widget body,
  final Key? key,
  final PreferredSizeWidget? appBar,
  final Widget? drawer,
  final Widget? endDrawer,
  final Widget? floatingActionButton,
  final Widget? bottomNavigationBar,
  final EdgeInsets? padding,
  final Color? color,
  final BoxDecoration? decoration,
  final bool resizeToAvoidBottomInset = false,
  final bool extendBodyBehindAppBar = false,
  final FloatingActionButtonLocation floatingActionButtonLocation = FloatingActionButtonLocation.endFloat,
  final BoxConstraints? constraints,
  final Alignment? alignment,
}) =>
    GestureDetector(
      onTap: () => FocusManager.instance.primaryFocus!.unfocus(),
      child: Scaffold(
        key: key,
        backgroundColor: color,
        appBar: appBar,
        endDrawer: endDrawer,
        drawer: drawer,
        extendBodyBehindAppBar: extendBodyBehindAppBar,
        resizeToAvoidBottomInset: resizeToAvoidBottomInset,
        floatingActionButton: floatingActionButton,
        floatingActionButtonLocation: floatingActionButtonLocation,
        bottomNavigationBar: bottomNavigationBar,
        body: Align(
          alignment: alignment ?? Alignment.topLeft,
          child: Container(constraints: constraints, decoration: decoration, padding: padding, child: body),
        ),
      ),
    );