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) {
  return Row(
    mainAxisSize: MainAxisSize.min,
    children: [
      Container(
        width: paddingAnimation.value + widthAnimation.value,
        height: containerSize.height,
        decoration: BoxDecoration(
          color: backgroundColor,
          gradient: gradientColor?.isNotEmpty ?? false
              ? LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  colors: gradientColor ?? [],
                )
              : null,
          borderRadius: BorderRadius.circular(borderRadius),
        ),
        child: Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            Padding(
              padding: EdgeInsets.only(
                left: iconSlideAnimation.value,
              ),
              child: Icon(
                icon,
                size: iconSize,
                color: foregroundColor,
              ),
            ),
          ],
        ),
      ),
      SizedBox(
        width: containerSize.width - widthAnimation.value,
        height: containerSize.height,
      ),
    ],
  );
}