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

Improve Comments Section #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adhamjongsma
Copy link

Hey Wessel, this draft PR is almost done!

So I feel the need to pontificate that I'm not 100% sure this is the most elegant solution. This is my first foray into Dart.

So, for the lazy loading mechanism I did some reading on the Dart concept of streams and I basically setup a StreamController to manage adding the stream result manually, while I use the StreamSubscription to pause and resume the stream when the user scrolls far enough into view.

I didn't see any overlapping comments, oddly. Maybe there's a flutter SDK version issue here, but I did add a small amount of margin to all the comments in order to even out the spaces. Let me know what you think?

Note: I still need to edit some bits of this, for example, it will continue to try and load comments even when you scroll to the end, but I'll do that one evening next week. I just wanted to show you what I have so far just so you can either tell me that it looks good or that I need to start all over again lol.

Handle comment section stream with StreamController. StreamSubscription pauses the stream initially, while the StreamController is used to add the comment section data in until the user scrolls to the bottom of the screen.

Also added a small margin bottom to comments to even out the spaces between each item.
@wsloth
Copy link
Owner

wsloth commented Nov 8, 2021

Thanks for your PR @adhamjongsma ❤️ !! I'm a bit busy this week -- but I'll make sure to review it before the week ends. In the meantime I triggered the build pipeline so I can functionally test the changed 😁

@adhamjongsma
Copy link
Author

Yeah! There's no rush. Was just fun getting to grips with flutter.

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

Successfully merging this pull request may close these issues.

2 participants