title: Error parsing list of products in dart flutter using http
body: <p>I have an api from where i want to parse some data , i have a plugin that convert data into dart model class , but whenever i try to get the response , it keeps showing an error if anyone could help , will be appreciated</p>
  <ul>
  <li>This is the api link</li>
  </ul>
  <pre><code> https://fakestoreapi.com/products/category/electronics 
  </code></pre>
  <ul>
  <li>This is the model class ( generated using plugin for dart )</li>
  </ul>
  <pre><code>
  class ProductsModel {
      String category;
      String description;
      int id;
      String image;
      double price;
      String title;
  
      ProductsModel({this.category, this.description, this.id, this.image, this.price, this.title});
  
      factory ProductsModel.fromJson(Map&lt;String, dynamic&gt; json) {
          return ProductsModel(
              category: json['category'], 
              description: json['description'], 
              id: json['id'], 
              image: json['image'], 
              price: json['price'], 
              title: json['title'], 
          );
      }
  
      Map&lt;String, dynamic&gt; toJson() {
          final Map&lt;String, dynamic&gt; data = new Map&lt;String, dynamic&gt;();
          data['category'] = this.category;
          data['description'] = this.description;
          data['id'] = this.id;
          data['image'] = this.image;
          data['price'] = this.price;
          data['title'] = this.title;
          return data;
      }
  }
  
  </code></pre>
  <ul>
  <li>This is how i'm parsing data</li>
  </ul>
  <pre><code>void main(){
    runApp(MaterialApp(
      home: FirstScreenApp(),
      debugShowCheckedModeBanner: false,
    ));
  }
  
  class FirstScreenApp extends StatefulWidget {
    @override
    _FirstScreenAppState createState() =&gt; _FirstScreenAppState();
  }
  
  class _FirstScreenAppState extends State&lt;FirstScreenApp&gt; {
  
    Future&lt;ProductsModel&gt; _getElectronics() async {
      var url = &quot;https://fakestoreapi.com/products/category/electronics&quot;;
      var response = await http.get(Uri.parse(url));
      if(response.statusCode == 200){
        // success
        var decodedResponse = json.decode(response.body);
        return ProductsModel.fromJson(decodedResponse);
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
         body: FutureBuilder&lt;ProductsModel&gt;(
           future: _getElectronics(),
           builder: (context,data){
             if(data.hasError){
               return Center(
                 child: Text(&quot;Error &quot; + data.error.toString()),
               );
             }
             if(data.connectionState == ConnectionState.done){
               return ListView.builder(
                 itemCount: 4 ,
                 itemBuilder: (context,index){
                   return Container(
                     margin: const EdgeInsets.all(10),
                     child: Card(
                       elevation: 10,
                       child: Padding(
                         padding: const EdgeInsets.all(12.0),
                         child: Row(
                           children: [
                             Image.network(data.data.image),
                             SizedBox(height: 10,),
                             Column(
                               mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                               crossAxisAlignment: CrossAxisAlignment.start,
                               children: [
                                 Text(&quot;League : &quot; + data.data.title),
                                 Text(&quot;Sport : &quot; + data.data.category),
                                 Text(&quot;DP : &quot; + data.data.price.toString())
                               ],
                             ),
                           ],
                         )
                       ),
                     ),
                   );
                 },
               );
             }
             return Center(
               child: CircularProgressIndicator(),
             );
           },
         ),
      );
    }
  }
  
   * This is the error generated
  
  </code></pre>
  <p>type 'List is not a subtype of type &lt;Map&lt;String,dynamic&gt;&gt;'</p>
  <pre><code>
  
  </code></pre>