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

@ -16,7 +16,6 @@ Future<Null> main() async {
await a;
await b;
refreshCurrentUser();
// EasyLoading.instance.loadingStyle = EasyLoadingStyle.light;
toAndroidChannelInit();
runApp(App());
}
@ -33,26 +32,24 @@ class App extends StatelessWidget {
ChangeNotifierProvider.value(value: FFI.canvasModel),
],
child: MaterialApp(
navigatorKey: globalKey,
debugShowCheckedModeBanner: false,
title: 'RustDesk',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: !isAndroid ? WebHomePage() : HomePage(),
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: analytics),
FlutterSmartDialog.observer
],
builder: isAndroid
? (_, child) {
return AccessibilityListener(
child: FlutterSmartDialog(child: child),
);
}
: FlutterSmartDialog.init(),
),
navigatorKey: globalKey,
debugShowCheckedModeBanner: false,
title: 'RustDesk',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: !isAndroid ? WebHomePage() : HomePage(),
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: analytics),
FlutterSmartDialog.observer
],
builder: FlutterSmartDialog.init(
builder: isAndroid
? (_, child) => AccessibilityListener(
child: child,
)
: null)),
);
}
}

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);
}),