constellation_particles 1.0.0 copy "constellation_particles: ^1.0.0" to clipboard
constellation_particles: ^1.0.0 copied to clipboard

A pointer-reactive constellation particle background for Flutter. Particles drift, repel from the cursor, and link with fading lines. Near-O(n) spatial grid, zero runtime deps.

1.0.0 #

First stable release. The API below is what 1.0 freezes.

  • Fix a per-frame exception storm from a NaN multiplier. particleCount and connectionDistance were asserted; speed, repulsionRadius and repulsionForce were not. All three reach the spatial grid, whose cell index is an int, so a NaN threw Unsupported operation: Infinity or NaN toInt out of both the animation ticker and paint() — not once, but on every frame for as long as the widget lived. All three now assert, written as comparisons rather than isFinite because the constructor is const and a property access is not a constant expression.

Checked and unchanged for this release, by running each rather than reading for it: infinite and negative speed, negative and NaN repulsionRadius and repulsionForce before the assert, a connectionDistance of 1e-9 and of 1e9, particleCount of 0 and 1, a zero-size viewport, and particleCount churned 200 → 0 → 200 → 5 across consecutive frames. None misbehaved.

0.3.1 #

  • Fix a RangeError that could crash the painter when the particle count drops after the spatial grid has been built. The grid is only rebuilt on the next animation tick, so shrinking particleCount at runtime, or the platform switching on high contrast (which halves the count on its own), could leave the grid holding indices from the larger, previous population for one frame. The painter used those stale indices to look up particles in the new, shorter list and threw. _initParticles now clears the grid as soon as it replaces the particle list, and the painter's neighbour loop also skips any index the current list is too short for.

0.3.0 #

  • Add touchReactive, off by default. Repulsion was gated on MouseRegion's onHover, which never fires for touch, so on phones and tablets the field only drifted and the pointer reaction was gone. Setting the flag adds a pointer Listener that feeds the same repulsion path from touch down and move events. It stays off by default so the widget keeps its current behaviour and does not intercept a drag meant for the content behind it. Docs now say pointer-reactive rather than mouse-reactive.

0.2.2 #

  • Install instructions now say pub add instead of pinning a version. The pinned number was stale by several releases and would have been stale again after the next one: the README ships frozen in the archive, so a hand-edited version line is wrong the moment anything is published. This one cannot go out of date.

0.2.1 #

  • Declare the demo in pubspec.yaml so pub.dev shows it on the package page. The recording was already in the repository and in the README, but pub.dev only renders what the screenshots: field points at, so anyone landing on the page from search saw text where the demo should have been.

0.2.0 #

  • Honour the platform's reduce-motion setting. A drifting particle field is exactly the continuous background movement that setting exists to stop, and the widget ignored it: someone who had asked their OS for less motion got the full animation anyway. It now holds the simulation still and paints a single frame, so the constellation is still there and only the drift is gone. The ticker stops rather than running invisibly, and coming back from the background no longer restarts it while the setting is on.

0.1.2 #

  • Docs: sharpen the pub.dev description to lead with the value and the terms people search.

0.1.1 #

  • Docs: tightened the README wording and visuals.

0.1.0 #

  • Initial release.
  • Mouse-reactive constellation field with spatial-grid neighbour lookups.
  • Configurable count, colour, speed, connection distance, and repulsion.
  • Pauses when backgrounded; reduces density under high contrast.
1
likes
160
points
598
downloads
screenshot

Documentation

API reference

Publisher

verified publisherdeveloperyusuf.com

Weekly Downloads

A pointer-reactive constellation particle background for Flutter. Particles drift, repel from the cursor, and link with fading lines. Near-O(n) spatial grid, zero runtime deps.

Repository (GitHub)
View/report issues

Topics

#animation #particles #canvas #background #custompainter

License

MIT (license)

Dependencies

flutter

More

Packages that depend on constellation_particles