title: ArgumentError (Invalid argument: Instance of 'Article') trying to update user list on firebase
body: <p>I'm trying to update one field in user collection witch is List of Articles and I want to add Article that list then update my save article page.
  lets get start with User Model</p>
  <blockquote>
  <p>User Model</p>
  </blockquote>
  <pre><code>
  @JsonSerializable()
  class AmataUser {
    String? userName;
    String? emailAddrress;
    String? uid;
    String? profileUrl;
    List&lt;Article&gt;? savedArticles;
  
    AmataUser(
        {this.emailAddrress, this.profileUrl, this.savedArticles, this.userName, this.uid});
  
    factory AmataUser.fromJson(Map&lt;String, dynamic&gt; json) =&gt;
        _$AmataUserFromJson(json);
  
    Map&lt;String, dynamic&gt; toJson() =&gt; _$AmataUserToJson(this);
  
    AmataUser copyWith(
            {String? emailAddres,
            String? password,
            String? profileUrlm,
            List&lt;Article&gt;? savedArticles}) =&gt;
        AmataUser(
            profileUrl: profileUrl ?? this.profileUrl,
            emailAddrress: emailAddrress ?? this.emailAddrress,
            // password: password ?? this.password,
            savedArticles: savedArticles ?? this.savedArticles);
  }
  
  </code></pre>
  <p>and here is my Article Models</p>
  <blockquote>
  <p>Article Model</p>
  </blockquote>
  <pre><code>@JsonSerializable()
  class Article {
    String? title;
    String? body;
    String? coverImageUrl;
    Article({this.body, this.coverImageUrl, this.title});
  
    factory Article.fromJson(Map&lt;String, dynamic&gt; json) =&gt;
        _$ArticleFromJson(json);
  
    Map&lt;String, dynamic&gt; toJson() =&gt; _$ArticleToJson(this);
  
    Article copyWith({String? title, String? body, String? coverImageUrl}) {
      return Article(
        title: title??this.title,
        body: body??this.body, 
        coverImageUrl:coverImageUrl??this.coverImageUrl
      );
    }
  }
  </code></pre>
  <p>with this models I try to update user savedArticles by this function from my userRepository</p>
  <pre><code>  Future&lt;RawData&gt; saveArticleToReadingList(
        {required AmataUser user, required Article article}) async {
      try {
        log('saving ${article.title} to user list');
        var doc = await _userRef.doc(user.uid).get();
        AmataUser amatauser = AmataUser.fromJson(doc.data() as Map&lt;String, dynamic&gt;);
        amatauser.savedArticles!.add(article);
        print(amatauser.savedArticles!.length);
        var resualt = await _userRef
            .doc(user.uid)
            .update({'savedArticles': amatauser.savedArticles});
        return RawData();
      } catch (e) {
        return RawData(operationResult: OperationResult.fail, data: e.toString());
      }
    }
  </code></pre>
  <p>the error also is <strong>ArgumentError (Invalid argument: Instance of 'Article')</strong>.
  I should mention that I had search before and I can't  find any answer ,there was github issues like me that developer cant update list of his model but unfortunately issues was close and  there wasn't any solution</p>