Added some comments

Signed-off-by: EpicKiwi <me@epickiwi.fr>
This commit is contained in:
EpicKiwi 2025-01-02 10:16:25 +01:00
parent 3ae1548ba0
commit 73cf87b2b5
No known key found for this signature in database
GPG key ID: C4B28FD2729941CE

View file

@ -204,7 +204,9 @@ class _SwipeableState extends State<Swipeable> with TickerProviderStateMixin, Au
bool _isTouch = true;
// Minimum global X where swipe is allowed to start
double? _minX;
// Maximum global X where swipe is allowed to start
double? _maxX;
@override
@ -244,6 +246,8 @@ class _SwipeableState extends State<Swipeable> with TickerProviderStateMixin, Au
var validTouch = widget.allowedPointerKinds.contains(event.kind);
// Check if touch was performed after minX and before maxX to avoid system
// gesture insets
if(validTouch && _minX != null){
validTouch = xPos > _minX!;
}
@ -444,6 +448,8 @@ class _SwipeableState extends State<Swipeable> with TickerProviderStateMixin, Au
}
}
// Get system screen size and system gesture insets
// to avoid starting a swipe in this areas
MediaQueryData? mediaQuery = MediaQuery.maybeOf(context);
if (mediaQuery != null) {
if(_minX == null || _maxX == null){