notus 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 92

Notus is a rich text document model for Zefyr project.

This package is currently in early preview. If you found a bug or have a feature request, please file it at the issue tracker.

Zefyr provides a lightweight and user friendly rich text editor for Flutter framework.

For documentation, please see the main Zefyr repository.

Notus is a generic Dart package and does not depend on Flutter in any way. It can be used on any platform supported by the Dart language: web, server (mac, linux, windows) and, of course, mobile (android and ios).

0.1.4 #

  • Fixed insertion of embeds when selection is not empty (#115)

0.1.3 #

  • Fixed handling of user input around embeds
  • Added new heuristic rule to preserve block style on paste

0.1.2 #

  • Upgraded dependency on quiver_hashcode to 2.0.0

0.1.1 #

  • Added meta package to dependencies
  • Fixed analysis warnings
  • Added example

0.1.0 #

  • Initial release

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 = new 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();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  notus: ^0.1.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:notus/notus.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
87
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
92
Learn more about scoring.

We analyzed this package on Oct 23, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:notus/notus.dart.

Health suggestions

Fix lib/src/convert/markdown.dart. (-1.49 points)

Analysis of lib/src/convert/markdown.dart reported 3 hints:

line 160 col 18: Use = to separate a named parameter from its default value.

line 185 col 18: Use = to separate a named parameter from its default value.

line 199 col 18: Use = to separate a named parameter from its default value.

Fix lib/src/document/line.dart. (-1 points)

Analysis of lib/src/document/line.dart reported 2 hints:

line 42 col 9: DO use curly braces for all flow control structures.

line 297 col 7: DO use curly braces for all flow control structures.

Fix lib/src/document/attributes.dart. (-0.50 points)

Analysis of lib/src/document/attributes.dart reported 1 hint:

line 127 col 7: DO use curly braces for all flow control structures.

Fix additional 3 files with analysis or formatting issues. (-1.50 points)

Additional issues in the following files:

  • lib/src/document/node.dart (1 hint)
  • lib/src/heuristics/format_rules.dart (1 hint)
  • lib/src/heuristics/insert_rules.dart (1 hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
collection ^1.14.6 1.14.12
meta ^1.1.0 1.1.7
quill_delta ^1.0.0 1.0.0
quiver_hashcode ^2.0.0 2.0.0
Dev dependencies
test ^1.0.0
test_coverage ^0.2.1