title: is it possible to return a default value when using enum in dart
body: <p>Now I am define a enum in dart like this:</p>
  <pre><code>enum LoginType {
    PHONE,
    WECHAT
  }
  
  extension ResponseStatusExtension on LoginType{
    static const statusCodes = {
      LoginType.PHONE: 1,
      LoginType.WECHAT: 2,
    };
  
  
    int get statusCode =&gt; statusCodes[this];
  }
  </code></pre>
  <p>I am upgrade to flutter 2.0.1 and support null safety and now it tell me :</p>
  <pre><code>A value of type 'int?' can't be returned from the function 'statusCode' because it has a return type of 'int'.
  </code></pre>
  <p>but I want to make it return a default not null value to make the code rubust and did not have to handle null when using this enum. what should I do to make it return a default value? is it possible?</p>