@@ -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;
@@ -61,10 +61,10 @@ class Showcase extends StatefulWidget {
61
61
final bool ? disposeOnTap;
62
62
final bool ? disableMovingAnimation;
63
63
final bool ? disableScaleAnimation;
64
- final EdgeInsets overlayPadding ;
64
+ final EdgeInsets targetPadding ;
65
65
final VoidCallback ? onTargetDoubleTap;
66
66
final VoidCallback ? onTargetLongPress;
67
- final BorderRadius ? tipBorderRadius ;
67
+ final BorderRadius ? tooltipBorderRadius ;
68
68
final TextAlign descriptionAlignment;
69
69
70
70
/// if disableDefaultTargetGestures parameter is true
@@ -111,12 +111,16 @@ class Showcase extends StatefulWidget {
111
111
this .titleAlignment = TextAlign .start,
112
112
required this .description,
113
113
this .descriptionAlignment = TextAlign .start,
114
- this .shapeBorder,
114
+ this .targetShapeBorder = const RoundedRectangleBorder (
115
+ borderRadius: BorderRadius .all (
116
+ Radius .circular (8 ),
117
+ ),
118
+ ),
115
119
this .overlayColor = Colors .black45,
116
120
this .overlayOpacity = 0.75 ,
117
121
this .titleTextStyle,
118
122
this .descTextStyle,
119
- this .showcaseBackgroundColor = Colors .white,
123
+ this .tooltipBackgroundColor = Colors .white,
120
124
this .textColor = Colors .black,
121
125
this .scrollLoadingWidget = const CircularProgressIndicator (
122
126
valueColor: AlwaysStoppedAnimation (Colors .white)),
@@ -126,15 +130,15 @@ class Showcase extends StatefulWidget {
126
130
this .movingAnimationDuration = const Duration (milliseconds: 2000 ),
127
131
this .disableMovingAnimation,
128
132
this .disableScaleAnimation,
129
- this .contentPadding =
133
+ this .tooltipPadding =
130
134
const EdgeInsets .symmetric (vertical: 8 , horizontal: 8 ),
131
135
this .onToolTipClick,
132
- this .overlayPadding = EdgeInsets .zero,
136
+ this .targetPadding = EdgeInsets .zero,
133
137
this .blurValue,
134
- this .radius ,
138
+ this .targetBorderRadius ,
135
139
this .onTargetLongPress,
136
140
this .onTargetDoubleTap,
137
- this .tipBorderRadius ,
141
+ this .tooltipBorderRadius ,
138
142
this .disableDefaultTargetGestures = false ,
139
143
this .scaleAnimationDuration = const Duration (milliseconds: 300 ),
140
144
this .scaleAnimationCurve = Curves .easeIn,
@@ -161,37 +165,41 @@ class Showcase extends StatefulWidget {
161
165
required this .container,
162
166
required this .height,
163
167
required this .width,
164
- this .title,
165
- this .titleAlignment = TextAlign .start,
166
- this .description ,
167
- this .descriptionAlignment = TextAlign .start ,
168
- this .shapeBorder ,
168
+ this .targetShapeBorder = const RoundedRectangleBorder (
169
+ borderRadius : BorderRadius . all (
170
+ Radius . circular ( 8 ) ,
171
+ ) ,
172
+ ) ,
169
173
this .overlayColor = Colors .black45,
170
- this .radius ,
174
+ this .targetBorderRadius ,
171
175
this .overlayOpacity = 0.75 ,
172
- this .titleTextStyle,
173
- this .descTextStyle,
174
- this .showcaseBackgroundColor = Colors .white,
175
- this .textColor = Colors .black,
176
176
this .scrollLoadingWidget = const CircularProgressIndicator (
177
177
valueColor: AlwaysStoppedAnimation (Colors .white)),
178
178
this .onTargetClick,
179
179
this .disposeOnTap,
180
180
this .movingAnimationDuration = const Duration (milliseconds: 2000 ),
181
181
this .disableMovingAnimation,
182
- this .contentPadding = const EdgeInsets .symmetric (vertical: 8 ),
183
- this .overlayPadding = EdgeInsets .zero,
182
+ this .targetPadding = EdgeInsets .zero,
184
183
this .blurValue,
185
184
this .onTargetLongPress,
186
185
this .onTargetDoubleTap,
187
- this .tipBorderRadius,
188
186
this .disableDefaultTargetGestures = false ,
189
187
}) : showArrow = false ,
190
188
onToolTipClick = null ,
191
189
scaleAnimationDuration = const Duration (milliseconds: 300 ),
192
190
scaleAnimationCurve = Curves .decelerate,
193
191
scaleAnimationAlignment = null ,
194
192
disableScaleAnimation = null ,
193
+ title = null ,
194
+ description = null ,
195
+ titleAlignment = TextAlign .start,
196
+ descriptionAlignment = TextAlign .start,
197
+ titleTextStyle = null ,
198
+ descTextStyle = null ,
199
+ tooltipBackgroundColor = Colors .white,
200
+ textColor = Colors .black,
201
+ tooltipBorderRadius = null ,
202
+ tooltipPadding = const EdgeInsets .symmetric (vertical: 8 ),
195
203
assert (overlayOpacity >= 0.0 && overlayOpacity <= 1.0 ,
196
204
"overlay opacity must be between 0 and 1." );
197
205
@@ -213,7 +221,7 @@ class _ShowcaseState extends State<Showcase> {
213
221
super .didChangeDependencies ();
214
222
position ?? = GetPosition (
215
223
key: widget.key,
216
- padding: widget.overlayPadding ,
224
+ padding: widget.targetPadding ,
217
225
screenWidth: MediaQuery .of (context).size.width,
218
226
screenHeight: MediaQuery .of (context).size.height,
219
227
);
@@ -264,7 +272,7 @@ class _ShowcaseState extends State<Showcase> {
264
272
final size = MediaQuery .of (context).size;
265
273
position = GetPosition (
266
274
key: widget.key,
267
- padding: widget.overlayPadding ,
275
+ padding: widget.targetPadding ,
268
276
screenWidth: size.width,
269
277
screenHeight: size.height,
270
278
);
@@ -277,7 +285,7 @@ class _ShowcaseState extends State<Showcase> {
277
285
278
286
Future <void > _nextIfAny () async {
279
287
if (timer != null && timer! .isActive) {
280
- if (showCaseWidgetState.autoPlayLockEnable ) {
288
+ if (showCaseWidgetState.enableAutoPlayLock ) {
281
289
return ;
282
290
}
283
291
timer! .cancel ();
@@ -343,12 +351,13 @@ class _ShowcaseState extends State<Showcase> {
343
351
child: ClipPath (
344
352
clipper: RRectClipper (
345
353
area: _isScrollRunning ? Rect .zero : rectBound,
346
- isCircle: widget.shapeBorder == const CircleBorder (),
347
- radius:
348
- _isScrollRunning ? BorderRadius .zero : widget.radius,
354
+ isCircle: widget.targetShapeBorder == const CircleBorder (),
355
+ radius: _isScrollRunning
356
+ ? BorderRadius .zero
357
+ : widget.targetBorderRadius,
349
358
overlayPadding: _isScrollRunning
350
359
? EdgeInsets .zero
351
- : widget.overlayPadding ,
360
+ : widget.targetPadding ,
352
361
),
353
362
child: blur != 0
354
363
? BackdropFilter (
@@ -378,10 +387,10 @@ class _ShowcaseState extends State<Showcase> {
378
387
offset: offset,
379
388
size: size,
380
389
onTap: _getOnTargetTap,
381
- radius: widget.radius ,
390
+ radius: widget.targetBorderRadius ,
382
391
onDoubleTap: widget.onTargetDoubleTap,
383
392
onLongPress: widget.onTargetLongPress,
384
- shapeBorder: widget.shapeBorder ,
393
+ shapeBorder: widget.targetShapeBorder ,
385
394
disableDefaultChildGestures:
386
395
widget.disableDefaultTargetGestures,
387
396
),
@@ -397,19 +406,19 @@ class _ShowcaseState extends State<Showcase> {
397
406
titleTextStyle: widget.titleTextStyle,
398
407
descTextStyle: widget.descTextStyle,
399
408
container: widget.container,
400
- tooltipColor : widget.showcaseBackgroundColor ,
409
+ tooltipBackgroundColor : widget.tooltipBackgroundColor ,
401
410
textColor: widget.textColor,
402
411
showArrow: widget.showArrow,
403
412
contentHeight: widget.height,
404
413
contentWidth: widget.width,
405
414
onTooltipTap: _getOnTooltipTap,
406
- contentPadding : widget.contentPadding ,
415
+ tooltipPadding : widget.tooltipPadding ,
407
416
disableMovingAnimation: widget.disableMovingAnimation ??
408
417
showCaseWidgetState.disableMovingAnimation,
409
418
disableScaleAnimation: widget.disableScaleAnimation ??
410
419
showCaseWidgetState.disableScaleAnimation,
411
420
movingAnimationDuration: widget.movingAnimationDuration,
412
- borderRadius : widget.tipBorderRadius ,
421
+ tooltipBorderRadius : widget.tooltipBorderRadius ,
413
422
scaleAnimationDuration: widget.scaleAnimationDuration,
414
423
scaleAnimationCurve: widget.scaleAnimationCurve,
415
424
scaleAnimationAlignment: widget.scaleAnimationAlignment,
0 commit comments