title: How to set different background color to each ListView items in flutter
body: <p>I've been gone through many tutorials and I'm only able to switch between two colors by checking whether the index is even or odd.</p>
  <p>Here is my Code:</p>
  <pre><code>class PageTwoState extends State&lt;PageTwo&gt; {
    @override
    Widget build(BuildContext context) {
      return ListView.builder(
        itemExtent: 250.0,
        itemBuilder: (context, index) =&gt; Container(
              padding: EdgeInsets.all(10.0),
              child: Material(
                elevation: 4.0,
                borderRadius: BorderRadius.circular(5.0),
                color: index % 2 == 0 ? Colors.cyan : Colors.deepOrange,
                child: Center(
                  child: Text(index.toString()),
                ),
              ),
            ),
      );
    }
  }
  </code></pre>
  <p>I want each item to have a different background color(suppose if I have 10 items in my list then I want each item to have a different background color.), but by using a ternary operation I'm not able to do that.</p>