title: Why it gives invalid constant value?
body: <p>int _selectedIndex = 0; - is a variable defined in this state class so why there is an error?</p>
  
  <p><a href="https://i.stack.imgur.com/1TnmE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1TnmE.png" alt="enter image description here"></a></p>
  
  <pre><code>Compiler message:
  lib/rappport_list.dart:139:29: Error: Not a constant expression.
                              _selectedIndex == index ? Colors.red : Colors.cyan,
                              ^^^^^^^^^^^^^^
  lib/rappport_list.dart:139:47: Error: Not a constant expression.
                              _selectedIndex == index ? Colors.red : Colors.cyan,
                                                ^^^^^
  </code></pre>