toOptionsJSON method

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

Implementation

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

  if (align != null) {
    buffer.writeAll(['"align":', jsonEncode(align), ','], '');
  }
  if (backgroundColor != null) {
    buffer.writeAll(
        ['"backgroundColor":', jsonEncode(backgroundColor), ','], '');
  }
  if (borderColor != null) {
    buffer.writeAll(['"borderColor":', jsonEncode(borderColor), ','], '');
  }
  if (borderRadius != null) {
    buffer.writeAll(['"borderRadius":', borderRadius, ','], '');
  }
  if (borderWidth != null) {
    buffer.writeAll(['"borderWidth":', borderWidth, ','], '');
  }
  if (enabled != null) {
    buffer.writeAll(['"enabled":', enabled, ','], '');
  }
  if (format != null) {
    buffer.writeAll(['"format":', jsonEncode(format), ','], '');
  }
  if (formatter != null) {
    buffer.writeAll(['"formatter":', jsonEncode(formatter), ','], '');
  }
  if (padding != null) {
    buffer.writeAll(['"padding":', padding, ','], '');
  }
  if (shape != null) {
    buffer.writeAll(['"shape":', jsonEncode(shape), ','], '');
  }
  if (style != null) {
    buffer.write('"style":{');
    for (var item in style!.entries) {
      buffer.writeAll(['"', item.key, '":', jsonEncode(item.value), ','], '');
    }
    buffer.write('},');
  }
}