collectG<G extends BotData> method

void collectG<G extends BotData>(
  1. G data, {
  2. required String identifier,
})

Collect other types of chatbot data into the collector.

  • {data} is the data instance to be collected.

  • {identifier} is the identifier of the data. This is used to identify the data when you want to get it back.

  • {G} is the type of the data. This can be any type that extends BotData.

This method should only be used for data that is not a bot, intent, or object or if you want to collect more than one bot at a time. It requires you to specify and memorize the identifier of the data.

Implementation

void collectG<G extends BotData>(G data, {required String identifier}) {
  _generals[identifier] = data;
}