Skip to content
pubscout

svg_clip

0.0.2, released 3 years ago by anvith.dev

Use an SVG file as a mask for clipping a Flutter widget.

WASM-ready
$ flutter pub add svg_clip
Source repository

What it does

The library provides a simple way to use an SVG file as a mask for clipping a Flutter widget. It allows you to create visually appealing designs by applying convenient shapes as masks to your widgets.

AI-written summary of version 0.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to clip a Flutter widget using a local SVG file shape.
  • You need custom non-standard widget clipping based on vector assets.

Skip it when

  • You need to load remote network SVGs for clipping.
  • You are working with complex SVGs that may not render paths correctly.

Strengths

  • Simple API with the SvgClip widget.
  • Allows custom vector-based clipping shapes.

Weaknesses

  • Supports local SVGs only.
  • Certain complex SVGs may not work as expected.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1

Add dependency to pubspec.yaml and provide local SVG assets.

SvgClip(
  asset: ClipAsset.local(path: "assets/images/cloud.svg"),
  child: const _ColoredBox(
    color: Colors.green,
    width: 300,
    height: 100,
  ),
)

Alternatives

Packages that do the same job and could replace svg_clip.

Works with

Packages commonly used together with svg_clip: ones it builds on, ones built on it, and its own family.