vitality 1.0.2 copy "vitality: ^1.0.2" to clipboard
vitality: ^1.0.2 copied to clipboard

A Flutter package that Allows you to create a very beautiful live animations in the background (like randomly moving icons ,circles ,rectangles ....) within 10 lines.

vitality #

  • A Flutter package that Allows you to create a very beautiful live animations in the background (like randomly moving icons ,circles ,rectangles ....) within 10 lines.

Examples #

Here is some examples of using vitality library :

  • example 1 example 2

  • example 3 example 4

  • example 5

usage : #

  • vitality package is very easy to use you can understand its usage in the code below :
Vitality.randomly(
                height: size.height,
                width: size.width,
                background: Colors.black,
                maxOpacity: 0.8,
                minOpacity: 0.3,
                itemsCount: 80,
                enableXMovements: false,
                whenOutOfScreenMode: WhenOutOfScreenMode.Teleport,
                maxSpeed: 1.5,
                maxSize: 30,
                minSpeed: 0.5,
                randomItemsColors: [Colors.yellowAccent, Colors.white],
                randomItemsBehaviours: [
                  ItemBehaviour(shape: ShapeType.Icon, icon: Icons.star),
                  ItemBehaviour(shape: ShapeType.Icon, icon: Icons.star_border),
                  ItemBehaviour(shape: ShapeType.StrokeCircle),
                ],
              )
  • Note!! : Do not pass double.infinty to the width or height use MediaQuery instead :

       Size size = MediaQuery.of(context).size;
        ...
        Vitality.randomly(
                height: size.height,
                width: size.width,
                ...
                )
    
  • the whenOutOfScreenMode defines what should the shape do when it reaches the screen edge :

    • none : it does nothing and continues its movements out the screen.
    • Reflect : it bounces and returns in the oppisite direction.
    • Teleport : it continues its movements to the other side of the screen.
  • the randomItemsBehaviours defines what available shapes can the library generate :

    • you can chose one from the ShapeType enum (FilledCircle, StrokeCicle, FilledRectangle, icon, ...)

      ItemBehaviour(shape: ShapeType.StrokeCircle)
      
    • if you chose the icon type you also have to pass an IconDate to the Item Behaviour

       ItemBehaviour(shape: ShapeType.Icon, icon: Icons.star)
      
58
likes
0
pub points
74%
popularity

Publisher

unverified uploader

A Flutter package that Allows you to create a very beautiful live animations in the background (like randomly moving icons ,circles ,rectangles ....) within 10 lines.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on vitality