addData method

void addData(
  1. String word,
  2. double value
)

Implementation

void addData(String word, double value) {
  data.add({'word': word, 'value': value});
  data = (data..sort((a, b) => a['value'].compareTo(b['value'])))
      .reversed
      .toList();
}