How to add increase /configure weight/boldness (FontWeight) of an Icon in Flutter

2

I have an Icon (Back Icon to be Specific) in My Flutter App. It Looks Lighter. I Want to Make It Bold/Increase weight for Some Reason.

Container(
    child: Icon(
        Icons.arrow_back,
        color: Color(0xffffffff),
    ),
    padding: EdgeInsets.all(10.0),
    margin: EdgeInsets.fromLTRB(0, 10.0, 0, 0.0),
    decoration: BoxDecoration(
        color: Color(0xff03b673),
        borderRadius: BorderRadius.all(Radius.circular(100.0)),
    ),
)

Can't Find Any Thread/Documentation Regarding it.

flutter
icons
asked on Stack Overflow Jul 28, 2019 by imLolman • edited Dec 22, 2019 by Samet Ă–ZTOPRAK

2 Answers

0

icon size

Container(
child: Icon(
    Icons.arrow_back,
    color: Color(0xffffffff),
    size: 24.0
 ),
 padding: EdgeInsets.all(10.0),
 margin: EdgeInsets.fromLTRB(0, 10.0, 0, 0.0),
 decoration: BoxDecoration(
    color: Color(0xff03b673),
    borderRadius: BorderRadius.all(Radius.circular(100.0)),
 ),
)

At the moment,I think there is no fontWeight property on icons. you may import custom icon from fluttericon.com and when you import it under fonts you can set the font weight like this in pubspec.yaml:

flutter:
 fonts:
 - family: MyIcon
  fonts:
    - asset: lib/fonts/iconfont.ttf
      weight: 400

For complete steps follow this nice article: https://developpaper.com/flutter-taste-1-3-step-use-custom-icon/

answered on Stack Overflow Jul 28, 2019 by Mikethetechy • edited Jul 29, 2019 by Mikethetechy
0

You can do it by specifying icon size.

Container(
    child: Icon(
        Icons.arrow_back,
        size: 20.0
        color: Color(0xffffffff),
    ),
    padding: EdgeInsets.all(10.0),
    margin: EdgeInsets.fromLTRB(0, 10.0, 0, 0.0),
    decoration: BoxDecoration(
        color: Color(0xff03b673),
        borderRadius: BorderRadius.all(Radius.circular(100.0)),
    ),
)
answered on Stack Overflow Jul 28, 2019 by Lutfor Rahman

User contributions licensed under CC BY-SA 3.0