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

Call back or on done pressed handler? #11

Open
rlee1990 opened this issue Oct 2, 2024 · 2 comments
Open

Call back or on done pressed handler? #11

rlee1990 opened this issue Oct 2, 2024 · 2 comments

Comments

@rlee1990
Copy link

rlee1990 commented Oct 2, 2024

Is there a way to know when the done button is pressed or when the tour is done?

@godilite
Copy link

godilite commented Oct 10, 2024

@lukepighetti this is quite important for us also. Is there any possibilities?

@godilite
Copy link

godilite commented Oct 10, 2024

@rlee1990 I think a way that this could be done is to provide your own actionBuilder widget, and here you will receive a CalloutActionController controller. The controller has some properties

/// The current target's index.
 final int index;

 /// The total number of targets.
 final int pages;

 /// Convenience getter for if we're currently on the last page.
 bool get isLastPage => index + 1 == pages;

 /// Convenience getter for if we're currently on the first page.
 bool get isFirstPage => index == 0;

You can then check controller.isLastPage in your next button onPressed callback and handle done

Pretty much copy this default design https://github.com/lukepighetti/flutter_hotspot/blob/main/lib/src/hotspot_action_builder.dart and handle the last page check just above controller.next()

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

No branches or pull requests

2 participants