LaunchLink class
A unified widget that provides a simplified API for launching various URL types.
This widget adapts its behavior and appearance based on the mode (Button vs Row) and type (WhatsApp, Email, Phone, etc.).
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- LaunchLink
Constructors
-
LaunchLink({Key? key, LaunchDisplayMode mode = LaunchDisplayMode.actionButton, required LaunchType type, String? label, String? visibleText, String? value, IconData? icon, LaunchIcon? customIcon, bool showIcon = true, LaunchStyle? style, String? emailSubject, String? emailBody, String? smsBody, VoidCallback? onTap, dynamic onResult(bool)?, List<
String> ? allowedSchemes, MainAxisAlignment? alignment}) -
Creates a unified LaunchLink widget.
const
Properties
- alignment → MainAxisAlignment?
-
Structural alignment of elements when mode is LaunchDisplayMode.linkRow.
final
-
allowedSchemes
→ List<
String> ? -
A restrictive list of URI schemes allowed for this launch.
final
- customIcon → LaunchIcon?
-
A more flexible custom icon/image provider (SVG, Assets, Network).
If provided, this takes precedence over icon.
final
- emailBody → String?
-
Pre-filled message body for LaunchType.email.
final
- emailSubject → String?
-
Pre-filled subject line for LaunchType.email.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
An optional custom icon (IconData) to override the default for the type.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
The label displayed when mode is LaunchDisplayMode.actionButton.
final
- mode → LaunchDisplayMode
-
The visual representation mode: LaunchDisplayMode.actionButton or LaunchDisplayMode.linkRow.
final
- onResult → dynamic Function(bool)?
-
Callback executed after the launch attempt, providing the success status.
final
- onTap → VoidCallback?
-
Callback executed immediately when the widget is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showIcon → bool
-
Whether to show the icon. Defaults to true.
final
- smsBody → String?
-
Pre-filled message text for LaunchType.sms.
final
- style → LaunchStyle?
-
Detailed styling configuration for the widget.
final
- type → LaunchType
-
The category of URL to be launched (e.g., LaunchType.whatsapp, LaunchType.email).
final
- value → String?
-
The primary data for the launch (phone number, email address, or raw URL).
final
- visibleText → String?
-
The text visible when mode is LaunchDisplayMode.linkRow.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited