remove dup Accessibility-Input solution;fix audio crash

This commit is contained in:
csf
2022-04-19 17:53:35 +08:00
parent 56e195b018
commit 11a1b12fe7
8 changed files with 20 additions and 46 deletions

View File

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