title: Flutter how to get last PageView scroll direction
body: <p>I'm trying to get which direction(left or right) user swiped by using <code>PageView</code>.
  I was able to get direction like so.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code> PageController _controller;
  
    @override
    void initState() {
      _controller = new PageController()..addListener(_listener);
      super.initState();
    }
  
    _listener() {
      if (_controller.position.userScrollDirection == ScrollDirection.reverse) {
        print('swiped to right');
      } else {
        print('swiped to left');
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(),
        body: PageView.builder(
            itemCount: 10,
            controller: _controller,
            itemBuilder: (context, index) {
              return new Center(child: Text('item ${++index}'));
            }),
      );
    }
  </code></pre>
  
  <p>However since it's not getting end of scrolling, <code>print</code> method
  return this many times. 
  Is there way I can get this after current page switched to next page completely? </p>
  
  <blockquote>
    <p>flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right<br>
    flutter: swiped to right  </p>
  </blockquote>