FlutterAnimatedBorder constructor
FlutterAnimatedBorder({
- Key? key,
- AnimatedBorderController? controller,
- bool glow = true,
- double glowSpread = 3.7,
- bool clipGlowAtMargin = true,
- double margin = 8,
- double borderWidth = 2,
- AnimatedBorderRadius? borderRadius,
- Color childBackgroundColor = Colors.white,
- required Duration duration,
- bool autoStart = true,
- required AnimatedBorderSegments animationSegments,
- AnimatedBorderSegments? reverseAnimationSegments,
- 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;
}
}