The Beauty of Fractals in Flutter

Or how little loops look splendid when they come together

Constantin Stan
Flutter Community

--

Flaming dragon (23 iterations)

What are fractals in one word?

Patterns.

In more words: never-ending patterns that repeat themselves at different scales.

Although made by repeating a simple process, these patterns can become very complex.

In nature, you can see the branching ones in trees, lightning, leaves, river networks and the spiral ones in snail shells, hurricanes, galaxies, and others.

In mathematics, we form them by calculating a simple equation for a large number of times and cumulating the result. Unlike the fractals from nature, which are finite, we can go to infinity with the fractals from mathematics.

So, if nature has them, mathematics has them, then it is time for us to have them as well in Flutter.

Flutteractals

We’re going to use the tools Flutter puts on the table for painting it possible:

  • CustomPaint — the space we paint in (provides a Canvas and specifies a CustomPainter)
  • CustomPainter — paints on the Canvas the things we want
  • Paint — the paint style we use (strokes, fills, filters)

--

--