Skip to content
pubscout

patterns_canvas

0.6.0, released 8 months ago by whidev.com

Draw patterns like stripes, dots, or checkers on Canvas elements or widgets in Flutter.

WASM-ready
$ flutter pub add patterns_canvas
Source repository

What it does

A utility library that lets you paint Canvas shapes or widgets with recurring graphic patterns such as dots, stripes, squares, and crosshatches. It provides classes and constructors for various patterns, along with scale behavior settings and methods to paint on rectangles, paths, circles, and widgets.

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

Use it when

  • You need to paint decorative patterns like stripes, dots, or checkers on custom canvas shapes or widgets.
  • You want to render custom backgrounds or texturing inside a CustomPainter.

Skip it when

  • You are looking for complete app UI-kits or ready-made complex components.
  • You only need standard solid color fills or linear/radial gradients provided natively by Flutter.

Strengths

  • Provides a variety of built-in pattern types like dots, crosshatch, and checkers.
  • Flexible painting methods to draw on paths, rects, circles, canvases, and widgets.
  • Supports custom feature counts and scale behaviors.

Weaknesses

  • Limited to the specific built-in patterns provided by the library.
  • Requires using CustomPainter and canvas operations.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
final Pattern pattern = DiagonalStripesThick(bgColor: Colors.lightGreenAccent, fgColor: Colors.black);
pattern.paintOnRect(canvas, size, rect);

Alternatives

Packages that do the same job and could replace patterns_canvas.

  • dom_builder

    Generate and manipulate virtual or real DOM elements, DSX, and HTML declarations.

  • gooey

    A layout-agnostic gooey and metaball effect widget for Flutter using fragment shaders.

  • prompt_dialog

    A JavaScript-like prompt dialog widget for Flutter applications.

  • niku

    Cascade-style builder for styling Flutter widgets