slowly_moving_widgets_field 0.1.2

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 #



  • 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:

  slowing_moving_widgets_field: 0.1.2      # use latest version!

Don't forget to flutter pub get

Pull Requests #

Pull requests are welcome!

Changelog #

Version 0.1.2 (2020-01-08) #

  • documentation

Version 0.1.1 (2020-01-07) #

  • cleanup

Version 0.1.0 (2020-01-06) #

  • initial


Example #

Please see complete, self-contained example in the example/ directory.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  slowly_moving_widgets_field: ^0.1.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:slowly_moving_widgets_field/slowly_moving_widgets_field.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
meta ^1.1.8 1.1.8
Transitive dependencies
collection 1.14.11 1.14.12
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies