/*
* Use **`GestureDetector.onPanUpdate`**:
* ```dart
* GestureDetector(
* onPanUpdate: (details) {
*/
// Swiping in right direction.
if (details.delta.dx > 0) {}
// Swiping in left direction.
if (details.delta.dx < 0) {}
/*
* },
* child: YourWidget(),
* )
* ```
*
* ---
*
* To cover all the area (passing the parent constraints to the widget),
* you can include `SizedBox.expand`.
*
* ```dart
* SizedBox.expand(
* child: GestureDetector(
*/
onPanUpdate: (details) {
// Swiping in right direction.
if (details.delta.dx > 0) {}
// Swiping in left direction.
if (details.delta.dx < 0) {}
},
child: YourWidget(),
/*
* ),
* )
* ```
*
* [CopsOnRoad] [so/q/55050463] [cc by-sa 3.0]
*/
$
cheat.sh