Skip to content
pubscout

newton_particles

0.4.1, released 8 months ago by 7omtech.fr

Configurable particle emitter for Flutter to create rain, smoke, and physics animations.

WASM-ready
$ flutter pub add newton_particles
Source repository

What it does

Provides a customizable particle system with support for both deterministic and physics-based animations (powered by Chipmunk2D). It features interactive widget collisions, custom shapes, and an online visual configurator.

AI-written summary of version 0.4.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to add visual particle effects like rain, snow, confetti, or smoke to your Flutter app.
  • Particles need to interact and collide with standard Flutter UI widgets.

Skip it when

  • You require a full-fledged 2D game engine rather than just particle animations.
  • Targeting web with WASM requires additional script setup.

Strengths

  • Highly configurable particle options and custom shapes.
  • Chipmunk2D-backed physics integration for realistic gravity and collisions.
  • Includes a visual interactive configurator with code generation.

Weaknesses

  • Package is under active development with potential breaking changes before 1.0.0.
  • Requires extra web script setup for WASM builds using physics effects.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
4

Requires calling initializeNewton() before running the app. For web with WASM and physics effects, a helper script must be added to web/index.html.

Newton(
  effectConfigurations: [
    PhysicsEffectConfiguration(
      physicsProperties: const PhysicsProperties(
        gravity: Gravity.earthGravity,
        angle: NumRange.single(90),
        velocity: NumRange.between(Velocity.stationary, Velocity.stationary),
      ),
      visualProperties: const VisualProperties(
        endScale: NumRange.single(1),
        fadeOutThreshold: NumRange.between(0.6, 0.8),
      ),
      emissionProperties: const EmissionProperties(
        origin: Offset.zero,
        maxOriginOffset: Offset(1, 0),
        particleLifespan: DurationRange.between(Duration(seconds: 7), Duration(seconds: 10)),
      ),
      particleConfiguration: const ParticleConfiguration(
        shape: CircleShape(),
        size: Size(5, 5),
      ),
    ),
  ],
)

Alternatives

Packages that do the same job and could replace newton_particles.

Works with

Packages commonly used together with newton_particles: ones it builds on, ones built on it, and its own family.