title: Change the color of options and show different widgets by taping on them in flutter?
body: <p>I am using flutter. I want to change the color of a particular option when I tap on it, not all the options at the same time. When we press an option its color changes and it shows different widgets below it(like tab bar). The code is attached below. I am glad if someone helps. ..</p>
  <pre><code>import 'package:flutter/material.dart';
  
  class cards extends StatelessWidget {
  const cards({Key? key}) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: const Text(&quot;Cards&quot;),
    ),
    body: Padding(
      padding: const EdgeInsets.only(top: 20),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          optionCards(&quot;A&quot;, &quot;assets/icons/recycle.png&quot;, context),
          optionCards(&quot;B&quot;, &quot;assets/icons/tools.png&quot;, context),
          optionCards(&quot;C&quot;, &quot;assets/icons/file.png&quot;, context),
        ],
      ),
    ),
    );
    }
  
  Widget optionCards(
  String text,
  String assetImage,
  BuildContext context,
  ) {
  return Container(
    width: 100,
    height: 100,
    decoration: const ShapeDecoration(
      color: Colors.grey,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.all(
          Radius.circular(5),
        ),
      ),
    ),
    child: SingleChildScrollView(
      child: Column(
        children: [
          const Padding(
            padding: EdgeInsets.only(top: 13),
            child: IconButton(
              onPressed: null,
              icon: Icon(Icons.file_copy),
            ),
          ),
          Text(
            text,
            style: const TextStyle(
              fontSize: 14,
              fontFamily: 'CeraPro',
              color: Color.fromRGBO(0, 0, 0, 1),
            ),
          )
        ],
      ),
    ),
    );
   }
  }
  </code></pre>