builder method

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

Implementation

@override
Widget builder(BuildContext context) {
  return IconButton(
      icon: AnimatedIcon(
        icon: widget.icon,
        progress: _iconAnimationController,
        color: widget.iconColor,
        size: widget.iconSize,
        semanticLabel: widget.iconSemanticLabel,
        textDirection: widget.iconTextDirection,
      ),
      onPressed: () {
        var state = Bucket.of(context);
        if (state == null) return;
        if (state.isOpen) {
          // Close the bucket if it is opened
          closeBucket();
        } else {
          // Open the bucket if it is closed
          openBucket();
        }
      });
}