flutter_chord
flutter_chord copied to clipboard
chord overflows when it is in the end of the line
it probably happens because the line breaking only watches the string size, not the chord size
Thanks for this. This is an issue that we are aware of and plan to fix once time permits :)
So I've been working on a fix for this. I've rewritten the code for processing the text and will hopefully be ready for testing shortly.
Thanks, @auhsor looking forward to it.
No problem. I'm getting quite close to getting this working. I've rewritten the code a bunch of times as different edge cases caused issues.
Any update on this?
Are you guy still maintaining this plugin? Otherwise, I need to find for other option cause my client is complaining this issue :D
Send a PR @alexaung
Hey @alexaung sorry about that. I am working on a fix for it. For now, you can include widgetPadding parameter to fix this issue. This is just a workaround, for now, a better fix is incoming.
Ok, widgetPadding: 60, solved the issue. Thanks for workaround.
Hey @alexaung sorry about that. I am working on a fix for it. For now, you can include
widgetPaddingparameter to fix this issue. This is just a workaround, for now, a better fix is incoming.
this is work for dynamic font size???
I plan to add increse/decrease font size on my apps
@fadhly-permata yes it will work for dynamic font size as well.
Yep, I've tested.
It's working for dynamic font size. Thanks @paurakhsharma
Thanks for making a good package.
Has this problem been fixed?
I used padding.

@jtaxiexpress can you please show the example code.
@paurakhsharma Thanks response
Widget getPreview(){
try{
return LyricsRenderer(
lyrics: '''${getLyrics()}''',
textStyle: TextStyle(fontSize: 18, color: Colors.black,fontFamily: "Brand-Regular",),
chordStyle: TextStyle(fontSize: 20, color: Colors.blue,fontFamily: "Brand-Bold",),
onTapChord: (String chord) {
print('pressed chord: $chord');
},
showChord: true,
// transposeIncrement: transposeIncrement,
// scrollSpeed: scrollSpeed,
widgetPadding:154,
lineHeight: 4,
// horizontalAlignment: CrossAxisAlignment.start,
);
}catch(e){
return Center(child: CircularProgressIndicator(color: Colors.blue,),);
}
}
Positioned(
bottom: 0.0,
left: 0.0,
right: 0.0,
child: Padding(
padding: const EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0),
child: Container(
height: containerHeight2,
// height: containerHeight2,
width: double.infinity,
child:Expanded(
child: Container(
padding: const EdgeInsets.all(12.0),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topRight: Radius.circular(15.0),topLeft: Radius.circular(15.0)),
),
child: getPreview(),
),
),
),
),
),
@jtaxiexpress looks like this is happening because you do not have space in your lyrics. And the line cannot break. Can you try again by adding space in the middle of your lyrics.
This is the example lyrics I have used.
[C]もーもたろさんももたろさん、 おこしにつけた[D]、,,
@paurakhsharma Thanks ! But Japanese is not written in separate characters.
ex ) en)This is a pen. And this is an apple. ja)これはペンです。そしてこれはりんごです。
What should I do?
@jtaxiexpress Oh that sounds interesting. Currently, this package splits the text if it cannot fit in a line from a blank space. But I don't know how we might break the line in this case. Do you consider 。 to be similar to space (i.e is it sensible to split a line using 。)?
@paurakhsharma Yes ! This is a Pen. これはペンです。
。 is the English word . in English.
Should be fixed by: https://github.com/paurakhsharma/flutter_chord/pull/32