title: The argument type 'Color' can't be assigned to the parameter type 'int'
body: <p>i'm new to flutter with dart programming.
  i found an error regarding my question, that is about &quot;i created a model class and a list, model class has a member of type <strong>Color</strong>, then in the <strong>main.dart</strong>, i want to display a list of my model data in a <strong>ListView.builder</strong>, but when in a separate widget of container, everything else works well but color property is giving error, i tried to change the type of index parameter but error stays. &quot;</p>
  <p>here is code:</p>
  <pre><code>import 'package:flutter/material.dart';
  
   class ProductModel {
            
  ProductModel(
  this.title,
  this.name,
  this.image,
  this.color
  );
  
  final String title;
  final String name;
  final String image;
  final Color color;
  }
  
  final modelProduct = &lt;ProductModel&gt;[
   ProductModel(
  &quot;titile1&quot;,
  &quot;name1&quot;,
  &quot;https://image.freepik.com/free-vector/multitasking-concept-illustration-character_23-2148403716.jpg&quot;,
  Colors.pink.withOpacity(0.4),
  ),
  ProductModel(
  &quot;titile2&quot;,
  &quot;name2&quot;,
  &quot;https://image.freepik.com/free-vector/people-putting-puzzle-pieces-together_52683-28610.jpg&quot;,
  Colors.blue.withOpacity(0.4),
  ),
  ProductModel(
  &quot;titile3&quot;,
  &quot;name3&quot;,
  &quot;https://image.freepik.com/free-vector/people-using-online-apps-set_74855-4457.jpg&quot;,
  Colors.yellow.withOpacity(0.4),
  ),
  ]
  </code></pre>
  <p>and the <strong>main.dart</strong>
  i skipped the boiler plate code of first flutter, and just copied that has the main thing of my concern,</p>
  <pre><code>class _MyHomePageState extends State&lt;MyHomePage&gt; {
  @override
  Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text(widget.title),
    ),
    body: Container(
        child: ListView.builder(
            itemCount: modelProduct.length,
            itemBuilder: (context, index) {
              return createItem(context, index);
            })),
    );
   }
  }
  
  Widget createItem(BuildContext context, index) {
  return Container(
  height: MediaQuery.of(context).size.height * 0.3,
  width: MediaQuery.of(context).size.width,
  child: Text(modelProduct[index].title),
  color: Color(modelProduct[index].color),
  );
  }
  </code></pre>
  <p>the issue is on <strong>color: Color(modelProduct[index].color)</strong> this line
  , and the error is</p>
  <pre><code>The argument type 'Color' can't be assigned to the parameter type 'int'.
  </code></pre>
  <p>but i know that if i turn the type of color into int in my model class, and provide the int type value of color like 0xFFFFFF then the error is resolved, but my question is if i want to use the material color like i used above, how to do with it.
  Thank you</p>