createElementOptions method

JsElementsCreateOptions createElementOptions()

Implementation

js.JsElementsCreateOptions createElementOptions() {
  final textColor = widget.style?.textColor == null
      ? null
      : colorToCssString(widget.style!.textColor!);
  final backgroundColor = widget.style?.backgroundColor == null
      ? null
      : colorToCssString(widget.style!.backgroundColor!);
  return js.JsElementsCreateOptions(
    appearance:
        js.ElementAppearance(
              theme: js.ElementTheme.stripe,
              variables: {
                'colorText': ?textColor,
                'colorBackground': ?backgroundColor,
              },
            ).toJson().jsify()
            as js.JsElementAppearance,
  );
}