AndroidX Graphics Shapes

A library for easy creation, transformation, and morphing of rounded polygonal shapes. Contains predefined Material Design shapes that can be used at various components.

A Flutter port of the androidx.graphics.shapes library and the androidx.compose.material3.MaterialShapes object.

Table of contents

Features

Use this package in your Flutter app to:

Getting started

Prerequisites

This is a Flutter-only package. It requires the Flutter SDK to be installed. It doesn't work in a Dart-only environment.

Install the package

Add the package to a Flutter project:

flutter pub add androidx_graphics_shapes

Import the library

There are two options for importing the library, depending on whether you want to use M3 Shapes or not.

Shape manipulation is the base functionality of this package.

Only for shape manipulation

import 'package:androidx_graphics_shapes/shapes.dart`;

Both for using M3 Shapes and shape manipulation

import 'package:androidx_graphics_shapes/material_shapes.dart`;

Comparisons

This section will be updated once in a while, as it's hard to properly collect and compile the features of all packages.

Unpublished packages

The following packages can only be used as a Git dependency:

Published packages

The following packages are hosted on Pub and can be added to a project using flutter pub add:

This package

  • androidx_graphics_shapes by deminearchiver:

    • Hosted on Pub:
      androidx_graphics_shapes

    • Source code on GitHub:
      deminearchiver/dart-flutter-packages

    • Parity:
      Fully matches the native library in behavior. Contains modifications to original APIs that make the library more idiomatic and optimal to Dart. There is some extended functionality, such as the startAngle parameter being a double.

Libraries

material_shapes
A library for easy creation, transformation, and morphing of rounded polygonal shapes.
shapes
A library for easy creation, transformation, and morphing of rounded polygonal shapes.