Skip to content
Articles
Article

Draw an SVG icon in Flutter without a package: SVG path commands to CustomPainter

by Chanpenh Yorn dev.to

3 min read

flutter_svg is the right answer when you need to show a lot of SVG files. But for a single icon you want to animate, recolour per path, clip with, or ship with zero dependencies, a plain CustomPainter is often nicer. The good news: SVG path data maps almost one to one onto Flutter's Path API. The command table SVG Flutter Path M x y moveTo(x, y) L x y lineTo(x, y) H x / V y lineTo with the other …

Forum

Questions about this, or something to add?

Discuss on the forum

Topics CustomPainter Maps and location

Report this · Wrote this? Claim it

Supported by