yako-dev/flutter_badges

Badge content positioning seems off....

pimvanderheijden opened this issue · 1 comments

Environment

macOS

Describe your question

Badge content positioning seems off and I can't seem to find an obvious way to control it.

It looks like this
image
Notice that content is positioned slightly toward the bottom left.

My code

    badges.Badge(
        badgeContent: SizedBox(
          width: 14,
          height: 14,
          child: Text(
            textAlign: TextAlign.center,
            count.toString(),
          ),
        ),
     ),

How is this supposed to work? Should I meddle with the positioning of my content widget? I expected this package to provide a solution... If not, can someone give an example of how to fix the problem?

I managed to get more normal looking badges by removing the SizedBox() widget.

badges.Badge(
        badgeContent: Padding(
            padding: EdgeInsets.all(1),
            child: Text(count.toString())
        )
)

image