builder method

  1. @override
Widget builder(
  1. BuildContext context,
  2. BoxConstraints constraints,
  3. Widget child
)
override

Called when the layout needs to be rebuilt.

Allows the behaviour to include new widgets between the background and the provided child. (ie. include a GestureDetector to make the background interactive.

Implementation

@override
Widget builder(
    BuildContext context, BoxConstraints constraints, Widget child) {
  return GestureDetector(
    onTapDown: (details) => _onTap(context, details.globalPosition),
    child: ConstrainedBox(
      // necessary to force gesture detector to cover screen
      constraints: BoxConstraints(
          minHeight: double.infinity, minWidth: double.infinity),
      child: super.builder(context, constraints, child),
    ),
  );
}