PlasmaRenderer 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

Constructors

PlasmaRenderer({Key? key, PlasmaType type = PlasmaType.infinity, ParticleType particleType = ParticleType.circle, int particles = 10, Color color = Colors.white, double size = 1.0, double speed = 1.0, double offset = 0.0, int? fps, BlendMode blendMode = BlendMode.srcOver, double blur = 1.0, double variation1 = 0.0, double variation2 = 0.0, double variation3 = 0.0, double rotation = 0.0, Widget? child})
const

Properties

blendMode BlendMode
Describes how the color merges.
final
blur double
Blur scale of the particle.
final
child Widget?
Child that's placed inside this Widget.
final
color 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
particleType ParticleType
Method used to render each particle.
final
rotation double
Rotation of the animation in radians
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
type PlasmaType
Type of plasma animation
final
variation1 double
Number influencing the rendering of certain Plasma types.
final
variation2 double
Number influencing the rendering of certain Plasma types.
final
variation3 double
Number influencing the rendering of certain Plasma types.
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