Shape constructor

Shape({
  1. Paint? paint,
  2. Map<GestureType, Function>? gestureCallbackMap,
  3. HitTestBehavior? hitTestBehavior,
})

Implementation

Shape({
  Paint? paint,
  Map<GestureType, Function>? gestureCallbackMap,
  HitTestBehavior? hitTestBehavior,
})  : paint = paint ??
          (Paint()
            ..strokeWidth = ShapeConstant.floatPrecision
            ..style = PaintingStyle.fill),
      gestureCallbackMap = gestureCallbackMap ?? {},
      hitTestBehavior = hitTestBehavior ?? HitTestBehavior.opaque {
  if (this.paint.strokeWidth == 0) {
    this.paint.strokeWidth = ShapeConstant.floatPrecision;
  }
}