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

feat: add better typing with generics #1431

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

jonasbadstuebner
Copy link

@jonasbadstuebner jonasbadstuebner commented Sep 26, 2023

Edit: Please have a look at this PR now.
I removed all the special stuff I did (I hope) - I will create new PRs for that seperately.

This PRs goal is to make use of the generics feature of Flutter to get rid of all the "dynamic" stuff that did lead to a lot of issues on my side and a lot of trouble implementing for example the calendar correctly.

With this PR merged, you can specify the type of custom Appointment like

SfCalendar<MyCustomAppointmentType>(
  [...]
)

It is a breaking change. But worth it in my opinion, because in every implementation there could be a casting error hiding right now. With using types, this is way less likely.
Also all the conversion steps from dynamic to any DateTime value are gone now.

I am happy to help and answer any question regarding this PR.

@jonasbadstuebner jonasbadstuebner changed the title Main feat: add better typing with generics Sep 26, 2023
@jonasbadstuebner jonasbadstuebner changed the title feat: add better typing with generics DRAFT: feat: add better typing with generics Sep 26, 2023
@jonasbadstuebner jonasbadstuebner changed the title DRAFT: feat: add better typing with generics feat: add better typing with generics Sep 26, 2023
@jonasbadstuebner
Copy link
Author

I also offer to implement the types in more places, these 3 packages are only the ones I use, that's why they I chose to do it there.

@VijayakumarMariappan VijayakumarMariappan added calendar Calendar component open Open labels Mar 18, 2024
@KrohnMi
Copy link

KrohnMi commented May 24, 2024

Why is this merge request open for so long?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
calendar Calendar component open Open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants