flutter_chord icon indicating copy to clipboard operation
flutter_chord copied to clipboard

chord overflows when it is in the end of the line

Open joshualessadias opened this issue 3 years ago • 19 comments
trafficstars

Screenshot_1646537325 it probably happens because the line breaking only watches the string size, not the chord size

joshualessadias avatar Mar 06 '22 03:03 joshualessadias

Thanks for this. This is an issue that we are aware of and plan to fix once time permits :)

auhsor avatar Mar 07 '22 22:03 auhsor

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.

auhsor avatar Mar 12 '22 04:03 auhsor

Thanks, @auhsor looking forward to it.

paurakhsharma avatar Mar 14 '22 07:03 paurakhsharma

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.

auhsor avatar Mar 17 '22 22:03 auhsor

Any update on this?

jeremiahlukus avatar Jun 27 '22 13:06 jeremiahlukus

Are you guy still maintaining this plugin? Otherwise, I need to find for other option cause my client is complaining this issue :D

alexaung avatar Sep 05 '22 12:09 alexaung

Send a PR @alexaung

jeremiahlukus avatar Sep 05 '22 15:09 jeremiahlukus

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.

paurakhsharma avatar Sep 06 '22 02:09 paurakhsharma

Ok, widgetPadding: 60, solved the issue. Thanks for workaround.

alexaung avatar Sep 06 '22 09:09 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.

this is work for dynamic font size???

I plan to add increse/decrease font size on my apps

fadhly-permata avatar Feb 23 '23 13:02 fadhly-permata

@fadhly-permata yes it will work for dynamic font size as well.

paurakhsharma avatar Feb 24 '23 01:02 paurakhsharma

Yep, I've tested.

It's working for dynamic font size. Thanks @paurakhsharma

fadhly-permata avatar Feb 24 '23 02:02 fadhly-permata

Thanks for making a good package.

Has this problem been fixed? I used padding. スクリーンショット 2023-04-07 10 44 42

jtaxiexpress avatar Apr 07 '23 01:04 jtaxiexpress

@jtaxiexpress can you please show the example code.

paurakhsharma avatar Apr 07 '23 03:04 paurakhsharma

@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 avatar Apr 07 '23 09:04 jtaxiexpress

@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]、,,
image

paurakhsharma avatar Apr 07 '23 13:04 paurakhsharma

@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 avatar Apr 08 '23 04:04 jtaxiexpress

@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 avatar Apr 10 '23 03:04 paurakhsharma

@paurakhsharma Yes ! This is a Pen. これはペンです。

。 is the English word . in English.

jtaxiexpress avatar Apr 10 '23 05:04 jtaxiexpress

Should be fixed by: https://github.com/paurakhsharma/flutter_chord/pull/32

paurakhsharma avatar Feb 24 '25 12:02 paurakhsharma