Skip to content

Commit dc43519

Browse files
authored
Merge pull request #173 from FlutterFlow/pinkesh/widgets-in-tooltip
Added info on widget as tooltip + widget builders for custom widget
2 parents 7a03b0c + 260fcf4 commit dc43519

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

docs/ff-concepts/adding-customization/custom-widgets.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ this example, we will create a `ProductRatingBar` widget that uses a pub.dev dep
5757
</iframe>
5858
</div>
5959

60+
:::info[Widget Builder as Parameter]
61+
You can also leverage [**Widget Builders**](../../resources/ui/components/widget-builder-parameters.md) that allow you to pass in widgets to be used within the custom widget tree. This is especially useful when you want to dynamically substitute content for some part of a custom widget - like displaying an item in a custom widget popup.
62+
:::
63+
6064
### Properties: Width & Height
6165

6266
For custom widgets, it is mandatory to specify both width and height. These properties are required to size the custom widget appropriately. Without setting these dimensions, the custom widget will not render correctly within your application.

docs/resources/ui/components/creating-components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ respective widgets and action triggers.
224224

225225
Aside from standard data types used throughout FlutterFlow, you can also create parameters that are of type:
226226

227-
- **Action (callback)**: This allows component users to pass in actions into the component. The component can then invoke the action, usually referred to as a callback, in its own action flows. Callbacks are often using to handle events, like updating a parent's state when a button has been pressed. [You can learn more about how to use callbacks here.](/resources/ui/components/callbacks)
227+
- **Action (callback)**: This allows you to pass in actions into the component. The component can then invoke the action, usually referred to as a callback, in its own action flows. Callbacks are often using to handle events, like updating a parent's state when a button has been pressed. [You can learn more about how to use callbacks here.](/resources/ui/components/callbacks)
228228

229-
- **Widget Builders**: Widget builders allow the component users to pass in widgets to be used within the component's widget tree. This is especially useful when you want users to dynamically subsitute content for some part of a component - like displaying an item in a custom dropdown, or creating a component for some consistent layout. [You can learn more about how to use Widget Builders here.](widget-builder-parameters.md)
229+
- **Widget Builders**: Widget builders allows you to pass in widgets to be used within the component's widget tree. This is especially useful when you want to dynamically substitute content for some part of a component - like displaying an item in a custom dropdown, or creating a component for some consistent layout. [You can learn more about how to use Widget Builders here.](widget-builder-parameters.md)
230230

231231

232232
### Actions

docs/resources/ui/widgets/built-in-widgets/tooltip.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ tags: [Base Elements]
44

55
# Tooltip
66

7-
The Tooltip widget provides a textual description of a widget in a small popup box. It appears when the user taps or long-presses the widget or hovers over it. It's typically used to provide an explanation about the function of a widget.
7+
The Tooltip widget provides additional information or visual cues of a widget in a small popup box. It appears when the user taps or long-presses the widget or hovers over it. It's typically used to provide an explanation about the function of a widget.
88

99
:::info
1010
It is not frequently used on touch devices where tapping or long-pressing can initiate other actions. But they can be incredibly useful in the desktop environment where hover functionality is available.
1111
:::
1212

1313
![tooltip.png](imgs/tooltip.png)
1414

15-
## Adding *Tooltip* widget
15+
## Adding Tooltip widget
1616

1717
To add the *Tooltip* widget to your app:
1818

@@ -51,6 +51,38 @@ Widget** and then select **Tooltip** widget.
5151
You can customize the appearance and behavior of this widget using the various properties
5252
available under the Properties Panel.
5353

54+
### Component as Tooltip
55+
56+
Sometimes, you may want to display more than just text in a tooltip—such as images, icons, buttons, or other custom components. For example, in an e-commerce app, a tooltip could show a detailed breakdown of customer reviews when users hover over the overall rating.
57+
58+
To achieve this, simply set the **Tooltip Type** to **Component** and select the custom component you'd like to display.
59+
60+
<div style={{
61+
position: 'relative',
62+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
63+
height: 0,
64+
width: '100%'}}>
65+
<iframe
66+
src="https://demo.arcade.software/jnFUZZQ9pmCH5vgvhVVA?embed&show_copy_link=true"
67+
title=""
68+
style={{
69+
position: 'absolute',
70+
top: 0,
71+
left: 0,
72+
width: '100%',
73+
height: '100%',
74+
colorScheme: 'light'
75+
}}
76+
frameborder="0"
77+
loading="lazy"
78+
webkitAllowFullScreen
79+
mozAllowFullScreen
80+
allowFullScreen
81+
allow="clipboard-write">
82+
</iframe>
83+
</div>
84+
<p></p>
85+
5486
### Change trigger mode
5587

5688
On touch devices, the *Tooltip* opens on tap. To make it open on long press instead, use the **Trigger Mode** property.

0 commit comments

Comments
 (0)