diff --git a/lib/widgets/common/basic/insets.dart b/lib/widgets/common/basic/insets.dart index 50d2fd56c..9bf5b4c35 100644 --- a/lib/widgets/common/basic/insets.dart +++ b/lib/widgets/common/basic/insets.dart @@ -7,23 +7,16 @@ import 'package:provider/provider.dart'; // - a vertically scrollable body. // It will prevent the body from scrolling when a user swipe from bottom to use Android Q style navigation gestures. class BottomGestureAreaProtector extends StatelessWidget { - // as of Flutter v1.22.5, `systemGestureInsets` from `MediaQuery` mistakenly reports no bottom inset, - // so we use an empirical measurement instead - static const double systemGestureInsetsBottom = 32; - @override Widget build(BuildContext context) { return Selector( - selector: (c, mq) => mq.effectiveBottomPadding, - builder: (c, mqPaddingBottom, child) { - // devices with physical navigation buttons have no bottom insets - // we assume these devices do not use gesture navigation - if (mqPaddingBottom == 0) return SizedBox(); + selector: (c, mq) => mq.systemGestureInsets.bottom, + builder: (c, systemGestureBottom, child) { return Positioned( left: 0, right: 0, bottom: 0, - height: systemGestureInsetsBottom, + height: systemGestureBottom, child: AbsorbPointer(), ); },