Issue
I used flutter_svg: ^0.18.0
to use svg images inside my project. But I cannot able to find a proper way to change the size of it.
Here’s my code
body: SafeArea(
child: Center(
child: SvgPicture.asset('assets/images/morelights.svg'),
),
),
Solution
I found a solution for this 🙂
Steps
- Wrap svg icon inside a container. ( Container should be a child widget)
- Set color of the container to transparent.
- Change the size of the container. (Svg icon inhert the size of parent widget.)
Note: You can use IconButton widget as well. Container works better in my case 🙂
Example
Answered By – Lojith Vinsuka Abeysinghe
Answer Checked By – Terry (FlutterFixes Volunteer)