AnyAnimatedButtonParams.progress constructor

AnyAnimatedButtonParams.progress({
  1. double? size,
  2. Color backgroundColor = Colors.blue,
  3. Color progressColor = Colors.white,
  4. EdgeInsets padding = const EdgeInsets.all(10.0),
  5. Duration duration = const Duration(milliseconds: 300),
})

Creates default look of progress button with customizable colors and sizes.

Implementation

factory AnyAnimatedButtonParams.progress({
  double? size,
  Color backgroundColor = Colors.blue,
  Color progressColor = Colors.white,
  EdgeInsets padding = const EdgeInsets.all(10.0),
  Duration duration = const Duration(milliseconds: 300),
}) =>
    AnyAnimatedButtonParams(
      width: size ?? _size,
      height: size ?? _size,
      duration: duration,
      decoration: BoxDecoration(
        borderRadius: _borderRadius,
        color: backgroundColor,
      ),
      child: Center(
        child: Padding(
          padding: padding,
          child: CircularProgressIndicator(
            valueColor: AlwaysStoppedAnimation<Color>(progressColor),
            strokeWidth: 3.0,
          ),
        ),
      ),
    );