ShutterButton constructor
ShutterButton({
- Key? key,
- required VoidCallback? onPressed,
- Color primaryColor = Colors.white,
- Color accentColor = Colors.teal,
- double innerArcSpeedMultiplier = 1.0,
- double outerArcSpeedMultiplier = 1.0,
- double? animatedLineStrokeWidth,
- double outerCircleStrokeWidth = 3,
- double? outerAnimatedArcRadius,
- double buttonSize = 56,
- double iconSize = 24,
- bool autosnappingMode = true,
Implementation
ShutterButton(
{Key? key,
required this.onPressed,
Color primaryColor = Colors.white,
Color accentColor = Colors.teal,
double innerArcSpeedMultiplier = 1.0,
double outerArcSpeedMultiplier = 1.0,
double? animatedLineStrokeWidth,
double outerCircleStrokeWidth = 3,
double? outerAnimatedArcRadius,
double buttonSize = 56,
double iconSize = 24,
bool autosnappingMode = true})
: super(key: key) {
button = Platform.isAndroid
? AndroidShutterButton(
buttonSize: buttonSize,
autosnappingMode: autosnappingMode,
innerArcSpeedMultiplier: innerArcSpeedMultiplier,
outerArcSpeedMultiplier: outerArcSpeedMultiplier,
outerAnimatedArcRadius: outerAnimatedArcRadius ?? 12,
animatedLineStrokeWidth: animatedLineStrokeWidth ?? 2,
accentColor: accentColor,
iconSize: iconSize,
primaryColor: primaryColor,
onPressed: onPressed,
)
: IosShutterButton(
buttonSize: buttonSize,
outerCircleStrokeWidth: outerCircleStrokeWidth,
accentColor: accentColor,
innerArcSpeedMultiplier: innerArcSpeedMultiplier,
outerArcSpeedMultiplier: outerArcSpeedMultiplier,
outerAnimatedArcRadius: outerAnimatedArcRadius ??
buttonSize / 2 - (animatedLineStrokeWidth ?? 2) / 2,
animatedLineStrokeWidth: animatedLineStrokeWidth ?? 2,
autosnappingMode: autosnappingMode,
onPressed: onPressed,
);
}