title: how to implement in app time out session in flutter
body: <p>I want to log a user out after a specific amount time the user has not interacted with the app. </p>
  
  <p>I've wrapped the whole child widget in <code>GestureDetector()</code>.</p>
  
  <p>Please suggest if this is the best optimised way of doing this.</p>
  
  <pre><code>class MyWidget extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
  
      return new GestureDetector( 
      onTap: () {
        // duration reset's to a specific time 
        startTimeout([int milliseconds]) { return new Timer(duration, handleTimeout); } 
      },
      child: new HomeWidget(),); 
    }
  
    void handleTimeOut {
      // Log User Out
    }
  }
  </code></pre>