Dialog manager topic
Dialog manager
What is Manager
, exactly?
They are objects that are responsible for showing, hiding, and taking care of all related dialogs (including positioning, playing animations, inserting in overlay etc.)
We have a class that serves as the base for all Managers
that have exactly two responsibilities: to show
and to hide
abstract class EasyDialogManager<S extends EasyDialogManagerShowParams?,
H extends EasyDialogManagerHideParams?> {
final IEasyOverlayController overlayController;
const EasyDialogManager({required this.overlayController});
Future<void> show({required S params});
Future<void> hide({required H params});
}
You may wonder what IEasyOverlayController is and why it's there. We'll talk about it a bit later.
Parameters
The generic data which the Manager
operates on are the Show/Hide parameters. Each Manager
is able to extend the base parameters or not define them at all:
abstract class EasyDialogManagerShowParams {
final Widget content;
final EasyAnimationConfiguration animationConfiguration;
const EasyDialogManagerShowParams({
required this.content,
this.animationConfiguration = const EasyAnimationConfiguration(),
});
}
abstract class EasyDialogManagerHideParams {
const EasyDialogManagerHideParams();
}
The mandatory things are Widget-content
and EasyDialogAnimatorConfiguration-animationConfiguration
. The purpose of the first one is pretty obvious, while the last one is responsible for providing options that the Manager
may use to configure the AnimationController.
Strategies
The core thing that allows you to inject your beautiful dialogs into the Overlay
is encapsulated within the Insert/Remove Strategy, which will be covered a bit later in the Overlay section. Now you are just need to know that they exists and they are similar to the Strategy/Command
pattern.
Classes
- BasicDialogInsertStrategy Getting started Dialog manager Custom
- Simple insert dialog strategy.
- BasicDialogInsertStrategy Getting started Dialog manager Custom
- Simple insert dialog strategy.
- BasicDialogRemoveStrategy Getting started Dialog manager Custom
- Simple implementation of remove strategy.
- BasicDialogRemoveStrategy Getting started Dialog manager Custom
- Simple implementation of remove strategy.
- EasyDialogAnimatorConfiguration Dialog manager
- Configuration of EasyDialogAnimator.
- EasyDialogAnimatorConfiguration Dialog manager
- Configuration of EasyDialogAnimator.
-
EasyDialogManager<
S extends EasyDialogManagerShowParams?, H extends EasyDialogManagerHideParams?> Getting started Dialog manager Custom - This is the base class for all dialog managers.
-
EasyDialogManager<
S extends EasyDialogManagerShowParams?, H extends EasyDialogManagerHideParams?> Getting started Dialog manager Custom - This is the base class for all dialog managers.
- EasyDialogManagerHideParams Getting started Dialog manager Custom
- Base class of hide params for dialog managers.
- EasyDialogManagerHideParams Getting started Dialog manager Custom
- Base class of hide params for dialog managers.
- EasyDialogManagerShowParams Getting started Dialog manager Custom
- Base data class of show params for dialog managers.
- EasyDialogManagerShowParams Getting started Dialog manager Custom
- Base data class of show params for dialog managers.