onWidgetResizeJS method

Future<void> onWidgetResizeJS(
  1. JavaScriptMessage message
)

Implementation

Future<void> onWidgetResizeJS(JavaScriptMessage message) async {
  // print("onWidgetResizeJS : ${message.message}");
  try {
    Map<String, dynamic> data = jsonDecode(message.message);
    double height = double.parse(data['height'].toString());
    if (this.widget.onWidgetResize != null) this.widget.onWidgetResize!(height);
  } catch (e) {
    print("Error parsing JSON: $e");
  }
}