yako-dev / flutter_badges

A flutter package for creating badges.

Home Page:https://pub.dev/packages/badges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to change the size of the badge?

johnwangwjq opened this issue · comments

I want the badge circle a bit smaller. What should I do? There seems no a parameter to achieve this in the Badge constructor.

You can use the padding parameter to change the size.
For example, if you are using a text child:
Badge( padding: EdgeInsets.all(2), // less than the default 5 will reduce the size of the widget child: Text('1'), // if you change the font size of this, the badge will adapt to fit so reducing the size of the child will also reduce the size of the badge circle )