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

Text alignment control #21

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

Text alignment control #21

danielporto opened this issue May 11, 2020 · 19 comments
Labels
enhancement New feature or request

Comments

@danielporto
Copy link

Is your feature request related to a problem? Please describe.
The text rendered is aligned to left only.

Describe the solution you'd like
It would be nice if we could justify, centralize and align it to right.

Describe alternatives you've considered
unfortunately there is no alternative right now.

@danielporto danielporto added the enhancement New feature or request label May 11, 2020
@asjqkkkk
Copy link
Owner

do you mean TextAlign property ?
image

@danielporto
Copy link
Author

Yep;
How can access this property from PConfig (I imagine this is the object, I'm starting to understand...)

@danielporto
Copy link
Author

Any hint on how access this property for a regular text?

@asjqkkkk
Copy link
Owner

😂I haven't provided this function yet
I will try to introduce it in v1.2.0

@miniskulljob
Copy link

Really looking forward to this being implemented.

@asjqkkkk
Copy link
Owner

Really looking forward to this being implemented.

sorry, I'm busy finding a new job now, I'll try to solve this issue today😅

@asjqkkkk
Copy link
Owner

image

Is that mean TextDirection ?

just like this:https://gallery.flutter.dev/#/

image

image

@asjqkkkk
Copy link
Owner

image

image

Is that ok?

@miniskulljob
Copy link

No, that's RTL support that another user mentioned in this issue: #14

What we mean is TextAlignment. You mentioned it in this comment: #21 (comment)

@asjqkkkk
Copy link
Owner

asjqkkkk commented May 26, 2020

No, that's RTL support that another user mentioned in this issue: #14

What we mean is TextAlignment. You mentioned it in this comment: #21 (comment)

Hi, you can have a try for:

  markdown_widget:
    git:
      url: https://github.com/asjqkkkk/markdown_widget.git
      ref: dev

and you can use TextConfig to set TextAlign, and it only supports for mobile now, if there seems to be no problem, I will update to v1.2.0😄

@miniskulljob
Copy link

No, that's RTL support that another user mentioned in this issue: #14
What we mean is TextAlignment. You mentioned it in this comment: #21 (comment)

Hi, you can have a try for:

  markdown_widget:
    git:
      url: https://github.com/asjqkkkk/markdown_widget.git
      ref: dev

and you can use TextConfig to set TextAlign, and it only supports for mobile now, if there seems to be no problem, I will update to v1.2.0😄

It's working, but it only centers the first line of the text, the next lines are always left aligned.

@asjqkkkk
Copy link
Owner

image

Is this right?

@miniskulljob
Copy link

Yes, that's how it should work.

@asjqkkkk
Copy link
Owner

Yes, that's how it should work.

can you show your screenshot, and the code , and your environment to help me locate the problem?

@miniskulljob
Copy link

Padding(
  padding: const EdgeInsets.all(20.0),
  child: MarkdownWidget(
    data: '''
**Lorem ipsum dolor**

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent quis sollicitudin ante. Aenean nisi sapien, sodales eu massa quis, eleifend aliquet eros.

Duis molestie auctor arcu, et euismod sapien efficitur id. Nam semper gravida nunc vitae venenatis. Proin quis accumsan quam. Sed auctor vehicula diam et lobortis. Proin vitae sodales sapien.

Fusce vitae urna ac nulla finibus convallis sed sit amet velit. Quisque non odio eget diam volutpat ullamcorper at at lorem. Etiam viverra erat vel sem elementum consequat quis pulvinar massa. Pellentesque lacus dolor, posuere eu congue vel, aliquam eu augue.
''',
    styleConfig: StyleConfig(
    pConfig: PConfig(
      textConfig: TextConfig(textAlign: TextAlign.center)
    )
  ),
),

image

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 1.18.0-11.1.pre, on Microsoft Windows [Versión 10.0.18363.778], locale es-ES)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.45.1)
[√] Connected device (1 available)

• No issues found!

@asjqkkkk
Copy link
Owner

Padding(
  padding: const EdgeInsets.all(20.0),
  child: MarkdownWidget(
    data: '''
**Lorem ipsum dolor**

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent quis sollicitudin ante. Aenean nisi sapien, sodales eu massa quis, eleifend aliquet eros.

Duis molestie auctor arcu, et euismod sapien efficitur id. Nam semper gravida nunc vitae venenatis. Proin quis accumsan quam. Sed auctor vehicula diam et lobortis. Proin vitae sodales sapien.

Fusce vitae urna ac nulla finibus convallis sed sit amet velit. Quisque non odio eget diam volutpat ullamcorper at at lorem. Etiam viverra erat vel sem elementum consequat quis pulvinar massa. Pellentesque lacus dolor, posuere eu congue vel, aliquam eu augue.
''',
    styleConfig: StyleConfig(
    pConfig: PConfig(
      textConfig: TextConfig(textAlign: TextAlign.center)
    )
  ),
),

image

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 1.18.0-11.1.pre, on Microsoft Windows [Versión 10.0.18363.778], locale es-ES)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.45.1)
[√] Connected device (1 available)

• No issues found!

I konw the problem. set selectable to false, and then it will be ok

@miniskulljob
Copy link

Yep, setting selectable to false certainly works. Nice catch.
Thanks for the help, good work.

@asjqkkkk
Copy link
Owner

asjqkkkk commented May 26, 2020

Yep, setting selectable to false certainly works. Nice catch.
Thanks for the help, good work.

Hi, you can change your dependency to v1.2.0 now😄

@danielporto
Copy link
Author

Man it works great!
Thanks a lot!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants