setExtra2 method

void setExtra2(
  1. List<Color> colors,
  2. List<String> labels
)

Entries that will be appended to the end of the auto calculated entries after calculating the legend. (if the legend has already been calculated, you will need to call notifyDataSetChanged() to let the changes take effect)

Implementation

void setExtra2(List<Color> colors, List<String> labels) {
  List<LegendEntry> entries = List.empty(growable: true);
  for (int i = 0; i < min(colors.length, labels.length); i++) {
    final LegendEntry entry = LegendEntry.empty();
    entry.formColor = colors[i];
    entry.label = labels[i];

    if (entry.formColor == ColorUtils.colorSkip) {
      entry.form = LegendForm.none;
    } else if (entry.formColor == ColorUtils.colorNone) {
      entry.form = LegendForm.empty;
    }

    entries.add(entry);
  }

  _extraEntries = entries;
}