title: getting error: The argument type 'Product' can't be assigned to the parameter type 'Map<String, dynamic>
body: <p>I'm trying to add some new data but get the error:</p>
  
  <p><code>The argument type 'Product' can't be assigned to the parameter type 'Map&lt;String, dynamic&gt;</code></p>
  
  <p>Here is what I'm trying to do:
  I have a form with simply 2 <code>TextField</code>s
  I've declared a map with the data</p>
  
  <pre><code>final Map&lt;String, dynamic&gt; _formData = {
        'title': null,
        'content': null,
      };
  </code></pre>
  
  <p>and afterwards I'm using the bloc to pass the data with the model constructor <code>Product</code></p>
  
  <pre><code>RaisedButton(
                  child: Text('Add'),
                    onPressed: () {
                    bloc.createData(
                      Product(
                          title: _formData['title'],
                          content: _formData['description'],
                    )
                    );
                  }
                ),
  </code></pre>
  
  <p>in the bloc  I pass it to the provider like so:</p>
  
  <pre><code>  void createData(Product product) async {
      String id = await db.createData(product);
      _inId.add(id);
    }
  </code></pre>
  
  <p>And here it comes:</p>
  
  <pre><code>Future createData(Product product) async {
      DocumentReference ref = await db.collection("product").add(product); //error: The argument type 'Product' can't be assigned to the parameter type 'Map&lt;String, dynamic&gt;
      print(ref.documentID);
      return ref.documentID;
  }
  </code></pre>
  
  <p>as I'm using the collection_reference and it takes a map I cannot use the argument model Products, which is constructed like so:</p>
  
  <pre><code>class Product {
  
    final String title, content;
  
    Product({this.title, this.content});
  
  }
  </code></pre>