JsField<T, V>.ins constructor

JsField<T, V>.ins({
  1. V get(
    1. T
    )?,
  2. dynamic set(
    1. T,
    2. V
    )?,
})

New a instance field

Implementation

JsField.ins({
  V Function(T)? get,
  Function(T, V)? set,
}) : isStatic = false,
      assert(get != null || set != null),
      getter = (get == null ? null : (obj, __) => get(obj!)),
      setter = (set == null ? null : (obj, argv) => set(obj!, argv[0]));