title: How can I show three data in one chart? (flutter/fl_chart)
body: <pre><code>class BottomChart extends StatefulWidget {
    final List&lt;String&gt; number;
  
    const BottomChart({this.number});
  
    @override
    _BottomChartState createState() =&gt; _BottomChartState();
  }
  
  class _BottomChartState extends State&lt;BottomChart&gt; {
    List&lt;Color&gt; gradientColors = [
      const Color(0xff23b6e6),
      const Color(0xff02d39a),
    ];
  
    bool showCnfirmed = true;
    bool showRecvred = false;
    bool showDead = false;
  
    @override
    Widget build(BuildContext context) {
      return Stack(
        children: &lt;Widget&gt;[
          AspectRatio(
            aspectRatio: 1 / 3,
            child: Container(
              child: Padding(
                padding: const EdgeInsets.only(right: 0, left: 34.0, top: 24, bottom: 24),
                child: LineChart(
                  if(showCnfirmed){cnfirmedData()}
                  if(showRecvred){recvredData()}
                  if(showDead){deadData()}
                ),
              ),
            ),
          ),
          SizedBox(
            width: 60,
            height: 34,
            child: Row(
              children: [
                FlatButton(
                  onPressed: () {
                    setState(() {
                      showCnfirmed = !showCnfirmed;
                    });
                  },
                  child: Text(
                    'Confirmed',
                    style: TextStyle(
                      fontSize: 12, color: showCnfirmed ? Colors.white.withOpacity(0.5) :Colors.white)
                    )
                ),
                FlatButton(
                  onPressed: () {
                    setState(() {
                      showRecvred = !showRecvred;
                    });
                  },
                  child: Text(
                    'Recovered',
                    style: TextStyle(
                      fontSize: 12, color: showRecvred ? Colors.white.withOpacity(0.5) :Colors.white)
                    )
                ),
                FlatButton(
                  onPressed: () {
                    setState(() {
                      showDead = !showDead;
                    });
                  },
                  child: Text(
                    'Dead',
                    style: TextStyle(
                      fontSize: 12, color: showDead ? Colors.white.withOpacity(0.5) :Colors.white)
                    )
                ),
              ],
            )
            )
        ],
      );
    }
  }
  </code></pre>
  <p>I tired to make a chart that shows three data(actually three lines in a line chart) by whether their button clicked or not, using fl_chart in flutter package.</p>
  <p>as you can see the code above, I wrote identifier checking whether button clicked or not and show its data in LineChart() part with if, but it said,</p>
  <pre><code>Performing hot reload...
  Syncing files to device Android SDK built for x86...
  lib/ui/screens/home_page.dart:106:17: Error: Expected an identifier, but got 'if'.
                  if(showCnfirmed){cnfirmedData()}
                  ^^
  lib/ui/screens/home_page.dart:106:17: Error: Expected ')' before this.
                  if(showCnfirmed){cnfirmedData()}
                  ^^
  </code></pre>
  <p>in the example code, it wrote like this,</p>
  <pre><code>LineChart(
                  showAvg ? avgData() : mainData(),
                ),
  </code></pre>
  <p>But the example is about two data, and mine is about three data.
  How can I solve this problem?</p>
  <p>Thank you for reading and I'll wait for your advice! :)</p>