title: Unhandled Exception: NoSuchMethodError: The method '[]' was called on null on flutter
body: <p>I want to show data in list view like in the below (that one is hard coded)
  <a href="https://i.stack.imgur.com/RasLi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RasLi.jpg" alt="enter image description here" /></a></p>
  <p>When I changed it to list, I got this error:</p>
  <pre><code>E/flutter ( 6925): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null.
  E/flutter ( 6925): Receiver: null
  E/flutter ( 6925): Tried calling: [](&quot;interest&quot;)
  </code></pre>
  <p>Here is my Widget Build:</p>
  <pre><code>@override
      Widget build(BuildContext context) {
        timeDilation = 2.0;
        return WillPopScope(
          onWillPop: () async =&gt; false,
          child: Scaffold(
            resizeToAvoidBottomInset: false,
            backgroundColor: kYellow,
            appBar: AppBar(
              leading: Hero(
                tag: 'animasilogo',
                child: Container(
                  margin: EdgeInsets.all(5.0),
                  child: Image.asset('assets/img/lemonlime.png'),
                ),
              ),
              title: Text('Simulator'),
              actions: [
                IconButton(
                  icon: const Icon(Icons.exit_to_app),
                  onPressed: () {
                    SharedPref.signOut();
                    Navigator.pushNamed(context, LoginScreen.id);
                  },
                )
              ],
            ),
            body: RefreshIndicator(
              onRefresh: () =&gt; _fetchData(),
              child: loading
                  ? Center(child: CircularProgressIndicator())
                  : ListView.builder(
                itemCount: _loanmodel.length,
                itemBuilder: (context, i) {
                final data =_loanmodel[i];
                return Container(
                  alignment: Alignment.topLeft,
                  margin: const EdgeInsets.only(top: 15.0),
                    padding: EdgeInsets.all(20.0),
                  child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: &lt;Widget&gt;[
                   Text(&quot;Interest :  &quot; + data.interest , style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 1.5), textAlign: TextAlign.justify),
                    Text(&quot;Balance :  &quot; + data.balance,  style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 1.5),textAlign: TextAlign.justify),
                    Text(&quot;Principal : &quot; + data.principal,  style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 1.5),textAlign: TextAlign.justify),
                    Text(&quot;Installment :&quot; + data.installment,  style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 1.5),textAlign: TextAlign.justify),
                    Divider(
                      color: Colors.black,
                    ),
  
                  ],
                ),
                  );
                },
              ),
            ),
          ),
        );
      }
    }
  </code></pre>
  <p>For API, Model and other function, you can check my another post in <a href="https://stackoverflow.com/questions/67564553/unhandled-exception-type-internallinkedhashmapstring-dynamic-is-not-a-sub/67564996">Unhandled Exception: type &#39;_InternalLinkedHashMap&lt;String, dynamic&gt;&#39; is not a subtype of type &#39;Iterable&lt;dynamic&gt;&#39; flutter</a></p>