Search
[Flutter/dart] Expand the swipe response range across the screen
- M.R

- Oct 9, 2021
- 1 min read
Overview
I will explain how to swipe the entire page in your smartphone app.
Method
When implementing a swipe with GestureDetector, it is the area of its child widget that responds to the swipe.
Therefore, if you write like the example below, if the child widget is small, swiping at the bottom of the screen will not respond.
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
),
body: SingleChildScrollView(
child: GestureDetector(
child: Container(
child: Column(
//・・・
)
)
)
)
)So let's put the whole page under GestureDetector.
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
),
body: GestureDetector(
child: SingleChildScrollView(
child: Container(
child: Column(
//・・・
)
)
)
)
)





Comments