Skip to content
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

Added onStart and onShowStep callbacks #63

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

bcaspe
Copy link

@bcaspe bcaspe commented Nov 18, 2024

I have added a VoidCallback? onStart method to the Onboarding class. This is called by the stepper to call in the startStepper method.

I also added a VoidCallback? onShowStep to the OnboardingStep class. This is called prior to the tween animation of the step in both the startStepper method as well as the _nextStep method.

@@ -415,6 +422,7 @@ class OnboardingStep {
showPulseAnimation.hashCode ^
pulseInnerColor.hashCode ^
pulseOuterColor.hashCode ^
onShowStep.hashCode ^
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the indentation please.

@@ -292,6 +295,7 @@ class OnboardingStep {
Color? pulseInnerColor,
Color? pulseOuterColor,
TapCallback? onTapCallback,
Function(VoidCallback nextStep)? onShowStep,
Copy link
Owner

@talamaska talamaska Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if you create a new typedef for this callback, named ShowStepCallback, I would prefer consistent naming of its argument, e.g. in TapCallback it is called "next", I would like this here to be also "next" and not "nextStep"

@talamaska
Copy link
Owner

Please fix the description, onShowStep is not a void callback.

added new typedef ShowStepCallback
updated indentation
@talamaska
Copy link
Owner

Also please add documentation about the new props, maybe with some example snippets in the readme.

@@ -35,6 +36,8 @@ class Onboarding extends StatefulWidget {
/// A callback that signal when the `Onboarding` is finished or stopped
final ValueChanged<int>? onEnd;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add inline docs for the new callback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants