diff --git a/lib/main.dart b/lib/main.dart index f204a6907..a81a047b4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -16,7 +16,6 @@ Future 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)), ); } } diff --git a/lib/pages/connection_page.dart b/lib/pages/connection_page.dart index 10d49e0ec..6f039e81f 100644 --- a/lib/pages/connection_page.dart +++ b/lib/pages/connection_page.dart @@ -206,17 +206,13 @@ class _ConnectionPageState extends State { 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 { 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); }),