dialog back;menu long press

This commit is contained in:
csf
2022-04-20 19:00:05 +08:00
parent a3a93600cd
commit f5160b60b6
2 changed files with 27 additions and 35 deletions

View File

@@ -206,17 +206,13 @@ class _ConnectionPageState extends State<ConnectionPage> {
width: width,
child: Card(
child: GestureDetector(
onTap: () => {
if (!isDesktop) {connect('${p.id}')}
},
onDoubleTap: () => {
if (isDesktop) {connect('${p.id}')}
},
onTap: !isDesktop ? () => connect('${p.id}') : null,
onDoubleTap: isDesktop ? () => connect('${p.id}') : null,
onLongPressStart: (details) {
var x = details.globalPosition.dx;
var y = details.globalPosition.dy;
this._menuPos = RelativeRect.fromLTRB(x, y, x, y);
this.showPeerMenu(context, p.id);
final x = details.globalPosition.dx;
final y = details.globalPosition.dy;
_menuPos = RelativeRect.fromLTRB(x, y, x, y);
showPeerMenu(context, p.id);
},
child: ListTile(
contentPadding: const EdgeInsets.only(left: 12),
@@ -231,11 +227,10 @@ class _ConnectionPageState extends State<ConnectionPage> {
padding: const EdgeInsets.all(12),
child: Icon(Icons.more_vert)),
onTapDown: (e) {
var x = e.globalPosition.dx;
var y = e.globalPosition.dy;
this._menuPos = RelativeRect.fromLTRB(x, y, x, y);
final x = e.globalPosition.dx;
final y = e.globalPosition.dy;
_menuPos = RelativeRect.fromLTRB(x, y, x, y);
},
onDoubleTap: () {},
onTap: () {
showPeerMenu(context, p.id);
}),