PaletteBorderController class
Controller for imperatively controlling a PaletteBorder.
Use this when you need to trigger border effects without rebuilding the widget tree (e.g., from a service or callback).
final controller = PaletteBorderController();
// Later:
controller.flash(Colors.red);
controller.pulse(Colors.orange, count: 2);
controller.set(Colors.blue);
controller.clear();
- Inheritance
-
- Object
- ChangeNotifier
- PaletteBorderController
Constructors
Properties
- color → Color
-
Current border color.
no setter
- glowRadius → double
-
Current glow radius.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isAnimating → bool
-
Whether an animation is currently running.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double
-
Current border width.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → void - Clear the border (transparent).
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
flash(
Color color, {Duration duration = const Duration(milliseconds: 300)}) → void - Flash the border briefly.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
pulse(
Color color, {int count = 2, Duration interval = const Duration(milliseconds: 200)}) → void - Pulse the border multiple times.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
set(
Color color, {double? width, double? glowRadius}) → void - Set a solid border color.
-
success(
{Duration duration = const Duration(milliseconds: 300)}) → void - Show a success effect (green flash).
-
toString(
) → String -
A string representation of this object.
inherited
-
warning(
{Duration duration = const Duration(milliseconds: 500)}) → void - Show a warning effect (red flash + optional shake).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited