SpaceClockPainter class
SpaceClockPainter
Implementation of the Canvas Drawing of the Space Clock
Psuedo: Load Images While Loading Draw Loading Screen When done Loading Calculate Gears and Rotations Draw Background Draw Stars Draw Sun Draw Earth Draw Moon Note:
- This object acts as a singleton
- Theme Light/Dark is passed to the painter through the SpaceClockScene.build() method
- Inheritance
-
- Object
- AnimatedPainter
- SpaceClockPainter
Constructors
- SpaceClockPainter({required bool isDark, bool showMoon = false, bool showEarth = true, bool showSun = false})
- Constructor for the painter
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDark → bool
-
Whether to draw dark config or not
Note: This is mutating state
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showEarth → bool
-
final
- showMoon → bool
-
final
- showSun → bool
-
final
- standardPaint → Paint
-
StandardPaint is just for the planets and background
final
- sunBasePaint → Paint
-
SunBasePaint will draw the gradient base/surface of the sun
final
- sunLayerPaint → Paint
-
SunLayerPaint will adjust blendmode based on the layer as it
final
Methods
-
drawBackground(
Canvas canvas, Size size, SpaceViewModel viewModel) → void - Draws the Background
-
drawEarth(
Canvas canvas, Size size, SpaceViewModel viewModel, SpaceConfig config) → void - DrawEarth
-
drawLoadingScreen(
Canvas canvas, Size size) → void - drawLoadingScreen
-
drawMoon(
Canvas canvas, Size size, SpaceViewModel viewModel, SpaceConfig config) → void - Draws the Moon
-
drawSpace(
Canvas canvas, Size size) → void - drawSpace
-
drawSun(
Canvas canvas, Size size, SpaceViewModel viewModel, SpaceConfig config) → void - Draw the Sun
-
init(
) → void -
Initialize the Painter (e.g. Load Images)
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paint(
Canvas canvas, Size size) → void -
Paint to the canvas
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited