title: Flutter: best way to save large data amounts
body: <p>My app allows users to create templates and draft documents. Each document/ template is an instance of a class which itself consists of some Strings and a List of sections.  Sections also consist of strings, DateTime class objects and can include a File representing an image taken from a user's photos or a user generated sketch.  There is currently no limit on the size of a document/ template (if I put one in it will be as large as possible) or the number of documents/ templates and I anticipate that some users may have fairly large amounts of data.</p>
  <p>I need to store this data on the device as the user creates it so that it can be retrieved in new sessions.  For premium users I will also allow them to back the data up off device (using Firebase) so that it can be retrieved from multiple devices and in case the main device is lost or damaged etc.</p>
  <p>My question is the best way to store that data and how to do that.  Flutter offers Preferences, Text Files and SQLite while Firebase cloud storage seems to offer the ability to store JSON documents.</p>
  <p>A document has the following structure:</p>
  <pre><code>DocDraft newDraft = new DocDraft(
      type: String,
      name: String,
      content: List&lt;Section&gt;,
      dateCreated: DateTime,
      dateEdited: DateTime,
    );
  </code></pre>
  <p>and the Section class is as follows:</p>
  <pre><code>  Section(
        sType: String,
        sLabel: String,
        sText: String,
        sFile: File,);
  </code></pre>
  <p>Templates are similar to Documents but simpler as they don't have DateTimes or Files.</p>
  <p>Both Documents and Templates are currently stored in Lists within my app.</p>
  <p>Any advice on the best way to store/ retrieve such data within the app and across to Firebase would be much appreciated as would any guidance on how to do this.</p>
  <p>Thanks for your help.</p>