build method

  1. @override
Widget build(
  1. BuildContext context,
  2. LegendState legendState,
  3. Legend legend, {
  4. bool showMeasures = false,
})
inherited

Implementation

@override
Widget build(
  BuildContext context,
  common.LegendState legendState,
  common.Legend legend, {
  bool showMeasures = false,
}) {
  final entryWidgets = legendState.legendEntries.map((entry) {
    var isHidden = false;
    if (legend is common.SeriesLegend) {
      isHidden = legend.isSeriesHidden(entry.series.id);
    }

    return legendEntryLayout.build(
      context,
      entry,
      legend as TappableLegend,
      isHidden,
      showMeasures: showMeasures,
    );
  }).toList();

  return legendLayout.build(context, entryWidgets);
}