You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`SuperTooltip` It is super flexible and allows you to display ToolTips in the overlay of the screen. It gives you more flexibility over the Flutter standard ```Tooltip```. You have the option to make the whole screen covered with a background color. Tapping on the background closes the Tooltip.
`SuperTooltip` It is super flexible and allows you to display ToolTips in the overlay of the screen. It gives you more flexibility over the Flutter standard `Tooltip`. You have the option to make the whole screen covered with a background color. Tapping on the background closes the Tooltip.
You have to make your Widget a `StatefulWidget` and you just need to create a controller to manage state of tooltips, you can do so by defining an instance of a `SuperTooltipController` and pass it through to constructor.
37
38
@@ -48,7 +49,6 @@ You have to make your Widget a `StatefulWidget` and you just need to create a co
48
49
}
49
50
```
50
51
51
-
52
52
You need to wrap `SuperTooltip` with a `GestureDetector`, `MouseRegion` or `InkWell` that is responsible for showing and hiding the content. Further handling of the tooltip state can be managed explicitly through a controller
53
53
54
54
```dart
@@ -115,16 +115,38 @@ SuperTooltip(
115
115
//....
116
116
),
117
117
```
118
+
118
119
Change Popup direction to `TooltipDirection.right`, `TooltipDirection.left`, `TooltipDirection.bottom` and `TooltipDirection.up`
To customize the shape of the popup or apply your own decoration, you can utilize the `decorationBuilder` property. This allows you to access the `target` property and define a custom shape or decoration for the tooltip.
132
+
133
+
```dart
134
+
SuperTooltip(
135
+
decorationBuilder:(target){
136
+
return ShapeDecoration(
137
+
//...
138
+
shape: CustomShape(
139
+
//...
140
+
target: target,
141
+
),
142
+
);
143
+
}
144
+
//...
145
+
)
146
+
```
147
+
148
+
149
+
## Barrier
128
150
129
151
If you'd like to keep the user from dismissing the tooltip by clicking on the barrier, you can change `showBarrier` to `true` which means pressing on the scrim area will not immediately hide the tooltip.
130
152
@@ -136,18 +158,20 @@ SuperTooltip(
136
158
)
137
159
```
138
160
139
-
## Blur
140
-
If you'd like to also show blur behind the pop up, you can do that by making the `showDropBoxFilter` to `true` you must also enable `showBarrier` then set `sigmaX` and `sigmaY`
161
+
## Blur
162
+
163
+
If you'd like to also show blur behind the pop up, you can do that by making the `showDropBoxFilter` to `true` you must also enable `showBarrier` then set `sigmaX` and `sigmaY`
If you'd like to simply react to open or close states, you can pass through `onHide` or `onShow` callbacks to the default constructor.
@@ -163,7 +187,7 @@ SuperTooltip(
163
187
),
164
188
```
165
189
166
-
To hide the tooltip when the user tap the back button. Wrap your `GestureDetector` widget with `WillPopScope` widget passing a callback function to `onWillPop` like the example below
190
+
To hide the tooltip when the user tap the back button. Wrap your `GestureDetector` widget with `WillPopScope` widget passing a callback function to `onWillPop` like the example below
167
191
168
192
```dart
169
193
return WillPopScope(
@@ -177,7 +201,8 @@ To hide the tooltip when the user tap the back button. Wrap your `GestureDetecto
177
201
);
178
202
```
179
203
180
-
Create a callback function to dismiss
204
+
Create a callback function to dismiss
205
+
181
206
```dart
182
207
Future<bool> _willPopCallback() async {
183
208
// If the tooltip is open we don't pop the page on a backbutton press
0 commit comments