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

[PROBLEM] decoration appearing over the number instead of below #146

Open
AishaTariq opened this issue Aug 27, 2023 · 0 comments
Open

[PROBLEM] decoration appearing over the number instead of below #146

AishaTariq opened this issue Aug 27, 2023 · 0 comments

Comments

@AishaTariq
Copy link

When I try adding a color to the selected value by using the parameter called 'decoration', the decoration appears over the text, (effectively hiding the number) rather than appearing under it

Code:

                    NumberPicker(
                      value: systolicValue - diastolicValue,
                      minValue: 20,
                      maxValue: 250,
                      onChanged: (value) {},
                      decoration: BoxDecoration(
                        color: Theme.of(context)
                            .colorScheme
                            .primary,
                        borderRadius: BorderRadius.circular(10),
                      ),
                      selectedTextStyle: TextStyle(
                        fontSize: 24.0,
                        fontWeight: FontWeight.bold,
                        color: Theme.of(context).colorScheme.onPrimary,
                      ),
                    ),

Preview: (First two number pickers without decoration, third with decoration)
image

For simplicity, you can replace the variables with constant values to regenerate the issue:

                   NumberPicker(
                      value: 50,
                      minValue: 20,
                      maxValue: 250,
                      onChanged: (value) {},
                      decoration: BoxDecoration(
                        color: Colors.red,
                        borderRadius: BorderRadius.circular(10),
                      ),
                      selectedTextStyle: TextStyle(
                        fontSize: 24.0,
                        fontWeight: FontWeight.bold,
                        color: Colors.black,
                      ),
                    ),

Preview:
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

1 participant