title: The getter 'Timer' isn't defined for the class
body: <p>I was following <a href="https://stackoverflow.com/questions/52569602/flutter-run-function-every-x-amount-of-seconds">this stack-overflow</a> to implement a timer operations at a one-second interval and is getting the captioned error. What do I have to do?</p>
  <pre><code>  floatingActionButton: FloatingActionButton(
      child: Icon(Icons.add),
      onPressed: () async {
        Timer.periodic(Duration(seconds:1), (Timer t) =&gt; print(t));
      }
    );
  </code></pre>
  <p>Error:</p>
  <pre><code>lib/main.dart:182:48: Error: 'Timer' isn't a type.                      
        Timer.periodic(Duration(seconds:1), (Timer t) =&gt; print(t));   
                                             ^^^^^                    
  lib/main.dart:182:11: Error: The getter 'Timer' isn't defined for the class '_UploadPageState'.
   - '_UploadPageState' is from 'package:decg_main/main.dart' ('lib/main.dart').
  Try correcting the name to the name of an existing getter, or defining a getter or field named 'Timer'.
            Timer.periodic(Duration(seconds:1), (Timer t) =&gt; print(t)); 
  </code></pre>