Esempio n. 1
0
        public void _openContextMenu()
        {
            setState(() => {
                _childHidden = true;
            });

            _route = new _ContextMenuRoute(
                actions: widget.actions,
                barrierLabel: "Dismiss",
                filter: ImageFilter.blur(
                    sigmaX: 5.0f,
                    sigmaY: 5.0f
                    ),
                contextMenuLocation: _contextMenuLocation,
                previousChildRect: _decoyChildEndRect,
                builder: (BuildContext _context, Animation <float> animation) => {
                if (widget.previewBuilder == null)
                {
                    return(widget.child);
                }
                return(widget.previewBuilder(_context, animation, widget.child));
            }
                );
            Navigator.of(context, rootNavigator: true).push(_route);
            _route.animation.addStatusListener(_routeAnimationStatusListener);
        }
Esempio n. 2
0
 public void _routeAnimationStatusListener(AnimationStatus status)
 {
     if (status != AnimationStatus.dismissed)
     {
         return;
     }
     setState(() => {
         _childHidden = false;
     });
     _route.animation.removeStatusListener(_routeAnimationStatusListener);
     _route = null;
 }