ShareButtonOptions class

Configuration options for a single share button in ShareButtonsComponent.

Defines the appearance and action for one social sharing button, allowing customization of icon, colors, visibility, and tap behavior.

Properties:

  • action: Callback invoked when button is tapped (required)
  • icon: IconData for button (null shows error_outline icon)
  • show: Visibility flag (true = show button, false = hide). Defaults to true
  • backgroundColor: Button background color. Defaults to Colors.blue
  • iconColor: Icon color. Defaults to Colors.white

Common Configurations:

// 1. Twitter share button
ShareButtonOptions(
  icon: FontAwesomeIcons.twitter,
  action: () => launchUrl(Uri.parse('https://twitter.com/...')),
  backgroundColor: Colors.lightBlue,
)

// 2. Custom action button
ShareButtonOptions(
  icon: Icons.link,
  action: () => showLinkDialog(),
  backgroundColor: Colors.green,
  show: hasPermission,
)

Constructors

ShareButtonOptions({required VoidCallback action, IconData? icon, bool show = true, Color? backgroundColor = Colors.blue, Color? iconColor = Colors.white})

Properties

action VoidCallback
final
backgroundColor Color?
final
hashCode int
The hash code for this object.
no setterinherited
icon IconData?
final
iconColor Color?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
show bool
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited