paurakhsharma / flutter_chord

Lyrics Chord parser for Flutter
MIT License
24 stars 14 forks source link

Fix for overflow of long lines #7

Closed auhsor closed 2 years ago

auhsor commented 2 years ago

This is intended to make long lines wrap. Both the lyrics and chords will wrap if they are going to extend over the edge of a screen. This will also work if a user rotates the screen.

Basically there is some processing done on long lines to split them if they are larger than the screen width. There is an addition property of padding to take into account the width of the widget that is displaying the lyrics. Not sure if there is a better way to do this but it worked for me.

I'm not a pro at this so please review and fix any errors :)

auhsor commented 2 years ago

I've just noticed a bug with this. I'll check it out and update.

paurakhsharma commented 2 years ago

Thank you so much for the PR @auhsor , this looks like a way to do it. Please update it and let me know. I will try to look at it later as well.

auhsor commented 2 years ago

I've updated to fix the small bug. It seems to be working for me but additional testing would be great.

paurakhsharma commented 2 years ago

@auhsor Looks like there are some formatting issue with the code. You can fix them locally using this command:

flutter format --set-exit-if-changed .

and

flutter analyze .

And push them for github action test to pass. Thanks.

auhsor commented 2 years ago

Thanks, I'll work it out. To be honest, this is my first ever pull request so it's a bit of a learning experience.

paurakhsharma commented 2 years ago

Wow! This is really impressive for first pull request, well done! 👏

auhsor commented 2 years ago

Awesome! Another enhancement would be to possibly combine both the loops so the code is more efficient. It got a bit unwieldy when I tried that. I'm not sure how the performance is yet or if this is needed.