title: Flutter GetX Provider & GetConnect Settings
body: <p>I created a Flutter project with GetX CLI. Then i created a provider with get generate model. But i have problems with provider:</p>
  <ol>
  <li>When i bind it with lazyPut, onInit() never works.</li>
  <li>When i bind it with put, onInit() works but httpClient.defaultDecoder section does
  not executed.</li>
  <li>When i bind it with put, onInit() works and httpClient.baseUrl is adjusted but i can't read it in getFaculties. It seems like null in global.</li>
  <li>When i put httpClient.defaultDecoder and httpClient.baseUrl in getFaculties, works well. But doesn't seem like the right way.</li>
  </ol>
  <p>Am i doing something wrong or is it about GetConnect? Thanks in advance.</p>
  <p>Provider:</p>
  <pre><code>    class FacultyProvider extends GetConnect {
      @override
      void onInit() {
  
      print('PROVIDER INIT!'); // Works with Get.put(FacultyProvider()) in Bindings
  
      httpClient.defaultDecoder = (map) { // NEVER WORKS
        if (map is Map&lt;String, dynamic&gt;) {
          print('MAP!');
          return Faculty.fromJson(map);
        }
  
        if (map is List) {
          print('LIST!');
          return map.map((item) =&gt; Faculty.fromJson(item)).toList();
        }
      };
      httpClient.baseUrl = 'http://localhost:3000/public';
      }
  
      Future&lt;List&lt;Faculty&gt;&gt; getFaculties(bool cache) async {
  
        print(httpClient.baseUrl); // ALWAYS NULL
  
        final response = await httpClient.get('/faculties/true'); // NO HOST ERROR
        return response.body; // TYPE ERRORS because of defaultDecoder section didn't run
      }
  </code></pre>
  <p>Bindings:</p>
  <pre><code>    class FacultiesBinding extends Bindings {
        @override
        void dependencies() {
        Get.put(FacultyProvider());
        // Get.lazyPut&lt;FacultyProvider&gt;(() =&gt; FacultyProvider());
        Get.lazyPut&lt;FacultiesController&gt;(() =&gt; FacultiesController());
      }
  </code></pre>