align method

Widget align(
  1. BuildContext context,
  2. Widget body,
  3. EdgeInsets sideInsets
)

Override to specify the alignment of the body within the layout. Ideal for implementing scroll views. The sideInsets are set to correspond with the dimensions of widgets returned by topSide, bottomSide, leftSide, and rightSide.

Implementation

Widget align(
  BuildContext context,
  Widget body,
  EdgeInsets sideInsets,
) {
  return Align(
    alignment: Alignment.topCenter,
    child: SingleChildScrollView(
      keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
      physics: const BouncingScrollPhysics(),
      child: Padding(
        padding: sideInsets,
        child: body,
      ),
    ),
  );
}