@@ -265,7 +265,8 @@ class Showcase extends StatefulWidget {
265
265
this .movingAnimationDuration = const Duration (milliseconds: 2000 ),
266
266
this .disableMovingAnimation,
267
267
this .disableScaleAnimation,
268
- this .tooltipPadding = const EdgeInsets .symmetric (vertical: 8 , horizontal: 8 ),
268
+ this .tooltipPadding =
269
+ const EdgeInsets .symmetric (vertical: 8 , horizontal: 8 ),
269
270
this .onToolTipClick,
270
271
this .targetPadding = EdgeInsets .zero,
271
272
this .blurValue,
@@ -290,7 +291,10 @@ class Showcase extends StatefulWidget {
290
291
"overlay opacity must be between 0 and 1." ),
291
292
assert (onTargetClick == null || disposeOnTap != null ,
292
293
"disposeOnTap is required if you're using onTargetClick" ),
293
- assert (disposeOnTap == null ? true : (onTargetClick == null ? false : true ),
294
+ assert (
295
+ disposeOnTap == null
296
+ ? true
297
+ : (onTargetClick == null ? false : true ),
294
298
"onTargetClick is required if you're using disposeOnTap" ),
295
299
super (key: key);
296
300
@@ -309,8 +313,8 @@ class Showcase extends StatefulWidget {
309
313
this .overlayColor = Colors .black45,
310
314
this .targetBorderRadius,
311
315
this .overlayOpacity = 0.75 ,
312
- this .scrollLoadingWidget =
313
- const CircularProgressIndicator ( valueColor: AlwaysStoppedAnimation (Colors .white)),
316
+ this .scrollLoadingWidget = const CircularProgressIndicator (
317
+ valueColor: AlwaysStoppedAnimation (Colors .white)),
314
318
this .onTargetClick,
315
319
this .disposeOnTap,
316
320
this .movingAnimationDuration = const Duration (milliseconds: 2000 ),
@@ -387,7 +391,9 @@ class _ShowcaseState extends State<Showcase> {
387
391
}
388
392
389
393
if (showCaseWidgetState.autoPlay) {
390
- timer = Timer (Duration (seconds: showCaseWidgetState.autoPlayDelay.inSeconds), _nextIfAny);
394
+ timer = Timer (
395
+ Duration (seconds: showCaseWidgetState.autoPlayDelay.inSeconds),
396
+ _nextIfAny);
391
397
}
392
398
}
393
399
}
@@ -456,13 +462,14 @@ class _ShowcaseState extends State<Showcase> {
456
462
if (widget.keys != null && widget.keys! .isNotEmpty) {
457
463
// loop through all keys and build a list of widgets to be displayed
458
464
for (final element in widget.keys! ) {
459
- RenderRepaintBoundary ? boundary =
460
- element.currentContext ! .findRenderObject () as RenderRepaintBoundary ? ;
465
+ RenderRepaintBoundary ? boundary = element.currentContext !
466
+ .findRenderObject () as RenderRepaintBoundary ? ;
461
467
// if (boundary == null) return await const SizedBox.shrink();
462
468
ui.Image image = await boundary! .toImage (pixelRatio: 2.0 );
463
469
final BuildContext context = element.currentContext! ;
464
470
RenderBox ? renderBox;
465
- if (context.mounted) renderBox = context.findRenderObject () as RenderBox ? ;
471
+ if (context.mounted)
472
+ renderBox = context.findRenderObject () as RenderBox ? ;
466
473
Offset offset = renderBox! .localToGlobal (Offset .zero);
467
474
list.add (
468
475
Positioned (
@@ -475,7 +482,8 @@ class _ShowcaseState extends State<Showcase> {
475
482
image: DecorationImage (
476
483
image: MemoryImage (
477
484
Uint8List .fromList (
478
- (await image.toByteData (format: ui.ImageByteFormat .png))!
485
+ (await image.toByteData (
486
+ format: ui.ImageByteFormat .png))!
479
487
.buffer
480
488
.asUint8List (),
481
489
),
@@ -544,25 +552,32 @@ class _ShowcaseState extends State<Showcase> {
544
552
clipper: RRectClipper (
545
553
area: _isScrollRunning ? Rect .zero : rectBound,
546
554
isCircle: widget.targetShapeBorder is CircleBorder ,
547
- radius: _isScrollRunning ? BorderRadius .zero : widget.targetBorderRadius,
548
- overlayPadding: _isScrollRunning ? EdgeInsets .zero : widget.targetPadding,
555
+ radius: _isScrollRunning
556
+ ? BorderRadius .zero
557
+ : widget.targetBorderRadius,
558
+ overlayPadding: _isScrollRunning
559
+ ? EdgeInsets .zero
560
+ : widget.targetPadding,
549
561
),
550
562
child: blur != 0
551
563
? BackdropFilter (
552
- filter: ImageFilter .blur (sigmaX: blur, sigmaY: blur),
564
+ filter:
565
+ ImageFilter .blur (sigmaX: blur, sigmaY: blur),
553
566
child: Container (
554
567
width: MediaQuery .sizeOf (context).width,
555
568
height: MediaQuery .sizeOf (context).height,
556
569
decoration: BoxDecoration (
557
- color: widget.overlayColor.withOpacity (widget.overlayOpacity),
570
+ color: widget.overlayColor
571
+ .withOpacity (widget.overlayOpacity),
558
572
),
559
573
),
560
574
)
561
575
: Container (
562
576
width: MediaQuery .sizeOf (context).width,
563
577
height: MediaQuery .sizeOf (context).height,
564
578
decoration: BoxDecoration (
565
- color: widget.overlayColor.withOpacity (widget.overlayOpacity),
579
+ color: widget.overlayColor
580
+ .withOpacity (widget.overlayOpacity),
566
581
),
567
582
),
568
583
),
@@ -577,12 +592,17 @@ class _ShowcaseState extends State<Showcase> {
577
592
clipper: RRectClipper (
578
593
area: _isScrollRunning ? Rect .zero : rectBound,
579
594
isCircle: widget.targetShapeBorder is CircleBorder ,
580
- radius: _isScrollRunning ? BorderRadius .zero : widget.targetBorderRadius,
581
- overlayPadding: _isScrollRunning ? EdgeInsets .zero : widget.targetPadding,
595
+ radius: _isScrollRunning
596
+ ? BorderRadius .zero
597
+ : widget.targetBorderRadius,
598
+ overlayPadding: _isScrollRunning
599
+ ? EdgeInsets .zero
600
+ : widget.targetPadding,
582
601
),
583
602
child: blur != 0
584
603
? BackdropFilter (
585
- filter: ImageFilter .blur (sigmaX: blur, sigmaY: blur),
604
+ filter:
605
+ ImageFilter .blur (sigmaX: blur, sigmaY: blur),
586
606
child: Container (
587
607
width: MediaQuery .sizeOf (context).width,
588
608
height: MediaQuery .sizeOf (context).height,
@@ -595,7 +615,8 @@ class _ShowcaseState extends State<Showcase> {
595
615
width: MediaQuery .sizeOf (context).width,
596
616
height: MediaQuery .sizeOf (context).height,
597
617
decoration: BoxDecoration (
598
- color: widget.overlayColor.withOpacity (widget.overlayOpacity),
618
+ color: widget.overlayColor
619
+ .withOpacity (widget.overlayOpacity),
599
620
),
600
621
),
601
622
),
@@ -610,12 +631,14 @@ class _ShowcaseState extends State<Showcase> {
610
631
onDoubleTap: widget.onTargetDoubleTap,
611
632
onLongPress: widget.onTargetLongPress,
612
633
shapeBorder: widget.targetShapeBorder,
613
- disableDefaultChildGestures: widget.disableDefaultTargetGestures,
634
+ disableDefaultChildGestures:
635
+ widget.disableDefaultTargetGestures,
614
636
),
615
637
if (widget.keys != null && widget.keys! .isNotEmpty) ...[
616
638
FutureBuilder <List <Widget >>(
617
639
future: _buildCopys (context),
618
- builder: (context, AsyncSnapshot <List <Widget >> snapshot) {
640
+ builder:
641
+ (context, AsyncSnapshot <List <Widget >> snapshot) {
619
642
if (snapshot.hasData &&
620
643
snapshot.data != null &&
621
644
snapshot.data! .isNotEmpty) {
@@ -645,10 +668,10 @@ class _ShowcaseState extends State<Showcase> {
645
668
contentWidth: widget.width,
646
669
onTooltipTap: _getOnTooltipTap,
647
670
tooltipPadding: widget.tooltipPadding,
648
- disableMovingAnimation:
649
- widget.disableMovingAnimation ?? showCaseWidgetState.disableMovingAnimation,
650
- disableScaleAnimation:
651
- widget.disableScaleAnimation ?? showCaseWidgetState.disableScaleAnimation,
671
+ disableMovingAnimation: widget.disableMovingAnimation ??
672
+ showCaseWidgetState.disableMovingAnimation,
673
+ disableScaleAnimation: widget.disableScaleAnimation ??
674
+ showCaseWidgetState.disableScaleAnimation,
652
675
movingAnimationDuration: widget.movingAnimationDuration,
653
676
tooltipBorderRadius: widget.tooltipBorderRadius,
654
677
scaleAnimationDuration: widget.scaleAnimationDuration,
0 commit comments