Skip to content

Commit 1aa080d

Browse files
committed
fix: 🔨Fixed PR comments
1 parent b476dc8 commit 1aa080d

11 files changed

+555
-375
lines changed

lib/src/constants.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'package:flutter/material.dart';
22

3+
import 'widget/showcase_circular_progress_indecator.dart';
4+
35
class Constants {
46
Constants._();
57

@@ -34,10 +36,9 @@ class Constants {
3436
borderRadius: BorderRadius.all(Radius.circular(8)),
3537
);
3638

39+
static const double cupertinoActivityIndicatorRadius = 12.0;
3740
static const Widget defaultProgressIndicator =
38-
CircularProgressIndicator.adaptive(
39-
backgroundColor: Colors.white,
40-
);
41+
ShowcaseCircularProgressIndicator();
4142

4243
static const Duration defaultAnimationDuration = Duration(milliseconds: 2000);
4344
}

lib/src/get_position.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class GetPosition {
3232
this.padding = EdgeInsets.zero,
3333
this.rootRenderObject,
3434
}) {
35-
_getRenderBox();
35+
_getRenderBoxOffset();
3636
}
3737

3838
final RenderBox? renderBox;
@@ -43,7 +43,7 @@ class GetPosition {
4343

4444
Offset? _boxOffset;
4545

46-
void _getRenderBox() {
46+
void _getRenderBoxOffset() {
4747
if (renderBox == null) return;
4848

4949
_boxOffset = renderBox?.localToGlobal(

lib/src/layout_overlays.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ class OverlayBuilder extends StatefulWidget {
4646

4747
final WidgetBuilder? overlayBuilder;
4848
final Widget child;
49+
50+
/// A callback that provides a way to control the overlay visibility from
51+
/// showcase widget
52+
/// Basically we pass a reference to [_updateOverlay] function to parent so we
53+
/// can call this from parent class to update the overlay
54+
/// This callback provides a function that can be called with a boolean
55+
/// parameter to show (true) or hide (false) the overlay.
4956
final ValueSetter<ValueSetter<bool>> updateOverlay;
5057

5158
@override
@@ -141,7 +148,5 @@ class _OverlayBuilderState extends State<OverlayBuilder> {
141148
}
142149

143150
@override
144-
Widget build(BuildContext context) {
145-
return widget.child;
146-
}
151+
Widget build(BuildContext context) => widget.child;
147152
}

lib/src/models/linked_showcase_data.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,22 @@ class LinkedShowcaseDataModel {
1414
final EdgeInsets overlayPadding;
1515
final BorderRadius? radius;
1616
final bool isCircle;
17+
18+
@override
19+
bool operator ==(Object other) =>
20+
identical(this, other) ||
21+
other is LinkedShowcaseDataModel &&
22+
runtimeType == other.runtimeType &&
23+
rect == other.rect &&
24+
radius == other.radius &&
25+
overlayPadding == other.overlayPadding &&
26+
isCircle == other.isCircle;
27+
28+
@override
29+
int get hashCode => Object.hash(
30+
rect,
31+
radius,
32+
overlayPadding,
33+
isCircle,
34+
);
1735
}

lib/src/shape_clipper.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import 'dart:ui' as ui;
2424

25+
import 'package:flutter/foundation.dart';
2526
import 'package:flutter/material.dart';
2627

2728
import 'constants.dart';
@@ -108,5 +109,5 @@ class RRectClipper extends CustomClipper<ui.Path> {
108109
radius != oldClipper.radius ||
109110
overlayPadding != oldClipper.overlayPadding ||
110111
area != oldClipper.area ||
111-
linkedObjectData != oldClipper.linkedObjectData;
112+
!listEquals(linkedObjectData, oldClipper.linkedObjectData);
112113
}

0 commit comments

Comments
 (0)