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

The number text isn't centered #18

Open
michael-woolsey opened this issue Feb 22, 2021 · 2 comments
Open

The number text isn't centered #18

michael-woolsey opened this issue Feb 22, 2021 · 2 comments

Comments

@michael-woolsey
Copy link

michael-woolsey commented Feb 22, 2021

If you use this widget and you put it in a Row widget so that you can have widgets on either side of it, you will see that the text is not centered properly. I even tried a SizedBox, but even when it's big enough to see the text, it's off center to the left.

Using the Debug Paint really illustrates that the text box isn't expanded all the way across nor centered properly in this case.

For example (This row was also in a Column if that make a difference):

Row(
  children: [
    Padding(
      padding: const EdgeInsets.only(right: 8.0),
      child: Text('some text'),
    ),
    Flexible(
      child: SpinBox(
        min: 1.0,
        max: 10.0,
        value: 1.0,
        decimals: 1,
        step: 0.5,
      ),
    ),
    Expanded(child: Container()),
    TextButton(
      onPressed: () {},
      child: Text('button'),
    ),
  ],
),

Any thoughts?

Thank you,
Michael

@vitorhm
Copy link
Contributor

vitorhm commented Mar 11, 2021

In my case I was using a InputDecoration with horizontal contentPadding, that padding was causing the text not to be properly centered.

I tested your code and it's centered properly

@jpnurmi
Copy link
Collaborator

jpnurmi commented Apr 24, 2022

without prefix with prefix
image image

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

No branches or pull requests

3 participants