slowly_moving_widgets_field 0.1.2

Flutter Android iOS web

Your arbitrary widgets slowly moving about, sometimes colliding and bouncing (like vintage "asteroids game").

slowing_moving_widgets_field #

Pass in a list of arbitrary widgets and the slowing_moving_widgets_field widget moves them around the screen, like the old asteroids video game.

If collisionAmount is null then widgets float on top of each other (DON'T bounce).

If collisionAmount is non-null then widgets will bounce when they hit each other (collision detection). But, this is buggy (see below).

Returns a Stack() which contains all the "magic."

Example #

Screenshot

TODO #

  • specify background
  • specify a slight amount of randomness on every impact
  • specify how much overlap (positive or negative) to allow before bounce
  • specify speed
  • specify "soft bounce" mode that causes close widgets to repel off of each other rather than instantaneous bounce

Bugs #

  • will fail (undefined results) if you try to add too many widgets; there must be adequate room to add all widgets initially so they are not overlapping
  • if collision detection is enabled (collisionAmount != null), sometimes the movers overlap and get stuck on top of each other--not sure why

Design Flaws #

  • don't like having to specify width and height more than once (see example)

Usage #

Add a new dependency line to your project/pubspec.yaml file:

dependencies:
  ...
  slowing_moving_widgets_field: 0.1.2      # use latest version!

Don't forget to flutter pub get

Pull Requests #

Pull requests are welcome!

2
likes
110
pub points
33%
popularity

Your arbitrary widgets slowly moving about, sometimes colliding and bouncing (like vintage "asteroids game").

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

peter.alvin@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on slowly_moving_widgets_field