Search packages, repositories and app categories

Package detailsv1.1.2

svg_path_parser

A Flutter/Dart utility to parse an SVG path into a equivalent Path object from dart:ui library.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
19.6K
Likes
61
Pub points
150

Install package

flutter pub add svg_path_parser

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter/Dart utility that converts SVG path data into a native Path object from the dart:ui library. This enables precise rendering of scalable vector graphics within Flutter apps across all supported platforms. The parser handles standard SVG path commands such as moveTo, lineTo, curveTo, and closePath, ensuring accurate geometric representation. It is ideal for developers integrating SVG assets without relying on external rendering tools or complex workarounds.

Use cases

  • Rendering SVG icons in Flutter apps
  • Converting SVG paths to custom paint shapes
  • Integrating vector graphics from design files
  • Creating dynamic path animations
  • Building custom vector-based UI components

Key features

  • Supports standard SVG path commands
  • Produces accurate dart:ui Path objects
  • Cross-platform compatibility
  • Lightweight and dependency-free
  • Handles complex path syntax correctly

Suitable for

  • Flutter developers working with SVG assets
  • UI designers integrating vector graphics
  • Apps requiring scalable and resolution-independent visuals
  • Developers building custom drawing tools

Considerations

  • Does not support advanced SVG features like gradients or masks
  • Requires valid SVG path syntax
  • Limited to path data, not full SVG parsing
  • No runtime error handling for malformed paths
  • Not suitable for complex SVG documents beyond path elements

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

svg_path_parser

Pub Version (including pre-releases) Flutter Test package

A Flutter/Dart utility to parse an SVG path into a equivalent Path object from dart:ui library.

Getting Started

Add this to your package's pubspec.yaml file:

dependencies:
  svg_path_parser: ^1.1.2

Now in your Dart code, you can use:

import 'package:svg_path_parser/svg_path_parser.dart';

You can use parseSvgPath() to parse a valid SVG path string to Path object;

Path path = parseSvgPath('m.29 47.85 14.58 14.57 62.2-62.2h-29.02z');

Examples

View the example folder to see an example (drawing flutter logo using svg paths).

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package