title: Flutter FutureBuilder snapshot returns Instance of 'Object' instead of data
body: <p>i am new to flutter and trying to display data from a http post</p>
  <p>referencing from [1]<a href="https://flutter.dev/docs/cookbook/networking/background-parsing" rel="nofollow noreferrer">https://flutter.dev/docs/cookbook/networking/background-parsing</a> and [2]<a href="https://flutter.dev/docs/cookbook/networking/fetch-data" rel="nofollow noreferrer">https://flutter.dev/docs/cookbook/networking/fetch-data</a></p>
  <p>i tried to display data on a futurebuilder but it keeps displaying this from the Text('${snapshot.data}')</p>
  <pre><code>[Instance of 'DashBoardBanner', Instance of 'DashBoardBanner', Instance of 'DashBoardBanner']
  </code></pre>
  <p>Builder</p>
  <pre><code>class MyApp extends StatefulWidget {
    const MyApp({Key? key}) : super(key: key);
    @override
    _MyAppState createState() =&gt; _MyAppState();
  }
  class _MyAppState extends State&lt;MyApp&gt; {
    late Future&lt;List&lt;DashBoardBanner&gt;&gt; futureBanner;
    @override
    void initState() {
      super.initState();
      futureBanner = getBannerDataFromServer();
    }
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Center(
            child: ListView(
              children: [
                Card(
                  child: FutureBuilder(
                    future: getBannerDataFromServer(),
                    builder: (context,snapshot){
                      if(snapshot.connectionState == ConnectionState.done){
                        if (snapshot.hasData) {
                          return Text('${snapshot.data}');
                        } else if (snapshot.hasError) {
                          return Text('${snapshot.error}');
                        }
                      }
                      return const CircularProgressIndicator();
                    },
                  ),
                )
              ],
            )),
      );
    }
  }
  </code></pre>
  <p>Class and postreq</p>
  <pre><code>class DashBoardBanner {
    final String MsgId;
    final String MsgKey;
    final String MsgPic;
  
    const DashBoardBanner(
        {required this.MsgId, required this.MsgKey, required this.MsgPic});
  
    factory DashBoardBanner.fromJson(Map&lt;String, dynamic&gt; json) {
      return DashBoardBanner(
        MsgId: json['MsgId'] as String,
        MsgKey: json['MsgKey'] as String,
        MsgPic: json['MsgPic'] as String,
      );
    }
  }
  
  Future&lt;List&lt;DashBoardBanner&gt;&gt; getBannerDataFromServer() async {
    final queryParameters = {
      &quot;ApiFunc&quot;: 'Banner',
      &quot;UserKey&quot;: getDeviceKey(),
      &quot;Token&quot;: getDeviceToken(),
      &quot;SubmitContent&quot;: json.encode({&quot;MobileNo&quot;: getMobileNo1()})
    };
    final response = await http.post(
      Uri.http('somesite.net', '/capi.aspx', queryParameters),
    );
  
    if (response.statusCode == 200) {
      Map&lt;String, dynamic&gt; data = jsonDecode(response.body);
      final splitoff = jsonEncode(data['RespContent']);
      return compute(parseBanner, splitoff);
    } else {
      throw Exception('Failed to load Data');
    }
  }
  
  List&lt;DashBoardBanner&gt; parseBanner(String responseBody) {
    final parsed = jsonDecode(responseBody).cast&lt;Map&lt;String, dynamic&gt;&gt;();
    return parsed
        .map&lt;DashBoardBanner&gt;((json) =&gt; DashBoardBanner.fromJson(json))
        .toList();
  }
  </code></pre>
  <p><strong>Edit</strong> : i rebuilt the file replicating reference[1] and it finally displayed the data i needed, it seems the issue stem from not having this 2nd widget which return the obj back , however how do i combine the 2nd build widget into the first without needing the whole widget as having a whole build widget to return 1 line seems pointless?</p>
  <pre><code>class MyApp extends StatelessWidget {
    const MyApp({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body:Container(
          child: FutureBuilder&lt;List&lt;DashBoardBanner&gt;&gt;(
            future: getBannerDataFromServer(http.Client()),
            builder: (context, snapshot) {
              if (snapshot.hasError) {
                return const Center(
                  child: Text('An error has occurred!'),
                );
              } else if (snapshot.hasData) {
                print(snapshot.data!.length);
                return DashBoardBannersList(dashboardBanners: snapshot.data!);  &lt;--- original issue due to not having this
              } else {
                return CircularProgressIndicator();
              }
            },
          ),
        ),
  
      );
    }
  }
  
  class DashBoardBannersList extends StatelessWidget {
    const DashBoardBannersList({Key? key, required this.dashboardBanners}) : super(key: key);
  
    final List&lt;DashBoardBanner&gt; dashboardBanners;
  
    @override
    Widget build(BuildContext context) {
          return Text(dashboardBanners[0].MsgId); 
    }
  }
  </code></pre>