title: How to save List<List<Object>> list to Shared Preferences Flutter
body: <p>I have this list:</p>
  <pre><code>List&lt;List&lt;GraphInfo&gt;&gt; list = [
    [
      GraphInfo(title: 'Graph 1', xAxis: &quot;10&quot;, yAxis: &quot;15&quot;),
      GraphInfo(title: 'Graph 1', xAxis: &quot;15&quot;, yAxis: &quot;20&quot;),
    ],
    [
      GraphInfo(title: 'Graph 2', xAxis: &quot;20&quot;, yAxis: &quot;20&quot;),
      GraphInfo(title: 'Graph 2', xAxis: &quot;25&quot;, yAxis: &quot;25&quot;),
    ],
  ];
  </code></pre>
  <p> Which I need to display a graph in my app (and it has to be a List inside a List).
  <p>And I need to find a way to save the list locally.
  <p>I have tried using <b>Sqlite, Hive and Shared Preferences</b> but no luck, as it is difficult to persist a List with a custom object.
  <p> GraphInfo class:
  <pre><code>class GraphInfo {
    int? id;
    String title;
    String xAxis;
    String yAxis;
  
    GraphInfo({
      this.id,
      required this.title,
      required this.xAxis,
      required this.yAxis,
    });
  
    factory GraphInfo.fromJson(Map&lt;String, dynamic&gt; json) {
      return GraphInfo(
          id: json[&quot;id&quot;],
          title: json[&quot;title&quot;],
          xAxis: json[&quot;xAxis&quot;],
          yAxis: json[&quot;yAxis&quot;]);
    }
  
    factory GraphInfo.fromMap(Map&lt;String, dynamic&gt; map) =&gt; GraphInfo(
          id: map[&quot;id&quot;]?.toInt() ?? 0,
          title: map[&quot;title&quot;] ?? '',
          xAxis: map[&quot;xAxis&quot;] ?? '',
          yAxis: map[&quot;yAxis&quot;] ?? '',
        );
    Map&lt;String, dynamic&gt; toJson() {
      return {
        &quot;id&quot;: id,
        &quot;title&quot;: title,
        &quot;xAxis&quot;: xAxis,
        &quot;yAxis&quot;: yAxis,
      };
    }
  
    @override
    String toString() =&gt; '{name: $title, x: $xAxis, y: $yAxis}';
  }
  </code></pre>
  <p>Does anyone have any ideas to save this list? (They can include Sqlite, Hive and Shared Preferences).
  <p>Please do not hesitate to enquire further.
  Thanks!