setContent method

Future<Map?> setContent(
  1. String content,
  2. bool commit
)

Sets the content of the resource. content New content of the resource. Only resources with the text type are currently supported. commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource. returns A function called upon request completion.

Implementation

Future<Map?> setContent(
  String content,
  bool commit,
) {
  var $completer = Completer<Map?>();
  _wrapped.setContent(
    content,
    commit,
    (JSAny? error) {
      if (checkRuntimeLastError($completer)) {
        $completer.complete(error?.toDartMap());
      }
    }.toJS,
  );
  return $completer.future;
}