Is there any library for Flutter (Dart) for drawing Graphs on the screen with a coordinate system? Or how would I approach doing it from scratch?
Like an artist's canvas is a physical surface to draw on, a Canvas in Flutter is a virtual surface for drawing. But unlike a regular art canvas, you can't paint on the Flutter canvas with physical brushes. Flutter Canvas uses a two-point (x and y) coordinate system to determine the position of a point on the screen.
There is no graph drawing library for Flutter right now. The Dart UI package contains a canvas implementation. There are some examples using the class: example mentioned in comment above, part two in the series of those blog post, or this official example in the Flutter repo. The official canvas example seems outdated, not all objects are rendered within the visible part of the canvas.
Flutter issues: There is an open issue for Charting library for Flutter #9043, and a documentation issue mentions questions regarding charting as well. Based on that information it doesn't seem like the Flutter team is currently working on charting components, so it could be done as a community effort.
Update: There is now a an open source Flutter library for charting created by Google called chart_flutter. Among the examples there is a simple line chart example which might fit your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With