title: parsing json into flutter List<dynamic> to Map<String, dynamic>
body: <p>Hello I want to parse Json and I faced this issue what's wrong please help <br>
  the error was 'List' is not a subtype of type 'Map&lt;String, dynamic&gt;' <br>
  <strong>Model</strong></p>
  <pre><code>class CategoriesModel {
    CategoriesModel({
      this.id,
      this.title,
      this.price,
      this.description,
      this.image,
    });
  
    int? id;
    String? title;
    double? price;
    String? description;
    String? image;
  
    factory CategoriesModel.fromJson(Map&lt;String, dynamic&gt; json) {
      return CategoriesModel(
        id: json[&quot;id&quot;],
        title: json[&quot;title&quot;],
        price: json[&quot;price&quot;].toDouble(),
        description: json[&quot;description&quot;],
        image: json[&quot;image&quot;],
      );
    }
  
  
    Map&lt;String, dynamic&gt; toMap() =&gt; {
      &quot;id&quot;: id,
      &quot;title&quot;: title,
      &quot;price&quot;: price,
      &quot;description&quot;: description,
      &quot;image&quot;: image,
    };
  }
  </code></pre>
  <p>in <strong>cubit</strong> I did this (AppCubit.dart)</p>
  <pre><code>CategoriesModel? categoriesModel ;
  
     getCategories(){
      emit(OnLoadingCategoriesState());
      DioHelper.getData(pathUrl: &quot;products&quot;).then((value){
        categoriesModel = CategoriesModel.fromJson(value.data);
        // catList =  (value.data as List)
        //     .map((x) =&gt; CategoriesModel.fromJson(x))
        //     .toList();
        // print(catList.length);
  
        emit(OnSuccessCategoriesState());
      }).catchError((error){
        emit(OnCatchErrorCategoriesState(error.toString()));
        print(error.toString());
      });
    }
  
  </code></pre>
  <p>in <strong>Dio</strong> Helper I did general function to use it</p>
  <pre><code>  static Future&lt;Response&gt; getData({required pathUrl})async{
     return await dio.get(pathUrl);
    }
  </code></pre>
  <p>and this is small data from <strong>json</strong></p>
  <pre><code>[
    {
      &quot;id&quot;: 1,
      &quot;title&quot;: &quot;Fjallraven - Foldsack No. 1 Backpack, Fits 15 Laptops&quot;,
      &quot;price&quot;: 109.95,
      &quot;description&quot;: &quot;Your perfect pack for everyday use and walks in the forest. Stash your laptop (up to 15 inches) in the padded sleeve, your everyday&quot;,
      &quot;category&quot;: &quot;men's clothing&quot;,
      &quot;image&quot;: &quot;https://fakestoreapi.com/img/81fPKd-2AYL._AC_SL1500_.jpg&quot;
    },
    {
      &quot;id&quot;: 2,
      &quot;title&quot;: &quot;Mens Casual Premium Slim Fit T-Shirts &quot;,
      &quot;price&quot;: 22.3,
      &quot;description&quot;: &quot;Slim-fitting style, contrast raglan long sleeve, three-button henley placket, light weight &amp; soft fabric for breathable and comfortable wearing. And Solid stitched shirts with round neck made for durability and a great fit for casual fashion wear and diehard baseball fans. The Henley style round neckline includes a three-button placket.&quot;,
      &quot;category&quot;: &quot;men's clothing&quot;,
      &quot;image&quot;: &quot;https://fakestoreapi.com/img/71-3HjGNDUL._AC_SY879._SX._UX._SY._UY_.jpg&quot;
    },
  ]
  </code></pre>
  <p>finally this is error that was appeared to me</p>
  <pre><code>I/flutter (31455): onChange -- AppCubit, Change { currentState: Instance of 'OnLoadingCategoriesState', nextState: Instance of 'OnCatchErrorCategoriesState' }
  I/flutter (31455): type 'List&lt;dynamic&gt;' is not a subtype of type 'Map&lt;String, dynamic&gt;'
  </code></pre>
  <p>any help I'll appreciated</p>