title: Call multiple different charts in flutter - charts_flutter 0.5.0 Package
body: <p>I have this Simple Bar chart from the package charts_flutter 0.5.0 and i want to call it in another page like this, or what my goal is, is to get more charts into it like pie charts and some other once.</p>
  
  <pre><code> Widget build(BuildContext context) {
  
      List&lt;Series&gt; seriesList;
  
      return Scaffold(
        appBar: AppBar(
          elevation: 0,
          title: Text(
            "Charts",
            style: TextStyle(color: Colors.blueGrey),
            textAlign: TextAlign.center,
          ),
          backgroundColor: Colors.transparent,
          iconTheme: IconThemeData(color: Colors.blueGrey),
        ),
        body: ListView(
          children: &lt;Widget&gt;[
            SimpleBarChart(seriesList), //&lt;-- I've added this line
          ],
        ),
      );
    }
  </code></pre>
  
  <p>the code of the chart is this: find more here: <a href="https://google.github.io/charts/flutter/gallery.html" rel="nofollow noreferrer">https://google.github.io/charts/flutter/gallery.html</a></p>
  
  <pre><code>/// Bar chart example
  import 'package:charts_flutter/flutter.dart' as charts;
  import 'package:flutter/material.dart';
  
  class SimpleBarChart extends StatelessWidget {
    final List&lt;charts.Series&gt; seriesList;
    final bool animate;
  
    SimpleBarChart(this.seriesList, {this.animate});
  
    /// Creates a [BarChart] with sample data and no transition.
    factory SimpleBarChart.withSampleData() {
      return new SimpleBarChart(
        _createSampleData(),
        // Disable animations for image tests.
        animate: false,
      );
    }
  
  
    @override
    Widget build(BuildContext context) {
      return new charts.BarChart(
        seriesList,
        animate: animate,
      );
    }
  
    /// Create one series with sample hard coded data.
    static List&lt;charts.Series&lt;OrdinalSales, String&gt;&gt; _createSampleData() {
      final data = [
        new OrdinalSales('2014', 5),
        new OrdinalSales('2015', 25),
        new OrdinalSales('2016', 100),
        new OrdinalSales('2017', 75),
      ];
  
      return [
        new charts.Series&lt;OrdinalSales, String&gt;(
          id: 'Sales',
          colorFn: (_, __) =&gt; charts.MaterialPalette.blue.shadeDefault,
          domainFn: (OrdinalSales sales, _) =&gt; sales.year,
          measureFn: (OrdinalSales sales, _) =&gt; sales.sales,
          data: data,
        )
      ];
    }
  }
  
  /// Sample ordinal data type.
  class OrdinalSales {
    final String year;
    final int sales;
  
    OrdinalSales(this.year, this.sales);
  }
  </code></pre>
  
  <p>Currently I'm getting a white page, with this error</p>
  
  <p>E/flutter (14450): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:</p>
  
  <p>E/flutter (14450): Cannot hit test a render box that has never been laid out.</p>
  
  <p>E/flutter (14450): The hitTest() method was called on this RenderBox:</p>
  
  <p>E/flutter (14450):   RenderErrorBox#20cd4 NEEDS-LAYOUT NEEDS-PAINT</p>
  
  <p>E/flutter (14450): Unfortunately, this object's geometry is not known at this time, probably because it has never been laid out. This means it cannot be accurately hit-tested. If you are trying to perform a hit test during the layout phase itself, make sure you only hit test nodes that have completed layout (e.g. the node's children, after their layout() method has been called).</p>
  
  <p>this is the Package: <a href="https://pub.dartlang.org/packages/charts_flutter#-readme-tab-" rel="nofollow noreferrer">https://pub.dartlang.org/packages/charts_flutter#-readme-tab-</a></p>