FlutterAnimatedBorder constructor

FlutterAnimatedBorder({
  1. Key? key,
  2. AnimatedBorderController? controller,
  3. bool glow = true,
  4. double glowSpread = 3.7,
  5. bool clipGlowAtMargin = true,
  6. double margin = 8,
  7. double borderWidth = 2,
  8. AnimatedBorderRadius? borderRadius,
  9. Color childBackgroundColor = Colors.white,
  10. required Duration duration,
  11. bool autoStart = true,
  12. required AnimatedBorderSegments animationSegments,
  13. AnimatedBorderSegments? reverseAnimationSegments,
  14. required Widget child,
})

Implementation

FlutterAnimatedBorder({
  super.key,
  this.controller,
  this.glow = true,
  this.glowSpread = 3.7,
  this.clipGlowAtMargin = true,
  this.margin = 8,
  this.borderWidth = 2,
  this.borderRadius,
  this.childBackgroundColor = Colors.white,
  required this.duration,
  this.autoStart = true,
  required this.animationSegments,
  this.reverseAnimationSegments,
  required this.child,
}) {
  if (borderRadius != null) {
    glowBorderRadius = BorderRadius.only(
      topLeft: Radius.circular((borderRadius?.topLeft ?? 0) + borderWidth + margin),
      topRight: Radius.circular((borderRadius?.topRight ?? 0) + borderWidth + margin),
      bottomLeft: Radius.circular((borderRadius?.bottomLeft ?? 0) + borderWidth + margin),
      bottomRight: Radius.circular((borderRadius?.bottomRight ?? 0) + borderWidth + margin),
    );
    outerBorderRadius = BorderRadius.only(
      topLeft: Radius.circular((borderRadius?.topLeft ?? 0) + borderWidth),
      topRight: Radius.circular((borderRadius?.topRight ?? 0) + borderWidth),
      bottomLeft: Radius.circular((borderRadius?.bottomLeft ?? 0) + borderWidth),
      bottomRight: Radius.circular((borderRadius?.bottomRight ?? 0) + borderWidth),
    );
    innerBorderRadius = BorderRadius.only(
      topLeft: Radius.circular(borderRadius?.topLeft ?? 0),
      topRight: Radius.circular(borderRadius?.topRight ?? 0),
      bottomLeft: Radius.circular(borderRadius?.bottomLeft ?? 0),
      bottomRight: Radius.circular(borderRadius?.bottomRight ?? 0),
    );
  } else {
    glowBorderRadius = null;
    outerBorderRadius = null;
    innerBorderRadius = null;
  }
}