notus 1.0.0-dev.10.0 copy "notus: ^1.0.0-dev.10.0" to clipboard
notus: ^1.0.0-dev.10.0 copied to clipboard

outdated

Platform-agnostic rich text document model based on Delta format and used in Zefyr editor.

example/main.dart

// Copyright (c) 2018, the Zefyr project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:notus/notus.dart';

void main() {
  final doc = NotusDocument();
  // Modify this document with insert, delete and format operations
  doc.insert(
      0, 'Notus package provides rich text document model for Zefyr editor');
  doc.format(0, 5, NotusAttribute.bold); // Makes first word bold.
  doc.format(0, 0, NotusAttribute.h1); // Makes first line a heading.
  doc.delete(23, 10); // Deletes "rich text " segment.

  // Collects style attributes at 1 character in this document.
  doc.collectStyle(1, 0); // returned style would include "bold" and "h1".

  // Listen to all changes applied to this document.
  doc.changes.listen((change) {
    print(change);
  });

  // Dispose resources allocated by this document, e.g. closes "changes" stream.
  // After document is closed it cannot be modified.
  doc.close();
}
9
likes
0
pub points
76%
popularity

Publisher

verified publishermemspace.app

Platform-agnostic rich text document model based on Delta format and used in Zefyr editor.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, coverage, quill_delta, quiver

More

Packages that depend on notus