toOptionsJSON method

  1. @override
void toOptionsJSON(
  1. StringBuffer buffer
)
override

Implementation

@override
void toOptionsJSON(StringBuffer buffer) {
  super.toOptionsJSON(buffer);

  if (events != null) {
    buffer.write('"events":{');
    for (var item in events!.entries) {
      buffer.writeAll(['"', item.key, '":', jsonEncode(item.value), ','], '');
    }
    buffer.write('},');
  }
  if (height != null) {
    buffer.writeAll(['"height":', height, ','], '');
  }
  if (positioner != null) {
    buffer.writeAll(['"positioner":', positioner?.toJSON(), ','], '');
  }
  if (style != null) {
    buffer.writeAll(['"style":', style?.toJSON(), ','], '');
  }
  if (symbol != null) {
    buffer.writeAll(['"symbol":', jsonEncode(symbol), ','], '');
  }
  if (visible != null) {
    buffer.writeAll(['"visible":', visible, ','], '');
  }
  if (width != null) {
    buffer.writeAll(['"width":', width, ','], '');
  }
}