TransitionPlugin class abstract

The plugin contract every transition must implement.

Add any new visual effect to the framework by creating a class that extends TransitionPlugin — zero changes to the core.

class GlowTransitionPlugin extends TransitionPlugin {
  @override String get id => 'glow';
  @override List<AnimatableProperty> get affectedProperties => [...];
  @override bool get isExpensive => true;
  @override Widget build({required animation, required child,
                          Map<String, Object?> params = const {}}) { ... }
}

Why extends instead of implements?

Dart does not allow abstract method declarations to carry default parameter values — they must live on a concrete declaration. By making build() a concrete method that throws UnimplementedError, subclasses inherit the default params = const {} from the base class, so call sites that omit params: always compile against the base-class signature.

Implementers

Constructors

TransitionPlugin()
const

Properties

affectedProperties List<AnimatableProperty>
All widget properties this transition modifies. Used by FrameBudgeter to decide whether to skip expensive effects.
no setter
description String
Human-readable description of this transition (optional, for tooling).
no setter
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier used to look up this plugin in TransitionRegistry.
no setter
isExpensive bool
True when this effect uses expensive GPU operations (blur, shader, clip). The FrameBudgeter will disable expensive plugins under FPS threshold.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build({required Animation<double> animation, required Widget child, Map<String, Object?> params = const {}}) Widget
Builds the animated widget for the forward direction.
buildCurved({required Animation<double> animation, required Curve curve, required Widget child, Map<String, Object?> params = const {}}) Widget
Helper — wraps build with a CurvedAnimation.
buildReverse({required Animation<double> animation, required Widget child, Map<String, Object?> params = const {}}) Widget
Builds the animated widget for the reverse direction.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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