build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Override this method to build widgets that depend on the state of the listenable (e.g., the current value of the animation).

Implementation

@override
Widget build(BuildContext context) {
  final Animation<double> animation = listenable as Animation<double>;
  return ColorFiltered(
      colorFilter: ColorFilter.mode(
          color.withOpacity(opacity * animation.value), BlendMode.srcOut),
      child: Stack(
        fit: StackFit.expand,
        children: [
          GestureDetector(
            onTap: onTap,
            child: Container(
              decoration: BoxDecoration(
                  color: color, backgroundBlendMode: BlendMode.dstOut),
            ),
          ),
          Positioned(
            width: dialKey.globalPaintBounds?.size.width,
            child: CompositedTransformFollower(
              link: layerLink,
              showWhenUnlinked: false,
              child: MouseRegion(
                cursor: SystemMouseCursors.click,
                child: () {
                  final Widget child = GestureDetector(
                    onTap: onTap,
                    child: Container(
                      width: dialKey.globalPaintBounds?.size.width,
                      height: dialKey.globalPaintBounds?.size.height,
                      decoration: ShapeDecoration(
                        shape: shape == const CircleBorder()
                            ? const StadiumBorder()
                            : shape,
                        color: Colors.white,
                      ),
                    ),
                  );
                  return child;
                }(),
              ),
            ),
          ),
        ],
      ));
}