ShutterButton constructor

ShutterButton({
  1. Key? key,
  2. required VoidCallback? onPressed,
  3. Color primaryColor = Colors.white,
  4. Color accentColor = Colors.teal,
  5. double innerArcSpeedMultiplier = 1.0,
  6. double outerArcSpeedMultiplier = 1.0,
  7. double? animatedLineStrokeWidth,
  8. double outerCircleStrokeWidth = 3,
  9. double? outerAnimatedArcRadius,
  10. double buttonSize = 56,
  11. double iconSize = 24,
  12. 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,
        );
}