[Flutter/dart] Expand the swipe response range across the screen
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(
//・・・
)
)
)
)
)
Recent Posts
See AllWhat want to do I want to create an input form using TextField. For example, if the input content is a monetary amount, I would like to...
What want to do There is a variable that remain unchanged once the initial value is determined. However, it cannot be determined yet when...
What want to do As the title suggests. Place two widgets in one line on the screen One in the center of the screen and the other on the...
Comments