dart_board_canvas 1.1.0 dart_board_canvas: ^1.1.0 copied to clipboard
Animated canvas feature - Use to mount animations to routes
dart_board_canvas #
This one is for fun. It provides a way to expose a Route which reveals an indeterminate animated canvas.
This is meant for physics/visual simulations and demo's. If you want access to the canvas to draw something cool, this is it.
It's similar to the flutter "funvas" project, and is designed for quick and dirty graphics work. It does not provide shorthand like funvas does.
Getting Started #
Adding to your App #
Add DartBoardCanvasFeature
to your application, it is configured to be registered multiple times under many namespaces if necessary. It binds an animated widget to a route.
params
showFpsOverlay
enable an app decoration that will show your canvas/draw performance/fps
implementationName & namespace
feature registration details
route
the route this feature will expose
stateBuilder
Builds the AnimatedCanvasState
instance
Implementing canvas effects. #
- Extend
AnimatedCanvasState
- implement
init(BuildContext context)
anddispose()
if necessary. - implement
paint(Canvas, Size)
to draw your thing - EITHER Use
DartBoardCanvaFeature
to mount your Animation - OR use
AnimatedCanvasWidget
and give it your state object.
built-in fields/getters accessible in paint()
time
- The current simulation time
timeDelta
- The delta time of the frame
fps
- 1/timeDelta
context
the active BuildContext this painter is operating in