title: A value of type 'Null' can't be returned from the function ' ' because it has a return type of 'String'
body: <p>I am following a flutter tutorial uses the following codes</p>
  <pre><code>class Auth with ChangeNotifier {
    late String _token;
    late DateTime _expiryDate;
    late String _userId;
    late Timer _authTimer;
  
    String get token {
      if (_expiryDate != null &amp;&amp;
          _expiryDate.isAfter(DateTime.now()) &amp;&amp;
          _token != null) {
        return _token;
      }
      return null;
    }
  
    Future&lt;void&gt; logout() async {
      _token = null;
      _userId = null;
      _expiryDate = null;
      if (_authTimer != null) {
        _authTimer.cancel();
        _authTimer = null;
      }
      notifyListeners();
      final prefs = await SharedPreferences.getInstance();
      // prefs.remove('userData');
      prefs.clear();
    }
  }
  </code></pre>
  <p>But as I am using the new version of flutter it gives me the following errors:</p>
  <pre><code>A value of type 'Null' can't be returned from the function 'token' because it has a return type of 'String'.
  </code></pre>
  <p>Or</p>
  <pre><code>A value of type 'Null' can't be assigned to a variable of type 'Timer'.
  Try changing the type of the variable, or casting the right-hand type to 'Timer'.
  </code></pre>
  <p>Also</p>
  <pre><code>A value of type 'Null' can't be assigned to a variable of type 'DateTime'.
  Try changing the type of the variable, or casting the right-hand type to 'DateTime'.
  </code></pre>
  <p>I don't know how to fix this to make code run?</p>