addSymbols method

Future<List<Symbol>> addSymbols(
  1. List<SymbolOptions> options, [
  2. List<Map>? data
])

Adds multiple symbols to the map, configured using the specified custom options.

Change listeners are notified once the symbol has been added on the platform side.

The returned Future completes with the added symbol once listeners have been notified.

Implementation

Future<List<Symbol>> addSymbols(List<SymbolOptions> options,
    [List<Map>? data]) async {
  final symbols = [
    for (var i = 0; i < options.length; i++)
      Symbol(getRandomString(),
          SymbolOptions.defaultOptions.copyWith(options[i]), data?[i])
  ];
  await symbolManager!.addAll(symbols);

  notifyListeners();
  return symbols;
}