DeeplinklyPasteButton class
A system Paste button that recovers a deferred deep link without triggering iOS's "Pasted from…" banner.
iOS has no install-referrer API, so a link tapped before the app was
installed survives the App Store trip on the pasteboard. Reading it
automatically works, but shows the system paste banner. UIPasteControl
(iOS 16+) is the alternative: because the user taps the button themselves,
iOS treats that as the grant and no banner appears.
DeeplinklyPasteButton(
width: 140,
height: 44,
onPasted: (handled) {
if (handled) setState(() => _showButton = false);
},
fallback: const SizedBox.shrink(),
)
The recovered link arrives on FlutterDeeplinkly.instance.deepLinkStream
like any other deep link — onPasted only reports whether the pasted
content was one of your links, so you can dismiss the button or explain that
it was not.
Renders fallback on Android, on iOS below 16, and on any platform where the control is unavailable. fallback defaults to an empty box, so it is safe to place unconditionally.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DeeplinklyPasteButton
Constructors
- DeeplinklyPasteButton({Key? key, double width = 140, double height = 44, void onPasted(bool handled)?, Widget? fallback, DeeplinklyPasteButtonDisplayMode displayMode = DeeplinklyPasteButtonDisplayMode.iconAndLabel, DeeplinklyPasteButtonCornerStyle cornerStyle = DeeplinklyPasteButtonCornerStyle.capsule, Color? backgroundColor, Color? foregroundColor})
-
const
Properties
- backgroundColor → Color?
-
Button fill. Defaults to the system appearance.
final
- cornerStyle → DeeplinklyPasteButtonCornerStyle
-
Corner treatment. Defaults to the system's capsule shape.
final
- displayMode → DeeplinklyPasteButtonDisplayMode
-
Whether the button shows its icon, its label, or both.
final
- fallback → Widget?
-
Shown where the system control is unavailable. Defaults to an empty box.
final
- foregroundColor → Color?
-
Icon and label colour. Defaults to the system appearance.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
Height of the button's box.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onPasted → void Function(bool handled)?
-
Called after a tap with whether the pasted content was a Deeplinkly link
for one of your configured domains.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double
-
Width of the button's box.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DeeplinklyPasteButton> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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