top of page

[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 All

Comments


Let's do our best with our partner:​ ChatReminder

iphone6.5p2.png

It is an application that achieves goals in a chat format with partners.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png

Let's do our best with our partner:​ ChatReminder

納品:iPhone6.5①.png

It is an application that achieves goals in a chat format with partners.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png

Theme diary: Decide the theme and record for each genre

It is a diary application that allows you to post and record with themes and sub-themes for each genre.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png
bottom of page