Container(
decoration: BoxDecoration(
color: (page == _currentPage)
? Colors.blue.shade800
: Colors.green.shade600
),
I am trying to add another option to the tenerary operator since i have three pages that will change color. How can i add a third option
3
Answers
you can do
Creating a method will be better for more.
First you have to understand how tenerary operator works
Here is the simple nested example of tenerary operator
and this is equal to