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).
meta
package to dependencies.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();
}
Add this to your package's pubspec.yaml file:
dependencies:
notus: ^0.1.3
You can install packages from the command line:
with pub:
$ pub get
with Flutter:
$ flutter packages get
Alternatively, your editor might support pub get
or flutter packages get
.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:notus/notus.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.1.3 | Oct 22, 2018 |
|
|
0.1.2 | Aug 29, 2018 |
|
|
0.1.1 | Jul 24, 2018 |
|
|
0.1.0 | Jul 15, 2018 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
67
|
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]
|
82
|
We analyzed this package on Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, web, other
No platform restriction found in primary library
package:notus/notus.dart
.
Fix lib/src/heuristics/insert_rules.dart
. (-1.99 points)
Analysis of lib/src/heuristics/insert_rules.dart
reported 4 hints:
line 51 col 9: Use contains instead of indexOf
line 90 col 28: Don't explicitly initialize variables to null.
line 293 col 26: Don't explicitly initialize variables to null.
line 294 col 26: Don't explicitly initialize variables to null.
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/node.dart
. (-0.50 points)
Analysis of lib/src/document/node.dart
reported 1 hint:
line 210 col 50: Use =
to separate a named parameter from its default value.
Fix lib/src/heuristics/format_rules.dart
. (-0.50 points)
Analysis of lib/src/heuristics/format_rules.dart
reported 1 hint:
line 203 col 9: Use contains instead of indexOf
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=2.0.0-dev.58.0 <3.0.0 | ||
collection | ^1.14.6 | 1.14.11 | |
meta | ^1.1.0 | 1.1.7 | |
quill_delta | ^1.0.0-dev | 1.0.0-dev.4.0 | |
quiver_hashcode | ^2.0.0 | 2.0.0 | |
Dev dependencies | |||
test | ^1.0.0 | ||
test_coverage | ^0.2.1 |