buildInkWell method

  1. @protected
Widget buildInkWell(
  1. BuildParameters params
)

Implementation

@protected
Widget buildInkWell(BuildParameters params) {
  final overlayColor = tryParseColor(params.props["overlayColor"]);
  final onTapUp = events.getValueFunction(params.context,
      params.actions["onTapUp"], params.state, params.parentContext);
  final onTapDown = events.getValueFunction(params.context,
      params.actions["onTapDown"], params.state, params.parentContext);

  return InkWell(
    key: properties.getKey(params.id),
    borderRadius: params.buildProp("borderRadius"),
    customBorder: params.buildProp("customBorder"),
    overlayColor: overlayColor != null
        ? MaterialStateProperty.all<Color>(overlayColor)
        : null,
    highlightColor: tryParseColor(params.props["highlightColor"]),
    splashColor: tryParseColor(params.props["splashColor"]),
    hoverColor: tryParseColor(params.props["hoverColor"]),
    focusColor: tryParseColor(params.props["focusColor"]),
    onTapDown: onTapDown != null
        ? (a) =>
            onTapDown({"x": a.globalPosition.dx, "y": a.globalPosition.dy})
        : null,
    onTapUp: onTapUp != null
        ? (a) => onTapUp({"x": a.globalPosition.dx, "y": a.globalPosition.dy})
        : null,
    onTap: events.getFunction(params.context, params.actions["onTap"],
        params.state, params.parentContext),
    onDoubleTap: events.getFunction(params.context,
        params.actions["onDoubleTap"], params.state, params.parentContext),
    onLongPress: events.getFunction(params.context,
        params.actions["onLongPress"], params.state, params.parentContext),
    child: builder.tryBuildWidget(params.context, params.widgets["child"],
        params.state, params.parentContext),
  );
}