setString method

  1. @VoltronMethod(kSetStringMethodName)
bool setString(
  1. String text,
  2. JSPromise promise
)

Implementation

@VoltronMethod(kSetStringMethodName)
bool setString(String text, JSPromise promise) {
  Clipboard.setData(ClipboardData(text: text)).then((data) {
    promise.resolve(text);
  }).catchError((err) {
    LogUtils.d(kTag, err.toString());
    promise.reject(err.toString());
  });
  return true;
}