CkShareButton constructor

const CkShareButton({
  1. Key? key,
  2. required String title,
  3. required String deepLinkUrl,
  4. String? imageUrl,
  5. ByteData? byteImage,
  6. Widget? child,
  7. Widget builder(
    1. BuildContext context,
    2. Future<void> share(),
    3. bool isLoading
    )?,
  8. CkShareLoaderStyle loaderStyle = CkShareLoaderStyle.adaptiveEdge,
  9. BoxShape? shape,
  10. BorderRadius? borderRadius,
  11. double strokeWidth = 2.5,
  12. double strokeLengthFactor = 0.3,
  13. Color? loaderColor,
  14. Color? trackColor,
  15. double paddingOffset = 0.0,
  16. Duration animationDuration = const Duration(milliseconds: 1100),
  17. Widget? customLoader,
  18. VoidCallback? onTap,
  19. VoidCallback? onShareStart,
  20. VoidCallback? onShareSuccess,
  21. void onShareError(
    1. Object error
    )?,
})

Implementation

const CkShareButton({
  super.key,
  required this.title,
  required this.deepLinkUrl,
  this.imageUrl,
  this.byteImage,
  this.child,
  this.builder,
  this.loaderStyle = CkShareLoaderStyle.adaptiveEdge,
  this.shape,
  this.borderRadius,
  this.strokeWidth = 2.5,
  this.strokeLengthFactor = 0.3,
  this.loaderColor,
  this.trackColor,
  this.paddingOffset = 0.0,
  this.animationDuration = const Duration(milliseconds: 1100),
  this.customLoader,
  this.onTap,
  this.onShareStart,
  this.onShareSuccess,
  this.onShareError,
}) : assert(
       child != null || builder != null,
       'Either child or builder must be provided to CkShareButton.',
     ),
     assert(
       imageUrl != null || byteImage != null,
       'Either imageUrl or byteImage must be provided to CkShareButton.',
     );