floating_dots

Pub

Creates a group of coloured floating dots (or a single floating dot) that travel at a random speed from one edge of the screen to another.

small dots, floating randomly small dots, floating up

Installation

In your pubspec.yaml root add:

dependencies:
    floating_dots: ^0.2.2

then,

import 'package:floating_dots/floating_dots.dart';

Usage

FloatingDotGroup

FloatingDotGroup(
    number: int,
    direction: Direction,
    trajectory: Trajectory,
    size: DotSize,
    colors: List<Color>,
    opacity: double,
    speed: DotSpeed,
)

FloatingDot

FloatingDot(
    direction: Direction,
    trajectory: Trajectory,
    radius: double,
    color: Colour,
    opacity: double,
    time: int,
)

Examples

small dots

Small dots

FloatingDotGroup(
    number: 5,
    direction: Direction.up,
    trajectory: Trajectory.random,
    size: DotSize.small,
    colors: Colors.primaries,
    opacity: 1,
    speed: DotSpeed.fast,
),

medium dots

Medium dots

FloatingDotGroup(
    number: 25,
    direction: Direction.random,
    trajectory: Trajectory.random,
    size: DotSize.medium,
    colors: Colors.accents,
    opacity: .5,
    speed: DotSpeed.medium,
),

large dots

Large dots

Stack(
    children: <Widget>[
        Container(
            width: double.infinity,
            height: double.infinity,
            color: Colors.black,
        ),
        FloatingDotGroup(
            number: 1,
            direction: Direction.up,
            trajectory: Trajectory.straight,
            size: DotSize.large,
            colors: [Colors.deepOrange],
            opacity: 1,
            speed: DotSpeed.medium,
        ),
    ],
),

Libraries

floating_dots