title: The getter 'fromJson' isn't defined for the type in Dart
body: <p>I am learning flutter, trying to use Getx's GetConnect <a href="https://pub.dev/packages/get#custom-configuration" rel="nofollow noreferrer">Custom configuration</a>,</p>
  <p>when try to set defaultDecoder for default request, it complains:</p>
  <pre><code>The getter 'fromJson' isn't defined for the type 'Resp'.
  Try importing the library that defines 'fromJson', correcting the name to the name of an existing getter, or defining a getter or field named 'fromJson'.dart&quot;
  </code></pre>
  <p>How to fix this error?</p>
  <p>Here is My Code:</p>
  <pre><code>import 'package:get/get.dart';
  
  class AuthService extends GetConnect {
    @override
    void onInit() {
      // All request will pass to jsonEncode so CasesModel.fromJson()
  
      httpClient.defaultDecoder = Resp.fromJson;
      httpClient.baseUrl = 'http://localhost/app_api/auth';
  
     
    }
  
    Future&lt;Response&lt;Map&lt;String, dynamic&gt;&gt;&gt; getCaptcha(String mobile) =&gt;
        get(&quot;get_captcha&quot;);
  }
  
  class Resp {
    final int Errcode;
    final String Errmsg;
    final Map&lt;String, dynamic&gt; Data;
  
    Resp(this.Errcode, this.Errmsg, this.Data);
  
    factory Resp.fromJson(Map&lt;String, dynamic&gt; json) {
      return Resp(json[&quot;errcode&quot;], json[&quot;errmsg&quot;], json[&quot;data&quot;]);
    }
  }
  </code></pre>