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

About onEventSelected use ? #15

Open
nbutet opened this issue Sep 15, 2021 · 3 comments
Open

About onEventSelected use ? #15

nbutet opened this issue Sep 15, 2021 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@nbutet
Copy link

nbutet commented Sep 15, 2021

Hi,
can you explain how to use the onEventSelected property in the Calendar method ?
I would load another page on the event click with the event parameters ?
Thank you for your help.
NB.

@rwbr
Copy link
Owner

rwbr commented Sep 19, 2021

When you look at the source code of the package, you find these lines of code when building the event lis widget:

                  child: InkWell(
                     onTap: () {
                       if (widget.onEventSelected != null) {
                         widget.onEventSelected!(event);
                       }
                     },

The event list is the list of calendar events below the week or month view. The parameter onEventSelected is of type ValueChanged and can contain a callback function. If the parameter onEventSelected ist not null, on tapping one of the list elements leads to executing the function.

You can use this mechanism for instance to open a detail view showing informations about the selected calendar event.

@rwbr
Copy link
Owner

rwbr commented Sep 19, 2021

Do you recommend I should update the example code accordingly?

@nbutet
Copy link
Author

nbutet commented Sep 20, 2021

Yes, I think it would be great to update the example code.

Thank you for your answer about the callback function and the onEventSelected property.

Have a nice day.

@rwbr rwbr added the documentation Improvements or additions to documentation label Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants