Skip to content

tnantoka/flutter_shapes

Repository files navigation

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.

About

Paint various shapes on canvas with Flutter CustomPainter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published