mafs_flutter 0.0.1
mafs_flutter: ^0.0.1 copied to clipboard
A Flutter library for creating interactive math visualizations. Port of the React Mafs library with pan/zoom, plots, shapes, and more.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.0.1 - 2025-06-18 #
Added #
Core
Mafswidget - Main container with pan and zoom supportViewBox- Configurable coordinate range with padding and aspect ratio optionsCameraController- Programmatic control of pan/zoom state
Display Components
MafsPoint- Render points at specific coordinatesMafsCircle- Circles with customizable fill and strokeMafsEllipse- Ellipses with rotation supportMafsPolygon- Closed polygons from vertex listMafsPolyline- Open polylines from vertex listMafsVector- Vectors with arrow headsMafsText- Text labels with cardinal direction anchoringMafsLaTeX- LaTeX rendering support (requiresflutter_math_fork)MafsWidget- Position any Flutter widget in math coordinates
Lines
Line.segment- Line segment between two pointsLine.throughPoints- Infinite line through two pointsLine.pointSlope- Infinite line with point and slopeLine.pointAngle- Infinite line with point and angle
Plots
Plot.ofX- Plot y = f(x) functionsPlot.ofY- Plot x = f(y) functionsPlot.parametric- Parametric curves (x(t), y(t))- Adaptive sampling for smooth curves at any zoom level
Coordinate Systems
Coordinates.cartesian- Cartesian grid with axes and labelsCoordinates.polar- Polar grid with concentric circles and radial lines- Auto-scaling grid that adjusts to zoom level
Transforms
MafsTransform- Apply geometric transformations to children- Support for translate, rotate, scale, shear, and custom matrices
- Transforms compose when nested
Interaction
MovablePoint- Draggable points with hover animations- Constraint functions for horizontal, vertical, or custom paths
Theming
MafsTheme- Customize colors and stylesMafsColors- Predefined color palette matching original Mafs
Infrastructure
- No Material or Cupertino dependencies - uses only
dart:ui,rendering, andwidgets - LeafRenderObjectWidget pattern for efficient rendering
- Comprehensive documentation with examples
- 519 tests covering all components
Notes #
This is the initial release of mafs_flutter, a Flutter port of the React Mafs library by Steven Petryk.