sun_moon_switch 1.0.0 copy "sun_moon_switch: ^1.0.0" to clipboard
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 single CustomPainter. 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 animateAmbient and ambientDuration.
  • 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: SunMoonSwitchColors exposes all thirteen colors, with a midnight preset plus copyWith and lerp.
  • Layout: SunMoonSwitchSize presets (small, medium, large), free width and height, custom duration and curve, and right-to-left support.
2
likes
160
points
92
downloads
screenshot

Documentation

API reference

Publisher

verified publisheradrianogba.is-a.dev

Weekly Downloads

An animated day/night toggle switch. A sun with drifting clouds becomes a cratered moon under twinkling stars.

Repository (GitHub)
View/report issues

Topics

#switch #toggle #animation #dark-mode #ui

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sun_moon_switch