@@ -39,17 +39,17 @@ class Showcase extends StatefulWidget {
39
39
40
40
final Widget child;
41
41
final String ? title;
42
- final TextAlign ? titleAlignment;
42
+ final TextAlign titleAlignment;
43
43
final String ? description;
44
- final ShapeBorder ? shapeBorder ;
45
- final BorderRadius ? radius ;
44
+ final ShapeBorder targetShapeBorder ;
45
+ final BorderRadius ? targetBorderRadius ;
46
46
final TextStyle ? titleTextStyle;
47
47
final TextStyle ? descTextStyle;
48
- final EdgeInsets contentPadding ;
48
+ final EdgeInsets tooltipPadding ;
49
49
final Color overlayColor;
50
50
final double overlayOpacity;
51
51
final Widget ? container;
52
- final Color showcaseBackgroundColor ;
52
+ final Color tooltipBackgroundColor ;
53
53
final Color textColor;
54
54
final Widget scrollLoadingWidget;
55
55
final bool showArrow;
@@ -60,10 +60,10 @@ class Showcase extends StatefulWidget {
60
60
final VoidCallback ? onTargetClick;
61
61
final bool ? disposeOnTap;
62
62
final bool ? disableAnimation;
63
- final EdgeInsets overlayPadding ;
63
+ final EdgeInsets targetPadding ;
64
64
final VoidCallback ? onTargetDoubleTap;
65
65
final VoidCallback ? onTargetLongPress;
66
- final BorderRadius ? tipBorderRadius ;
66
+ final BorderRadius ? tooltipBorderRadius ;
67
67
final TextAlign descriptionAlignment;
68
68
69
69
/// if disableDefaultTargetGestures parameter is true
@@ -87,12 +87,16 @@ class Showcase extends StatefulWidget {
87
87
this .titleAlignment = TextAlign .start,
88
88
required this .description,
89
89
this .descriptionAlignment = TextAlign .start,
90
- this .shapeBorder,
90
+ this .targetShapeBorder = const RoundedRectangleBorder (
91
+ borderRadius: BorderRadius .all (
92
+ Radius .circular (8 ),
93
+ ),
94
+ ),
91
95
this .overlayColor = Colors .black45,
92
96
this .overlayOpacity = 0.75 ,
93
97
this .titleTextStyle,
94
98
this .descTextStyle,
95
- this .showcaseBackgroundColor = Colors .white,
99
+ this .tooltipBackgroundColor = Colors .white,
96
100
this .textColor = Colors .black,
97
101
this .scrollLoadingWidget = const CircularProgressIndicator (
98
102
valueColor: AlwaysStoppedAnimation (Colors .white)),
@@ -101,15 +105,15 @@ class Showcase extends StatefulWidget {
101
105
this .disposeOnTap,
102
106
this .animationDuration = const Duration (milliseconds: 2000 ),
103
107
this .disableAnimation,
104
- this .contentPadding =
108
+ this .tooltipPadding =
105
109
const EdgeInsets .symmetric (vertical: 8 , horizontal: 8 ),
106
110
this .onToolTipClick,
107
- this .overlayPadding = EdgeInsets .zero,
111
+ this .targetPadding = EdgeInsets .zero,
108
112
this .blurValue,
109
- this .radius ,
113
+ this .targetBorderRadius ,
110
114
this .onTargetLongPress,
111
115
this .onTargetDoubleTap,
112
- this .tipBorderRadius ,
116
+ this .tooltipBorderRadius ,
113
117
this .disableDefaultTargetGestures = false ,
114
118
}) : height = null ,
115
119
width = null ,
@@ -133,33 +137,37 @@ class Showcase extends StatefulWidget {
133
137
required this .container,
134
138
required this .height,
135
139
required this .width,
136
- this .title,
137
- this .titleAlignment = TextAlign .start,
138
- this .description ,
139
- this .descriptionAlignment = TextAlign .start ,
140
- this .shapeBorder ,
140
+ this .targetShapeBorder = const RoundedRectangleBorder (
141
+ borderRadius : BorderRadius . all (
142
+ Radius . circular ( 8 ) ,
143
+ ) ,
144
+ ) ,
141
145
this .overlayColor = Colors .black45,
142
- this .radius ,
146
+ this .targetBorderRadius ,
143
147
this .overlayOpacity = 0.75 ,
144
- this .titleTextStyle,
145
- this .descTextStyle,
146
- this .showcaseBackgroundColor = Colors .white,
147
- this .textColor = Colors .black,
148
148
this .scrollLoadingWidget = const CircularProgressIndicator (
149
149
valueColor: AlwaysStoppedAnimation (Colors .white)),
150
150
this .onTargetClick,
151
151
this .disposeOnTap,
152
152
this .animationDuration = const Duration (milliseconds: 2000 ),
153
153
this .disableAnimation,
154
- this .contentPadding = const EdgeInsets .symmetric (vertical: 8 ),
155
- this .overlayPadding = EdgeInsets .zero,
154
+ this .targetPadding = EdgeInsets .zero,
156
155
this .blurValue,
157
156
this .onTargetLongPress,
158
157
this .onTargetDoubleTap,
159
- this .tipBorderRadius,
160
158
this .disableDefaultTargetGestures = false ,
161
159
}) : showArrow = false ,
162
160
onToolTipClick = null ,
161
+ title = null ,
162
+ description = null ,
163
+ titleAlignment = TextAlign .start,
164
+ descriptionAlignment = TextAlign .start,
165
+ titleTextStyle = null ,
166
+ descTextStyle = null ,
167
+ tooltipBackgroundColor = Colors .white,
168
+ textColor = Colors .black,
169
+ tooltipBorderRadius = null ,
170
+ tooltipPadding = const EdgeInsets .symmetric (vertical: 8 ),
163
171
assert (overlayOpacity >= 0.0 && overlayOpacity <= 1.0 ,
164
172
"overlay opacity must be between 0 and 1." );
165
173
@@ -180,7 +188,7 @@ class _ShowcaseState extends State<Showcase> {
180
188
super .didChangeDependencies ();
181
189
position ?? = GetPosition (
182
190
key: widget.key,
183
- padding: widget.overlayPadding ,
191
+ padding: widget.targetPadding ,
184
192
screenWidth: MediaQuery .of (context).size.width,
185
193
screenHeight: MediaQuery .of (context).size.height,
186
194
);
@@ -231,7 +239,7 @@ class _ShowcaseState extends State<Showcase> {
231
239
final size = MediaQuery .of (context).size;
232
240
position = GetPosition (
233
241
key: widget.key,
234
- padding: widget.overlayPadding ,
242
+ padding: widget.targetPadding ,
235
243
screenWidth: size.width,
236
244
screenHeight: size.height,
237
245
);
@@ -244,7 +252,7 @@ class _ShowcaseState extends State<Showcase> {
244
252
245
253
void _nextIfAny () {
246
254
if (timer != null && timer! .isActive) {
247
- if (showCaseWidgetState.autoPlayLockEnable ) {
255
+ if (showCaseWidgetState.enableAutoPlayLock ) {
248
256
return ;
249
257
}
250
258
timer! .cancel ();
@@ -297,12 +305,13 @@ class _ShowcaseState extends State<Showcase> {
297
305
child: ClipPath (
298
306
clipper: RRectClipper (
299
307
area: _isScrollRunning ? Rect .zero : rectBound,
300
- isCircle: widget.shapeBorder == const CircleBorder (),
301
- radius:
302
- _isScrollRunning ? BorderRadius .zero : widget.radius,
308
+ isCircle: widget.targetShapeBorder == const CircleBorder (),
309
+ radius: _isScrollRunning
310
+ ? BorderRadius .zero
311
+ : widget.targetBorderRadius,
303
312
overlayPadding: _isScrollRunning
304
313
? EdgeInsets .zero
305
- : widget.overlayPadding ,
314
+ : widget.targetPadding ,
306
315
),
307
316
child: blur != 0
308
317
? BackdropFilter (
@@ -332,10 +341,10 @@ class _ShowcaseState extends State<Showcase> {
332
341
offset: offset,
333
342
size: size,
334
343
onTap: _getOnTargetTap,
335
- radius: widget.radius ,
344
+ radius: widget.targetBorderRadius ,
336
345
onDoubleTap: widget.onTargetDoubleTap,
337
346
onLongPress: widget.onTargetLongPress,
338
- shapeBorder: widget.shapeBorder ,
347
+ shapeBorder: widget.targetShapeBorder ,
339
348
disableDefaultChildGestures:
340
349
widget.disableDefaultTargetGestures,
341
350
),
@@ -351,17 +360,17 @@ class _ShowcaseState extends State<Showcase> {
351
360
titleTextStyle: widget.titleTextStyle,
352
361
descTextStyle: widget.descTextStyle,
353
362
container: widget.container,
354
- tooltipColor : widget.showcaseBackgroundColor ,
363
+ tooltipBackgroundColor : widget.tooltipBackgroundColor ,
355
364
textColor: widget.textColor,
356
365
showArrow: widget.showArrow,
357
366
contentHeight: widget.height,
358
367
contentWidth: widget.width,
359
368
onTooltipTap: _getOnTooltipTap,
360
- contentPadding : widget.contentPadding ,
369
+ tooltipPadding : widget.tooltipPadding ,
361
370
disableAnimation: widget.disableAnimation ??
362
371
showCaseWidgetState.disableAnimation,
363
372
animationDuration: widget.animationDuration,
364
- borderRadius : widget.tipBorderRadius ,
373
+ tooltipBorderRadius : widget.tooltipBorderRadius ,
365
374
),
366
375
],
367
376
)
0 commit comments