-
Notifications
You must be signed in to change notification settings - Fork 521
feat: ✨ Adds autoPlayDelay feature to Showcase widget #538
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
Conversation
aditya-css
left a comment
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.
Thanks for creating this PR.
Can you please address the comments I added and also include this PR link in the changelog?
analysis_options.yaml
Outdated
| formatter: | ||
| page_width: 80 | ||
|
|
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.
Please revert this. This won't work for the lowest flutter version supported by the package.
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.
Sorry, because I set the default width of dart formatting to be 100, I didn't want to break your original formatting when saving the file, so I added this rule. Now I have undone it.
lib/src/showcase/showcase_view.dart
Outdated
| _cancelTimer(); | ||
| _timer = Timer(autoPlayDelay, () => next(force: true)); | ||
| // Showcase is first. | ||
| final config = _getCurrentActiveControllers[_activeWidgetId!]; |
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.
The list returned by _getCurrentActiveControllers is different from the _ids list so _activeWidgetId can't be used to index it.
Here, you can use the first controller from the list.
| final config = _getCurrentActiveControllers[_activeWidgetId!]; | |
| final config = _getCurrentActiveControllers.firstOrNull; |
PS: The list is to support multiple showcase at the same time and in such case, the package takes config of the first widget.
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.
Thank you for your guidance. I have finished processing it.
Description
Sometimes, when the text is long or the content is particularly important, a Showcase may want a longer default display time than the autoPlayDelay provided by the ShowcaseWidget. Therefore, an autoPlayDelay feature has been added to Showcase.
Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues