EasyDialogDecoration<D extends EasyDialog> class abstract base Decorations Migration guide from 2.x to 3.x

This class is intended to be used by D dialog to apply some decorations.

This can be useful if you want to customize the appearance or behavior of your dialog's content.

Example:

Define some sort of dialog decoration:

final class CustomPositionedAnimation
  extends EasyDialogDecoration<PositionedDialog> {
@override
Widget call(EasyDialog dialog) {
  final animation = dialog.context.animation;

  final offset = Tween<Offset>(
    begin: const Offset(0.0, 1.0),
    end: const Offset(0.0, 0.0),
  ).chain(CurveTween(curve: Curves.fastOutSlowIn)).animate(animation);
  return AnimatedBuilder(
    animation: animation,
    builder: (_, __) => Stack(
      children: [
        Positioned.fill(
          child: ColoredBox(
            color: Colors.black.withOpacity(
              animation.value.clamp(0.0, 0.6),
            ),
          ),
        ),
        Align(
          alignment: Alignment.bottomCenter,
          child: SlideTransition(position: offset, child: dialog.content),
        ),
      ],
    ),
  );
}
}

See also:

Mixed-in types
Implementers
Available extensions

Constructors

EasyDialogDecoration.builder(EasyDialogDecorationBuilder<D> builder, {VoidCallback? onInit, VoidCallback? onShow, VoidCallback? onShown, VoidCallback? onHide, VoidCallback? onHidden, VoidCallback? onDispose})
Use a builder function to create a decoration.
const
factory
EasyDialogDecoration.chain(EasyDialogDecoration<D> first, EasyDialogDecoration<D> second)
Chain two decorations.
const
factory
EasyDialogDecoration.combine(List<EasyDialogDecoration<D>> decorations)
Combine multiple decorations.
const
factory
EasyDialogDecoration.none()
No decoration at all.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(D dialog) Widget
Implement this method to decorate the dialog content appearance.
dispose() → void
Called when the dialog was disposed.
inherited
init() → void
Called when the dialog is created and mounted.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onHidden() → void
Called when the dialog hiding was completed.
inherited
onHide() → void
Called when the dialog hiding was started.
inherited
onShow() → void
Called when the dialog showing was started.
inherited
onShown() → void
Called when the dialog showing was completed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

maybeOf<T extends EasyDialogDecoration<EasyDialog>>(EasyDialogContext context) → T?
Get the optional decoration of type T from the context.
of<T extends EasyDialogDecoration<EasyDialog>>(EasyDialogContext context) → T
Get the decoration of type T from the context.