1. override
void updateContext(GraphicsContext context)

Source

@override
void updateContext(GraphicsContext context) {

  const kappa = 0.5522848;
  var ox = (_width / 2) * kappa;
  var oy = (_height / 2) * kappa;
  var x1 = _x - _width / 2;
  var y1 = _y - _height / 2;
  var x2 = _x + _width / 2;
  var y2 = _y + _height / 2;
  var xm = _x;
  var ym = _y;

  context.moveTo(x1, ym);
  context.bezierCurveTo(x1, ym - oy, xm - ox, y1, xm, y1);
  context.bezierCurveTo(xm + ox, y1, x2, ym - oy, x2, ym);
  context.bezierCurveTo(x2, ym + oy, xm + ox, y2, xm, y2);
  context.bezierCurveTo(xm - ox, y2, x1, ym + oy, x1, ym);
  context.closePath();
}