mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-15 12:51:28 +03:00
remove dup Accessibility-Input solution;fix audio crash
This commit is contained in:
@@ -44,8 +44,8 @@ final ButtonStyle flatButtonStyle = TextButton.styleFrom(
|
||||
),
|
||||
);
|
||||
|
||||
void showToast(String text,{Duration? duration}) {
|
||||
SmartDialog.showToast(text,displayTime: duration);
|
||||
void showToast(String text, {Duration? duration}) {
|
||||
SmartDialog.showToast(text, displayTime: duration);
|
||||
}
|
||||
|
||||
void showLoading(String text, {bool clickMaskDismiss = false}) {
|
||||
|
||||
@@ -192,6 +192,7 @@ class ServerModel with ChangeNotifier {
|
||||
_isStart = true;
|
||||
notifyListeners();
|
||||
FFI.setByName("ensure_init_event_queue");
|
||||
_interval?.cancel();
|
||||
_interval = Timer.periodic(Duration(milliseconds: 30), (timer) {
|
||||
FFI.ffiModel.update("");
|
||||
});
|
||||
|
||||
@@ -40,9 +40,6 @@ class ChatPage extends StatelessWidget implements PageShape {
|
||||
})
|
||||
];
|
||||
|
||||
@override
|
||||
final scrollController = FFI.chatModel.scroller;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider.value(
|
||||
|
||||
@@ -22,9 +22,6 @@ class ConnectionPage extends StatefulWidget implements PageShape {
|
||||
@override
|
||||
final appBarActions = !isAndroid ? <Widget>[WebMenu()] : <Widget>[];
|
||||
|
||||
@override
|
||||
final scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
_ConnectionPageState createState() => _ConnectionPageState();
|
||||
}
|
||||
@@ -50,7 +47,6 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
||||
Provider.of<FfiModel>(context);
|
||||
if (_idController.text.isEmpty) _idController.text = FFI.getId();
|
||||
return SingleChildScrollView(
|
||||
controller: widget.scrollController,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
|
||||
@@ -9,7 +9,6 @@ abstract class PageShape extends Widget {
|
||||
final String title = "";
|
||||
final Icon icon = Icon(null);
|
||||
final List<Widget> appBarActions = [];
|
||||
final ScrollController? scrollController = null;
|
||||
}
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
@@ -72,20 +71,7 @@ class _HomePageState extends State<HomePage> {
|
||||
_selectedIndex = index;
|
||||
}),
|
||||
),
|
||||
body: Listener(
|
||||
onPointerMove: (evt) {
|
||||
final page = _pages.elementAt(_selectedIndex);
|
||||
|
||||
/// Flutter can't not catch PointerMoveEvent when size is 1
|
||||
/// This will happen in Android AccessibilityService Input
|
||||
/// android can't init dispatching size yet ,see: https://stackoverflow.com/questions/59960451/android-accessibility-dispatchgesture-is-it-possible-to-specify-pressure-for-a
|
||||
/// use this temporary solution until flutter or android fixes the bug
|
||||
if (evt.size == 1 && page.scrollController != null) {
|
||||
final offset = page.scrollController!.offset.toDouble();
|
||||
page.scrollController!.jumpTo(offset - evt.delta.dy);
|
||||
}
|
||||
},
|
||||
child: _pages.elementAt(_selectedIndex)),
|
||||
body: _pages.elementAt(_selectedIndex),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,9 +58,6 @@ class ServerPage extends StatelessWidget implements PageShape {
|
||||
})
|
||||
];
|
||||
|
||||
@override
|
||||
final scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
checkService();
|
||||
@@ -68,7 +65,6 @@ class ServerPage extends StatelessWidget implements PageShape {
|
||||
value: FFI.serverModel,
|
||||
child: Consumer<ServerModel>(
|
||||
builder: (context, serverModel, child) => SingleChildScrollView(
|
||||
controller: scrollController,
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
||||
@@ -20,9 +20,6 @@ class SettingsPage extends StatefulWidget implements PageShape {
|
||||
@override
|
||||
final appBarActions = [ScanButton()];
|
||||
|
||||
@override
|
||||
final scrollController = null;
|
||||
|
||||
@override
|
||||
_SettingsState createState() => _SettingsState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user