title: Api response not showing problem flutter stuck at CircularProgressIndicator
body: <p>Im calling an api.
  This is my model</p>
  <pre><code>   final hisselist = hisselistFromJson(jsonString);
  
      import 'dart:convert';
  
      Hisselist hisselistFromJson(String str) =&gt; Hisselist.fromJson(json.decode(str));
  
      String hisselistToJson(Hisselist data) =&gt; json.encode(data.toJson());
  
      class Hisselist {
        Hisselist({
          required this.success,
          required this.result,
        });
  
        bool success;
        List&lt;ResultClass&gt; result;
  
        factory Hisselist.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Hisselist(
          success: json[&quot;success&quot;], result: json[&quot;result&quot;].map&lt;ResultClass&gt;((x) =&gt; ResultClass.fromJson(x)).toList()
        );
  
        Map&lt;String, dynamic&gt; toJson() =&gt; {
          &quot;success&quot;: success,
          &quot;result&quot;: result.map((x) =&gt; x.toJson()),
        };
      }
  
      class ResultClass {
        ResultClass({
          required this.rate,
          required this.lastprice,
          required this.lastpricestr,
          required this.hacim,
          required this.hacimstr,
          required this.text,
          required this.code,
        });
  
        double rate;
        double lastprice;
        String lastpricestr;
        double hacim;
        String hacimstr;
        String text;
        String code;
  
        factory ResultClass.fromJson(Map&lt;String, dynamic&gt; json) =&gt; ResultClass(
          rate: json[&quot;rate&quot;].toDouble(),
          lastprice: json[&quot;lastprice&quot;].toDouble(),
          lastpricestr: json[&quot;lastpricestr&quot;],
          hacim: json[&quot;hacim&quot;].toDouble(),
          hacimstr: json[&quot;hacimstr&quot;],
          text: json[&quot;text&quot;],
          code: json[&quot;code&quot;],
        );
  
        Map&lt;String, dynamic&gt; toJson() =&gt; {
          &quot;rate&quot;: rate,
          &quot;lastprice&quot;: lastprice,
          &quot;lastpricestr&quot;: lastpricestr,
          &quot;hacim&quot;: hacim,
          &quot;hacimstr&quot;: hacimstr,
          &quot;text&quot;: text,
          &quot;code&quot;: code,
        };
      }
  </code></pre>
  <p>And this is where i call api</p>
  <pre class="lang-dart prettyprint-override"><code>    import 'package:flutter/material.dart';
      import 'package:http/http.dart' as http;
  
      import '../models/apis/hisselist.dart';
  
      class Hisseler extends StatefulWidget {
        const Hisseler({Key? key}) : super(key: key);
  
        @override
        State&lt;Hisseler&gt; createState() =&gt; _HisselerState();
      }
  
      class _HisselerState extends State&lt;Hisseler&gt; {
  
        final scaffoldKey = GlobalKey&lt;ScaffoldState&gt;();
        final url = Uri.parse('https://api.collectapi.com/economy/hisseSenedi');
        var counter;
        Hisselist? hisseResult;
  
        Future callHisse() async {
          try{
            Map&lt;String, String&gt; requestHeaders = {
              'Content-Type': 'application/json',
              'Authorization': 'apikey xxx'
            };
            final response = await http.get(url,headers:requestHeaders);
  
            if(response.statusCode == 200){
              var result = hisselistFromJson(response.body);
  
              if(mounted);
              setState(() {
                counter = result.result.length;
                hisseResult = result;
              });
              return result;
            } else {
              print(response.statusCode);
            }
          } catch(e) {
            print(e.toString());
          }
        }
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            appBar: AppBar(
              centerTitle: false,
              automaticallyImplyLeading: false,
              title: Text(
                  'Hisseler'
              ),
            ),
            body: Center(
              child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: counter != null ?
  
                ListView.builder(
                    itemCount: counter,
                    itemBuilder: (context, index){
                      return Card(
                        child: ListTile(
                          title: Text(hisseResult?.result[index].code??&quot;&quot;),
                          subtitle: Text(hisseResult?.result[index].text??&quot;&quot;),
  
                        ),
                      );
                    }) : Center(child: CircularProgressIndicator(
  
                )),
              ),
            ),
          );
        }
      }
  
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/h3oxO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h3oxO.png" alt="enter image description here" /></a></p>
  <p>I'm using the same structure for news API in the same from the same API website. I tried API is working on postman. And I don't see any errors on the console. But circularprogessındicator working and nothing anymore happening.
  How can i fix this?</p>