title: Cache two Lists in flutter
body: <p>I want to cache two lists that got from Firebase to use to later when the user is offline</p>
  
  <p>This is the full code for my list display screen - </p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  import 'package:naamaa/calculations/name-list-calc.dart';
  
  List namesList = List();
  List meaningsList = List();
  
  class NameList extends StatefulWidget {
    @override
    _NameListState createState() =&gt; _NameListState();
  }
  
  class _NameListState extends State&lt;NameList&gt; {
    Future&lt;String&gt; getPosts() async {
      var names = await NameListCalc().nameListCalc();
      namesList.addAll(names[0]);
      meaningsList.addAll(names[1]);
      String s = 'test';
      return s;
    }
  
    @override
    Widget build(BuildContext context) {
      return FutureBuilder&lt;String&gt;(
        future: getPosts(),
        builder: (context, snapshot) {
          if (snapshot.hasData) {
            return Scaffold(
              resizeToAvoidBottomPadding: false,
              body: ListView.builder(
                padding: EdgeInsets.zero,
                itemBuilder: (context, position) {
                  return Row(
                    children: &lt;Widget&gt;[
                      Container(
                        width: 100,
                        child: Text(namesList[position]),
                      ),
                      Container(
                        child: Text(meaningsList[position]),
                      )
                    ],
                  );
                },
                itemCount: namesList.length,
              ),
            );
          } else {
            return Text(':(');
          }
        },
      );
    }
  }
  </code></pre>
  
  <p>I want to cache namesList and meaningsList for later use.</p>
  
  <p>If someone can help it would be great :)</p>