title: How to know whether late init has been initialized in dart(flutter)?
body: <p>I am fetching data from url in Flutter. I have a late init Map called tables. I am fetching data inside initState() function. When I first launch the app, I am getting LateInizialization error on the red screen. I want to detect whether late init is initialized and display spinner if it is not initialized. This is my code.</p>
  <pre><code>class TablesTab extends StatefulWidget {
    @override
    _TablesTabState createState() =&gt; _TablesTabState();
  }
  
  class _TablesTabState extends State&lt;TablesTab&gt; {
    late List&lt;dynamic&gt; tables;
    var refreshKey = GlobalKey&lt;RefreshIndicatorState&gt;();
    GetUriData tablesInstance = new GetUriData(url: '/api/table/getAllTables');
  
    void getTables() async {
      tables = await tablesInstance.getData();
    }
  
    @override
    void initState() {
      super.initState();
      getTables();
    }
  
    Future&lt;void&gt; refreshList() async {
      refreshKey.currentState?.show(atTop: false);
      // await Future.delayed(Duration(seconds: 2));
      var updatedTables = await tablesInstance.getData();
      setState(() {
        tables = updatedTables;
      });
  
      //network call and setState so that view will render the new values
      print(tables);
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: RefreshIndicator(
            child:  GridView.count(
              crossAxisCount: 4,
              children: List.generate(this.tables.length, (index) {
                return Center(
                  child: GestureDetector(
                    onTap: () {
                      Navigator.pushNamed(context, '/tableReview', arguments: {'table': this.tables[index]});
                    },
                    child: Container(
                        width: 80,
                        height: 80,
                        decoration: BoxDecoration(
                            border: Border.all(color: Theme.of(context).primaryColor, width: 2.0),
                            borderRadius: BorderRadius.all(Radius.circular(70))
                        ),
                        padding: const EdgeInsets.all(14.0),
                        child: Column(
                          mainAxisAlignment: MainAxisAlignment.center,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: [
                            Text(
                              '${this.tables[index]['tableNum']}',
                              style: TextStyle(
                                  color: Theme.of(context).primaryColor,
                                  fontSize: 23
                              ),
                            ),
                          ],
                        )
                    ),
                  ),
                );
              }),
            ),
            onRefresh: refreshList
        )
      );
    }
  </code></pre>