-
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?
Changes from 12 commits
0b5468f
1f2b6ae
e9b0965
d009bc1
3de91f6
2feb060
701d14a
24e3306
a757b61
fc77c99
61ebab6
5200c10
7ac3c47
2fc2465
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 |
---|---|---|
|
@@ -96,6 +96,7 @@ class OnboardingStep { | |
this.showPulseAnimation = false, | ||
this.pulseInnerColor = defaultInnerPulseColor, | ||
this.pulseOuterColor = defaultOuterPulseColor, | ||
this.onShowStep, | ||
this.onTapCallback, | ||
}) : assert(() { | ||
if (titleTextColor == null && titleTextStyle == null) { | ||
|
@@ -135,6 +136,8 @@ class OnboardingStep { | |
/// is required | ||
final FocusNode focusNode; | ||
|
||
final void Function(VoidCallback nextStep)? onShowStep; | ||
|
||
/// By default, the value used is `TextAlign.start` | ||
final TextAlign textAlign; | ||
|
||
|
@@ -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 commentThe 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" |
||
}) { | ||
return OnboardingStep( | ||
key: key ?? this.key, | ||
|
@@ -320,6 +324,7 @@ class OnboardingStep { | |
pulseInnerColor: pulseInnerColor ?? this.pulseInnerColor, | ||
pulseOuterColor: pulseOuterColor ?? this.pulseOuterColor, | ||
onTapCallback: onTapCallback ?? this.onTapCallback, | ||
onShowStep: onShowStep ?? this.onShowStep, | ||
); | ||
} | ||
|
||
|
@@ -352,6 +357,7 @@ class OnboardingStep { | |
pulseInnerColor: $pulseInnerColor, | ||
pulseOuterColor: $pulseOuterColor, | ||
onTapCallback: $onTapCallback, | ||
onShowStep: $onShowStep, | ||
)'''; | ||
} | ||
|
||
|
@@ -385,6 +391,7 @@ class OnboardingStep { | |
other.showPulseAnimation == showPulseAnimation && | ||
other.pulseInnerColor == pulseInnerColor && | ||
other.pulseOuterColor == pulseOuterColor && | ||
other.onShowStep == onShowStep && | ||
other.onTapCallback == onTapCallback; | ||
} | ||
|
||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. fix the indentation please. |
||
onTapCallback.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.
add inline docs for the new callback