convertValue<T> method

  1. @override
T? convertValue<T>(
  1. JsEvalResult jsValue
)
override

Implementation

@override
T? convertValue<T>(JsEvalResult jsValue) {
  if (T is int) {
    return int.parse(jsValue.stringResult) as T;
  } else if (T is Map || T is List) {
    return jsonDecode(jsValue.stringResult) as T?;
  } else if (T is double) {
    return double.parse(jsValue.stringResult) as T;
  } else if (T is num) {
    return num.parse(jsValue.stringResult) as T;
  }
  return jsValue.stringResult as T;
}