FlashController<T> constructor

FlashController<T>(
  1. BuildContext context,
  2. FlashBuilder<T> builder, {
  3. Duration? duration,
  4. Duration? transitionDuration = const Duration(milliseconds: 500),
  5. bool persistent = true,
  6. 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);
}