Plasma class

Plasma creates an animation with moving particles that generates a smooth liquid effect. It can be configured in many styles.

You can also use a non-animating variant by setting speed to 0.0 and find a good looking position with the offset.

Example:

import 'dart:math';
import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';

void main() => runApp(MaterialApp(home: Page()));

class Page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Plasma(
        particles: 10,
        foregroundColor: Color(0xd61e0000),
        backgroundColor: Color(0xffee360d),
        size: 0.87,
        speed: 5.92,
        offset: 0.00,
        blendMode: BlendMode.darken,
        child: Center(child: Text("Hot!")), // your UI here
      ),
    );
  }
}

Inheritance
Annotations
  • @Deprecated('Migrate to PlasmaRenderer by recreating your scene via Liquid Studio. Create a "Solid Color" layer with the background color. Then add a "Plasma Layer" using the foreground colors. All other properties can be just copied.')

Constructors

Plasma({Key? key, int particles = 10, Color foregroundColor = Colors.white, Color backgroundColor = Colors.black, double size = 1.0, double speed = 1.0, double offset = 0.0, int? fps, BlendMode blendMode = BlendMode.srcOver, Widget? child})
const

Properties

backgroundColor Color
Color of the static background
final
blendMode BlendMode
The BlendMode that describes how foreground and background merges together.
final
child Widget?
Prebuild child that's placed inside the Plasma Widget.
final
foregroundColor Color
Color of the animating particles
final
fps int?
If set, the animation will reduce the framerate (fps) to the specified value.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
offset double
Influences the start position of the particle animation.
final
particles int
Number of particles to simulate. Has impact on computation demand.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double
Size scale of the animating particles. Has slight impact on computation demand.
final
speed double
Speed scale of the animation. You can set it to 0.0 that disable the animation. Disabled animations doesn't require computational demand at all.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited