Skip to content
Paint various shapes on canvas with Flutter CustomPainter
Dart Objective-C Java Shell HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Build with flutter 1.7.8 Aug 15, 2019
example Fix paint reset bug Oct 20, 2019
lib Fix paint reset bug Oct 20, 2019
test first commit Mar 20, 2019
web Build with flutter 1.7.8 Aug 15, 2019
.gitignore Ignore .idea Mar 20, 2019
.metadata first commit Mar 20, 2019
CHANGELOG.md first commit Mar 20, 2019
LICENSE first commit Mar 20, 2019
README.md
analysis_options.yaml first commit Mar 20, 2019
flutter_shapes.iml
heart.gif
pubspec.lock
pubspec.yaml Fix paint reset bug Oct 20, 2019
rotate.gif Support rotation Apr 10, 2019
screenshot.png Add paint example Apr 3, 2019
star.gif Add star.gif Apr 4, 2019

README.md

FlutterShapes

Live demo powered by Flutter for web.

Shape types

Adding FlutterShapes to your project

dependencies:
  flutter:
    sdk: flutter
  flutter_shapes:

Drawing a Shape

import 'package:flutter_shapes/flutter_shapes.dart';

class MyPainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    Paint paint = Paint()..color = Colors.black;
    Shapes shapes = Shapes(canvas: canvas, radius: 50, paint: paint, center: Offset.zero, angle: 0);

    shapes.drawCircle();                // method name
    shapes.drawType(ShapeType.Circle);  // enum
    shapes.draw('Circle');              // string
  }
}

Acknowledgements

https://proandroiddev.com/flutter-animation-creating-mediums-clap-animation-in-flutter-3168f047421e

A great article about animation with Flutter.
It helped me to write example codes.

You can’t perform that action at this time.