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

after_layout VS addPostFrameCallback #22

Closed
mellowcello77 opened this issue Sep 20, 2021 · 4 comments
Closed

after_layout VS addPostFrameCallback #22

mellowcello77 opened this issue Sep 20, 2021 · 4 comments

Comments

@mellowcello77
Copy link

Please help me understand the difference between this package and using WidgetsBinding.instance!.addPostFrameCallback in initState. A call back works fine for me, I just don't know if I am missing something? Thanks

@tomwyr
Copy link

tomwyr commented Sep 23, 2021

This is literally what the packages does:
https://github.com/fluttercommunity/flutter_after_layout/blob/master/lib/after_layout.dart#L9

@Andreigr0
Copy link

So it's just a duplication. What for does it exist?

@slightfoot
Copy link
Member

It's just to add a nice callback function to make it standard across your app. Also addPostFrameCallback was not known or understood by many people when we made this. So they felt it was nicer to have a package.

@toknT
Copy link

toknT commented May 3, 2023

This is literally what the packages does: https://github.com/fluttercommunity/flutter_after_layout/blob/master/lib/after_layout.dart#L9

I am new comer , and can't find any code about how to use WidgetsBinding until meet your comment.

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

5 participants