Flutter: Implementing a peek & pop effect
问题 I was trying to achieve a peek & pop effect - when the user taps and hold on to a card, a dialog opens, and dismissed when the user no longer tap holding on the screen: Listener( onPointerDown: (PointerDownEvent e) { // open dialog showDialog( context: context, builder: (context) => Container( child: Card(), )); }, onPointerUp: (PointerUpEvent e) { // dismiss dialog if (Navigator.of(context).canPop()) { Navigator.of(context).pop('dialog'); } }, child: Card() ) It worked nicely which shows the