A Flutter package for custom painting.
In this version of the Flutter package, we implemented a code that defines a widget named as CustomPolygonWidget
that allows users to interactively adjust the number of sides, size, and rotation of a polygon using sliders. The also implemented a class named as ShapePainter
that uses the provided parameters to draw the polygon on the canvas.
Additionally, we prepared the package for publishing on pub.dev, including setting up the necessary metadata and documentation.
- Use this package as a library, Run this command:
✔️ With Dart:
$ dart pub add custom_polygon_package
✔️ With Flutter:
$ flutter pub add custom_polygon_package
- This will add a line like this to your package's pubspec.yaml (and run an implicit
dart pub get
):
dependencies:
custom_polygon_package: ^0.0.1
- Now in your Dart code, you can use:
import 'package:custom_polygon_package/custom_polygon_package.dart';