title: How to implement the Swiping-Gesture for a PageView using a GestureRecognizer in Flutter?
body: <p>I am trying to recreate the MediaPicker from Instagram.</p>
  <p>The current structure of this screen looks like this:</p>
  <pre><code>    return Scaffold(
        appBar: buildAppBar(context),
        body: PageView(
          physics: NeverScrollableScrollPhysics(), //disable the &quot;normal&quot; pageview scrolling
          onPageChanged: (index) {
            setState(() {
              pageIndex = index;
            });
          },
          controller: pageController,
          children: [
            Column(
              children: [
                Expanded(
                  flex: 3,
                  child: buildPreviewWidget(selection, _buildCropPreview), //this cropview has a gesture recognizer on it
                ),
                const SizedBox(height: 2),
                Expanded(
                    flex: 2,
                    child: GestureDetector(
                      onHorizontalDragStart: (details) {
                        double offset = screenWidth - details.localPosition.dx;
                        pageController.jumpTo(offset);
                      },
                      onHorizontalDragUpdate: (details) {
                        double offset = screenWidth - details.localPosition.dx;
                        pageController.jumpTo(offset);
                      },
                      child:MediaGrid( //this is the media grid
                              allowMultiSelection: multiSelectable,
                              collection: allCollection),
                    )),
              ],
            ),
            CameraScreen(),
          ],
        ),
        bottomNavigationBar: buildBottomNavigationBar(),
      );
    
  </code></pre>
  <p>The initial problem was, that whenever I dragged around in the cropview, the swiping gesture of the pageview got triggered which was not what I wanted.</p>
  <p>So my idea was to disable the standard way of scrolling with <code>NeverScrollableScrollPhysics()</code> and then wrap only the <code>MediaGrid()</code> with a <code>GestureRecognizer()</code> so that I can achieve the same swipe animation with the help of the PageViews <code>pageController.jumpTo()</code> but only on the <code>MediaGrid()</code></p>
  <p>However my implementation seems to be bad because the pageview is stuttering like this</p>
  <p><a href="https://imgur.com/a/EzabR7w" rel="nofollow noreferrer">https://imgur.com/a/EzabR7w</a></p>
  <p>How do I smooth the stuttering or is there an even better way to achieve this?</p>