-
Notifications
You must be signed in to change notification settings - Fork 24
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
base: master
Are you sure you want to change the base?
Conversation
Added a call to widget.onChanged when stepper is started
passing next step to the onShowStep so that it can call next step on it's own
lib/src/step.dart
Outdated
@@ -415,6 +422,7 @@ class OnboardingStep { | |||
showPulseAnimation.hashCode ^ | |||
pulseInnerColor.hashCode ^ | |||
pulseOuterColor.hashCode ^ | |||
onShowStep.hashCode ^ |
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.
fix the indentation please.
lib/src/step.dart
Outdated
@@ -292,6 +295,7 @@ class OnboardingStep { | |||
Color? pulseInnerColor, | |||
Color? pulseOuterColor, | |||
TapCallback? onTapCallback, | |||
Function(VoidCallback nextStep)? onShowStep, |
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.
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"
Please fix the description, onShowStep is not a void callback. |
added new typedef ShowStepCallback updated indentation
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; | |||
|
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.
add inline docs for the new callback
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.