title: Null check operator used on a null value - Flutter
body: <p>I was trying to make a google drive app that lists files from the drive. but I got Null check operator used on a null value error. I got it what's happening. but I could not solve it.</p>
  <pre><code> @override
    Widget build(BuildContext context) {
      return Scaffold(
           body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              TextButton(
                onPressed: () {},
                child: Text('UPLOAD'),
              ),
              if (list != null)
                SizedBox(
                  height: 300,
                  width: double.infinity,
                  child: ListView.builder(
                    shrinkWrap: true,
                    itemCount: list!.files?.length,
                    itemBuilder: (context, index) {
                      final title = list!.files![index].originalFilename;
                      return ListTile(
                        leading: Text(title!),
                        trailing: ElevatedButton(
                          child: Text('Download'),
                          onPressed: () {
                          },
                        ),
                      );
                    },
                  ),
                )
            ],
          ),
        ),
        floatingActionButton: Row(
          children: [
            FloatingActionButton(
              onPressed: _listGoogleDriveFiles,
              child: Icon(Icons.photo),
            ),
            FloatingActionButton(
              onPressed: _incrementCounter,
              tooltip: 'Increment',
              child: const Icon(Icons.add),
            ),
          ],
        ),
      );
    }
  }
  
  
  </code></pre>
  <p>When I run it upload text is showing and the error is showing below the text. So error must be due to list is null. but I just want to show the list only if it is not null.</p>
  <p>What to do?</p>