sun_moon_switch 1.0.0
sun_moon_switch: ^1.0.0 copied to clipboard
An animated day/night toggle switch. A sun with drifting clouds becomes a cratered moon under twinkling stars.
Changelog #
This project follows semantic versioning.
1.0.0 #
First release.
SunMoonSwitch, an animated day/night toggle drawn by a singleCustomPainter. No image assets and no dependencies beyond Flutter.- Idle motion: stars that rise one after another and twinkle, drifting clouds,
slowly rotating sun rays, and a meteor once per cycle. Controlled with
animateAmbientandambientDuration. - Interaction: tap, drag that tracks the finger one to one, velocity-aware snapping on release, a squash while pressed, and haptics on Android and iOS.
- Accessibility: toggled semantics with an enabled state and a tap action,
keyboard focus with space and enter, and support for
MediaQueryData.disableAnimations. - Theming:
SunMoonSwitchColorsexposes all thirteen colors, with amidnightpreset pluscopyWithandlerp. - Layout:
SunMoonSwitchSizepresets (small,medium,large), freewidthandheight, customdurationandcurve, and right-to-left support.
