feat(introduction_screen): Enable override* buttons to receive onPressed callback #234
+44
−36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Summary
This PR enhances the existing
override*
button APIs (overrideDone
,overrideNext
,overrideSkip
,overrideBack
) by passing them anonPressed
callback. Consumers can now supply fully custom widgets and wire up the built-in navigation logic, without having to manually hook intoIntroductionScreenState
.🧩 Motivation
Currently,
overrideDone
(and its siblings) accept aWidget?
, which makes it impossible to integrate the built-in navigation behavior (e.g. advancing to the next page, skipping). Users who want a custom button must:GlobalKey<IntroductionScreenState>
.This is cumbersome and error-prone. By passing the
onPressed
handler directly to the override builder, we:🛠️ Implementation
Signature change
Apply the same pattern to:
overrideNext
overrideSkip
overrideBack
Internally, when rendering an override button:
Where
_handleDone
is the existing navigation callback that invokesonDone
and advances the screen.🔍 Usage Example
All other override parameters work identically: