title: The following NoSuchMethodError was thrown building Home(): The method '>' was called on null. Receiver: null Tried calling: >(1)
body: <p>ERROR:The following NoSuchMethodError was thrown building Home(dirty, dependencies: [MediaQuery], state: _HomeState#a6c1f):
  The method '>' was called on null.
  Receiver: null
  Tried calling: >(1)</p>
  
  <p>i want to take multiple values in the second input box and the no of inputs are user dependant so i made a function to return the container with the text form field each time store the value in a different array index when i go that error  </p>
  
  <pre><code>  class Home extends StatefulWidget {
    @override
    _HomeState createState() =&gt; _HomeState();
  }
  
  class _HomeState extends State&lt;Home&gt; {
    int buildings;
    List&lt;int&gt; heights = [];
  
    Widget getinput() {
      for (var i = 1; i &lt;= buildings; i++) {
        return Container(
          width: 325,
          height: 60,
          child: TextFormField(
            keyboardType: TextInputType.number,
            decoration: InputDecoration(
              border: OutlineInputBorder(borderRadius: BorderRadius.circular(15)),
              hintText: 'Enter height and press enter to type next',
              focusedBorder: UnderlineInputBorder(
                borderSide: BorderSide(color: Colors.white),
              ),
            ),
            onFieldSubmitted: (String n) {
              setState(() {
                heights[i] = int.parse(n);
              });
            },
          ),
        );
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          backgroundColor: Colors.white,
          body: SingleChildScrollView(
            child: Container(
              width: MediaQuery.of(context).size.width,
              height: 341,
              decoration: BoxDecoration(
                  gradient: LinearGradient(colors: [
                    Color.fromRGBO(223, 39, 17, 0.98),
                    Color.fromRGBO(245, 160, 25, 0.98)
                  ], begin: Alignment.topRight, end: Alignment.bottomLeft),
                  borderRadius: BorderRadius.only(
                      bottomLeft: Radius.circular(30),
                      bottomRight: Radius.circular(30)),
                  boxShadow: [
                    BoxShadow(
                        color: Colors.black12,
                        spreadRadius: 5,
                        blurRadius: 5,
                        offset: Offset(1, 2))
                  ]),
              child: Padding(
                padding: const EdgeInsets.all(16.0),
                child: Column(
                  children: &lt;Widget&gt;[
                    Row(
                      children: &lt;Widget&gt;[
                        SizedBox(
                          width: 278,
                        ),
                        CircleAvatar(
                            radius: 25,
                            backgroundColor: Colors.transparent,
                            backgroundImage: AssetImage("assets/icon2.png"))
                      ],
                    ),
                    Row(
                      children: &lt;Widget&gt;[
                        Text(
                          "How many Buildings?",
                          style: TextStyle(
                            fontSize: 24,
                            color: Colors.white,
                            fontWeight: FontWeight.bold,
                            //fontStyle: FontStyle.italic,
                            fontFamily: 'MuseoModerno',
                          ),
                        ),
                      ],
                    ),
                    Container(
                      width: 325,
                      height: 60,
                      child: TextFormField(
                        keyboardType: TextInputType.number,
                        decoration: InputDecoration(
                          border: OutlineInputBorder(
                              borderRadius: BorderRadius.circular(15)),
                          hintText: 'Enter Number of Buildings and press enter',
                          focusedBorder: UnderlineInputBorder(
                            borderSide: BorderSide(color: Colors.white),
                          ),
                        ),
                        onFieldSubmitted: (String n) {
                          setState(() {
                            buildings = int.parse(n);
                          });
                        },
                      ),
                    ),
                    Row(
                      children: &lt;Widget&gt;[
                        Text(
                          "Enter the Heights",
                          style: TextStyle(
                            fontSize: 22,
                            color: Colors.white,
                            fontWeight: FontWeight.bold,
                            //fontStyle: FontStyle.italic,
                            fontFamily: 'MuseoModerno',
                          ),
                        ),
                      ],
                    ),
                    getinput(),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: &lt;Widget&gt;[
                        Padding(
                          padding: const EdgeInsets.only(top: 1),
                          child: ButtonTheme(
                            height: 55,
                            minWidth: 65,
                            child: RaisedButton(
                              elevation: 3,
                              shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(30.0),
                                  side: BorderSide(color: Colors.transparent)),
                              child: new Text(
                                "Initiate",
                                style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 25,
                                    fontFamily: "MuseoModerno",
                                    fontWeight: FontWeight.bold),
                              ),
                              color: Colors.black,
                              onPressed: () {},
                            ),
                          ),
                        )
                      ],
                    )
                  ],
                ),
              ),
            ),
          ));
    }
  }
  </code></pre>