-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ✨ Add disableAutoScroll to Showcase #386
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,6 +244,7 @@ class Showcase extends StatefulWidget { | |
/// will still provide a callback. | ||
final VoidCallback? onBarrierClick; | ||
|
||
final bool disableAutoScroll; | ||
const Showcase({ | ||
required this.key, | ||
required this.description, | ||
|
@@ -288,6 +289,7 @@ class Showcase extends StatefulWidget { | |
this.titleTextDirection, | ||
this.descriptionTextDirection, | ||
this.onBarrierClick, | ||
this.disableAutoScroll = false | ||
}) : height = null, | ||
width = null, | ||
container = null, | ||
|
@@ -325,6 +327,7 @@ class Showcase extends StatefulWidget { | |
this.disableDefaultTargetGestures = false, | ||
this.tooltipPosition, | ||
this.onBarrierClick, | ||
this.disableAutoScroll = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make default value true as if parent class( |
||
}) : showArrow = false, | ||
onToolTipClick = null, | ||
scaleAnimationDuration = const Duration(milliseconds: 300), | ||
|
@@ -386,7 +389,7 @@ class _ShowcaseState extends State<Showcase> { | |
}); | ||
|
||
if (activeStep == widget.key) { | ||
if (showCaseWidgetState.enableAutoScroll) { | ||
if (showCaseWidgetState.enableAutoScroll && !this.widget.disableAutoScroll) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe you can directly use |
||
_scrollIntoView(); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add documentation for this variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please rename this to the same variable used in
ShowCaseWidget
as they serve the same purpose? i.e.enableAutoScroll