scaffold function

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

Implementation

Widget scaffold({
  required final Widget body,
  final Key? key,
  final PreferredSizeWidget? appBar,
  final Widget? drawer,
  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,
        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),
        ),
      ),
    );