FlashController<T> constructor
FlashController<T> (
- BuildContext context,
- FlashBuilder<
T> builder, { - Duration? duration,
- Duration? transitionDuration = const Duration(milliseconds: 500),
- bool persistent = true,
- WillPopCallback? onWillPop,
Implementation
FlashController(
this.context,
this.builder, {
this.duration,
this.transitionDuration = const Duration(milliseconds: 500),
this.persistent = true,
this.onWillPop,
}) : route = ModalRoute.of(context) {
final rootOverlay = Navigator.of(context, rootNavigator: true).overlay;
if (persistent) {
overlay = rootOverlay;
} else {
overlay = Overlay.of(context);
assert(overlay != rootOverlay,
'''overlay can't be the root overlay when persistent is false''');
}
assert(overlay != null);
_controller = createAnimationController()
..addStatusListener(_handleStatusChanged);
}