A Flutter port of Processing.
This project is not affiliated with the Processing project, or related organizations.
The goal of flutter_processing is to provide the same easy learning environment as Processing, but with the additional utility of a production-ready UI toolkit, called Flutter. With traditional Processing, there is minimal professional value in the underlying language. With flutter_processing, the underlying tool, Flutter, is sufficient for employment as an app UI developer. flutter_processing offers an educational tool and an employment opportunity all in one.
Want to see how this project was implemented? Nearly every change was recorded and published to the SuperDeclarative! channel on YouTube.
Do you get value from this package? Please consider supporting SuperDeclarative!
To paint a canvas in Flutter, the way you would in Processing, display a Processing
widget and implement a Sketch
.
void main() {
runApp(
MaterialApp(
home: Processing(
sketch: Sketch.simple(
setup: (sketch) async {
// TODO: do your typical Sketch setup
// stuff here. Call methods on
// the provided sketch object.
},
draw: (sketch) async {
// TODO: do your typical Sketch drawing
// stuff here. Call methods on
// the provided sketch object.
},
),
),
),
);
}
To retain and access variables in your Sketch
, or to implement a Sketch
in a more traditional way, subclass Sketch
:
void main() {
runApp(
MaterialApp(
home: Processing(
sketch: MySketch(),
),
),
);
}
class MySketch extends Sketch {
@override
Future<void> setup() async {
// TODO: do setup stuff here
}
@override
Future<void> draw() async {
// TODO: do drawing stuff here
}
}
- thread()
- setup()
- draw()
- redraw()
- setLocation()
- setResizable()
- setTitle()
- loop()
- noLoop()
- push()
- pushStyle()
- pop()
- popStyle()
- exit()
- settings()
- width
- height
- size()
- pixelDensity()
- pixelHeight
- pixelWidth
- displayDensity()
- fullScreen()
- frameRate()
- frameRate
- frameCount
- cursor()
- noCursor()
- focused
- smooth()
- noSmooth()
- delay()
-
Array: UseList
-
ArrayList: UseList
-
FloatDict: UseMap<String, double>
-
FloatList: UseList<double>
-
HashMap: Use Dart'sHashMap
-
IntDict: UseMap<String, int>
-
IntList: UseList<int>
-
JSONArray: UseList<dynamic>
-
JSONObject: UseMap<String, dynamic>
-
Object: Use Dart'sObject
-
String: Use Dart'sString
-
StringDict: UseMap<String, String>
-
StringList: useList<String>
- Table
- TableRow
- XML
- binary()
- boolean()
-
byte() - char()
- float()
- hex()
- int()
- str()
- unbinary()
- unhex()
- join()
- match()
- matchAll()
- nf()
- nfc()
- nfp()
- nfs()
- split()
- splitTokens()
- trim()
- append()
- arrayCopy()
- concat()
- expand()
- reverse()
- shorten()
- sort()
- splice()
- subset()
- createShape()
- loadShape()
- PShape
- arc()
- circle()
- ellipse()
- line()
- point()
- quad()
- rect()
- square()
- triangle()
- bezier()
- bezierDetail()
- bezierPoint()
- bezierTangent()
- curve()
- curveDetail()
- curvePoint()
- curveTangent()
- curveTightness()
- box()
- sphere()
- sphereDetail()
- ellipseMode()
- rectMode()
- strokeCap()
- strokeJoin()
- strokeWeight()
- beginContour()
- beginShape()
- bezierVertex()
- curveVertex()
- endContour()
- endShape()
- quadraticVertex()
- vertex()
- shape()
- shapeMode()
- mouseButton
- mouseClicked()
- mouseDragged()
- mouseMoved()
- mousePressed()
- mousePressed: Use
isMousePressed
- mouseReleased()
- mouseWheel()
- mouseX
- mouseY
- pmouseX
- pmouseY
- key
- keyCode
- keyPressed()
- keyPressed
- keyReleased()
- keyTyped()
- BufferedReader
- createInput()
- createReader()
- launch()
- loadBytes()
- loadJSONArray()
- loadJSONObject()
- loadStrings()
- loadTable()
- loadXML()
- parseJSONArray()
- parseJSONObject()
- parseXML()
- selectFolder()
- selectInput()
- day()
- hour()
- millis()
- minute()
- month()
- second()
- year()
- print()
- printArray()
- println()
- save()
- saveFrame()
- beginRaw()
- beginRecord()
- createOutput()
- createWriter()
- endRaw()
- endRecord()
- PrintWriter
- saveBytes()
- saveJSONArray()
- saveJSONObject()
- saveStream()
- saveStrings()
- saveTable()
- saveXML()
- selectOutput()
- applyMatrix()
- popMatrix()
- printMatrix()
- pushMatrix()
- resetMatrix()
- rotate()
- rotateX()
- rotateY()
- rotateZ()
- scale()
- shearX()
- shearY()
- translate()
- ambientLight()
- directionalLight()
- lightFalloff()
- lights()
- lightSpecular()
- noLights()
- normal()
- pointLight()
- spotLight()
- beginCamera()
- camera()
- endCamera()
- frustum()
- ortho()
- perspective()
- printCamera()
- printProjection()
- modelX()
- modelY()
- modelZ()
- screenX()
- screenY()
- screenZ()
- ambient()
- emissive()
- shininess()
- specular()
- background()
- clear()
-
colorMode(): Use Flutter'sColor
objects instead. - fill()
- noFill()
- noStroke()
- stroke()
- alpha()
- blue()
- brightness()
- color()
- green()
- hue()
- lerpColor()
- red()
- saturation()
- createImage()
- PImage
- image()
- imageMode()
- loadImage()
- noTint()
- requestImage()
- tint()
- texture()
- textureMode()
- textureWrap()
- blend()
- copy()
- filter()
- get()
- loadPixels()
- pixels[]
- set()
- updatePixels()
- blendMode()
- clip()
- createGraphics()
- hint()
- noClip()
- PGraphics
- loadShader()
- PShader
- resetShader()
- shader()
- PFont
- createFont()
- loadFont()
- text()
- textFont()
- textAlign()
- textLeading()
- textMode()
- textSize()
- textWidth()
- textAscent()
- textDescent()
- PVector
- abs()
- ceil()
- constrain()
- dist()
- exp()
- floor()
- lerp()
- log()
- mag()
- map()
- max()
- min()
- norm()
- pow()
- round()
- sq()
- sqrt()
- acos()
- asin()
- atan()
- atan2()
- cos()
- degrees()
- radians()
- sin()
- tan()
- noise()
- noiseDetail()
- noiseSeed()
- random()
- randomGaussian()
- randomSeed()
- HALF_PI
- PI
- QUARTER_PI
- TAU
- TWO_PI