Giter Site home page Giter Site logo

multi-tech-s-r-l / vitality Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abdulrhmansayedali/vitality

0.0 0.0 0.0 5.31 MB

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

License: MIT License

Dart 100.00%

vitality's Introduction

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 IconData to the Item Behaviour

       ItemBehaviour(shape: ShapeType.Icon, icon: Icons.star)

vitality's People

Contributors

abdulrhmansayedali avatar squaregen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.