title: Flutter - Future<List<Widget>> on FutureBuilder
body: <p>below I put a simplification of a code I wrote.
  I have removed a part of the tool() function because it is not important for the purpose of this question.</p>
  <p>I would like the List OutputRow to appear as children of the Wrap() inside the FutureBuilder.</p>
  <p>Currently it gives me this error: type 'List ' is not a subtype of type 'List '.</p>
  <p>Anyone know how I can fix it?</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:language_tool/language_tool.dart';
  
  void main() =&gt; runApp(mainApp());
  
  class mainApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return const MaterialApp(
        home: Chat(),
      );
    }
  }
  
  class Chat extends StatefulWidget {
    const Chat({Key? key}) : super(key: key);
  
    @override
    _ChatState createState() =&gt; _ChatState();
  }
  
  class _ChatState extends State&lt;Chat&gt; {
    String text = 'Henlo. I am Gabriele. I am 21 yers old!';
  
    Future&lt;List&gt; tool(String text) async {
      var tool = LanguageTool();
      var result = tool.check(text);
      var correction = await result;
  
      // code simplification {...}
  
      List OutputList = [
        '',
        'Henlo',
        '. I am Gabriele. I am 21 ',
        'yers',
        ' old!'
      ];
      List OutputBool = [false, true, false, true, false];
      List OutputIndex = [0, 1, 2, 3, 4];
  
      List OutputRow = [];
  
      for (int i in OutputIndex) {
        if (OutputBool[i] == false) {
          OutputRow.add(
            Container(
              child: Text(
                OutputList[i],
                style: TextStyle(fontSize: 18.0),
              ),
            ),
          );
        } else if (OutputBool[i] == true) {
          OutputRow.add(
            Container(
              child: GestureDetector(
                onTap: () {},
                child: Container(
                  color: Colors.orange,
                  child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Text(
                      OutputList[i],
                      style: TextStyle(fontSize: 18.0),
                    ),
                  ),
                ),
              ),
            ),
          );
        }
      }
  
      print(OutputRow);
      return OutputRow;
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: SafeArea(
          child: FutureBuilder(
              future: tool(text),
              builder: (BuildContext context, AsyncSnapshot snapshot) {
                if (snapshot.data == null) {
                  return Center(
                    child: Text('Loading...'),
                  );
                } else {
                  return Wrap(
                    crossAxisAlignment: WrapCrossAlignment.center,
                    runSpacing: 4.0,
                    children: snapshot.data,
                  );
                }
              }),
        ),
      );
    }
  }
  
  </code></pre>
  <p>I hope it is clear.</p>
  <p>Thanks :)</p>