title: The named parameter 'key' is required, but there's no corresponding argument.-in flutter app developing
body: <p>I'm getting this error called The named parameter 'key' is required, but there's no corresponding argument. I'm developing a simple BMI calculator app using flutter, android studio. didn't understand about the error I'm new to flutter. can anyone tell me what to do about this error? followed up this <a href="https://www.youtube.com/watch?v=oX9PQI0D-v4" rel="nofollow noreferrer">youtube video</a> and the code is here <a href="https://github.com/Santos-Enoque/flutter_bmi_calculator" rel="nofollow noreferrer">github</a>.</p>
  <p><a href="https://i.stack.imgur.com/52xD9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/52xD9.png" alt="enter image description here" /></a></p>
  <pre><code>import 'package:bmi_cal/constants/app_constants.dart';
  import 'package:bmi_cal/widgets/left_bar.dart';
  import 'package:bmi_cal/widgets/right_bar.dart';
  import 'package:flutter/material.dart';
  
  class HomeScreen extends StatefulWidget {
    @override
    _HomeScreenState createState() =&gt; _HomeScreenState();
  }
  
  class _HomeScreenState extends State&lt;HomeScreen&gt; {
    TextEditingController _heightController = TextEditingController();
    TextEditingController _weightController = TextEditingController();
    double _bmiResult = 0;
    String _textResult = &quot;&quot;;
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(
            title: Text(
              &quot;BMI Calculator&quot;,
              style:
              TextStyle(color: accentHexColor, fontWeight: FontWeight.w300),
            ),
            backgroundColor: Colors.transparent,
            elevation: 0,
            centerTitle: true,
          ),
          backgroundColor: mainHexColor,
          body: SingleChildScrollView(
            child: Column(
              children: [
                SizedBox(
                  height: 20,
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    Container(
                      width: 130,
                      child: TextField(
                        controller: _heightController,
                        style: TextStyle(
                            fontSize: 42,
                            fontWeight: FontWeight.w300,
                            color: accentHexColor),
                        keyboardType: TextInputType.number,
                        decoration: InputDecoration(
                          border: InputBorder.none,
                          hintText: &quot;Height&quot;,
                          hintStyle: TextStyle(
                              fontSize: 42,
                              fontWeight: FontWeight.w300,
                              color: Colors.white.withOpacity(.8)),
                        ),
                      ),
                    ),
                    Container(
                      width: 130,
                      child: TextField(
                        controller: _weightController,
                        textAlign: TextAlign.center,
                        style: TextStyle(
                            fontSize: 42,
                            fontWeight: FontWeight.w300,
                            color: accentHexColor),
                        keyboardType: TextInputType.number,
                        decoration: InputDecoration(
                          border: InputBorder.none,
                          hintText: &quot;Weight&quot;,
                          hintStyle: TextStyle(
                              fontSize: 42,
                              fontWeight: FontWeight.w300,
                              color: Colors.white.withOpacity(.8)),
                        ),
                      ),
                    ),
                  ],
                ),
                SizedBox(
                  height: 30,
                ),
                GestureDetector(
                  onTap: () {
                    double _h = double.parse(_heightController.text);
                    double _w = double.parse(_weightController.text);
                    setState(() {
                      _bmiResult = _w / (_h * _h);
                      if(_bmiResult &gt; 25){
                        _textResult = &quot;You\'re over weight&quot;;
                      } else if(_bmiResult &gt;= 18.5 &amp;&amp; _bmiResult &lt;= 25){
                        _textResult = &quot;You have normal weight&quot;;
                      }else{
                        _textResult = &quot;You\'re under weight&quot;;
                      }
                    });
                  },
                  child: Container(
                    child: Text(
                      &quot;Calculate&quot;,
                      style: TextStyle(
                          fontSize: 22,
                          fontWeight: FontWeight.bold,
                          color: accentHexColor),
                    ),
                  ),
                ),
                SizedBox(
                  height: 50,
                ),
                Container(
                  child: Text(
                    _bmiResult.toStringAsFixed(2),
                    style: TextStyle(fontSize: 90, color: accentHexColor),
                  ),
                ),
                SizedBox(
                  height: 30,
                ),
                Visibility(
                    visible: _textResult.isNotEmpty,
                    child: Container(
                      child: Text(
                        _textResult,
                        style: TextStyle(
                            fontSize: 32,
                            fontWeight: FontWeight.w400,
                            color: accentHexColor),
                      ),
                    )),
                SizedBox(height: 10,),
                LeftBar(barWidth: 40,),
                SizedBox(height: 20,),
                LeftBar(barWidth: 70),
                SizedBox(height: 20,),
                LeftBar(barWidth: 40,),
                SizedBox(height: 20,),
                RightBar(barWidth: 70),
                SizedBox(height: 50,),
                RightBar(barWidth: 70),
              ],
            ),
          ));
    }
  }
  </code></pre>
  <blockquote>
  <p>main.dart</p>
  </blockquote>
  <pre><code>import 'package:bmi_cal/screens/home.dart';
  import 'package:flutter/material.dart';
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'BMI calculator',
        debugShowCheckedModeBanner: false,
        theme: ThemeData(
          primarySwatch: Colors.yellow,
          visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
        home: HomeScreen(),
      );
    }
  }
  </code></pre>