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

Items for long lists are not aligned. #19

Closed
danielporto opened this issue May 10, 2020 · 11 comments
Closed

Items for long lists are not aligned. #19

danielporto opened this issue May 10, 2020 · 11 comments
Labels
bug Something isn't working

Comments

@danielporto
Copy link

Describe the bug
List comprised of more than 9 items are not aligned. The text for items from 10 and beyond is shifted. It would be better if all text have the same margins or an option to define it.
Problem should repeat for longer lists when the number of characters changes (100, 1000,...)

To Reproduce
Steps to reproduce the behavior:
Create any numbered list with more than 10 items.

Expected behavior
Text of all elements in list are aligned.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment(please complete the following information):
Flutter (Channel beta, v1.17.0, on Mac OS X 10.14.6 18G4032, locale en-PT)
• Flutter version 1.17.0 at /usr/local/Caskroom/flutter/latest/flutter
• Framework revision e6b34c2b5c (8 days ago), 2020-05-02 11:39:18 -0700
• Engine revision 540786dd51
• Dart version 2.8.1

@danielporto danielporto added the bug Something isn't working label May 10, 2020
@asjqkkkk
Copy link
Owner

Could you provide a specific screenshot or source data?

And is it used on the web or on Mobile?

@danielporto
Copy link
Author

Mobile, here goes the screenshot.
Please also notice the unintended line break after a bold text.
It seems to happen in long texts. The first one marked bold works, the second in the same line breaks the line.

Simulator Screen Shot - iPhone 11 Pro Max - 2020-05-10 at 12 11 19

@asjqkkkk
Copy link
Owner

It seems that it should be the positioning problem of WidgetSpan in RichText

I will consider later to see if there is a suitable solution

@asjqkkkk
Copy link
Owner

Hi, set selectable in PConfig to false can solve this issue.
But if you do that, you can no longer select text, because of #2

@danielporto
Copy link
Author

nice, it did solve the issue with the breaks after bold text.
I've enabled. No need to select.
The shift remains though.

@asjqkkkk
Copy link
Owner

nice, it did solve the issue with the breaks after bold text.
I've enabled. No need to select.
The shift remains though.

My English is not very good, dose it mean the problem is solved?

@danielporto
Copy link
Author

Sorry.
Problem 1 is solved: line breaks after bold text
Problem 2 is not: the paragraph shift starting with number 10, 11, 12... like in the screenshot.

@asjqkkkk
Copy link
Owner

image

do you mean this ?

@danielporto
Copy link
Author

Yes, exactly.
That's not horrible but would be nice to have it aligned.

@asjqkkkk
Copy link
Owner

you can use OlConfig with IndexWidget to custom the index, that can solve this problem

such as this:

        styleConfig: StyleConfig(
          olConfig: OlConfig(
            indexWidget: (deep, index){
              return Container(
                margin: EdgeInsets.only(left: 5, right: 5),
                child: Text(
                  index < 10 ?' $index.' : '$index',
                ),
              );
            }
          ),)

@danielporto
Copy link
Author

Nice! it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants