Anatoly Pulyaevskiy vor 6 Jahren
Ursprung
Commit
e1402c8d1b
2 geänderte Dateien mit 11 neuen und 5 gelöschten Zeilen
  1. 1
    0
      .gitignore
  2. 10
    5
      doc/quick_start.md

+ 1
- 0
.gitignore Datei anzeigen

@@ -0,0 +1 @@
1
+.idea/

+ 10
- 5
doc/quick_start.md Datei anzeigen

@@ -12,7 +12,7 @@ Add `zefyr` package as a dependency to your `pubspec.yaml`:
12 12
 
13 13
 ```yaml
14 14
 dependencies:
15
-  zefyr: ^0.1.0
15
+  zefyr: ^0.3.0
16 16
 ```
17 17
 
18 18
 And run `flutter packages get` to install. This installs both `zefyr`
@@ -20,7 +20,7 @@ and `notus` packages.
20 20
 
21 21
 ### Usage
22 22
 
23
-There are 3 main objects you would normally interact with in your code:
23
+There are 4 main objects you would normally interact with in your code:
24 24
 
25 25
 * `NotusDocument`, represents a rich text document and provides
26 26
   high-level methods for manipulating the document's state, like
@@ -30,6 +30,9 @@ There are 3 main objects you would normally interact with in your code:
30 30
 * `ZefyrEditor`, a Flutter widget responsible for rendering of rich text
31 31
   on the screen and reacting to user actions.
32 32
 * `ZefyrController`, ties the above two objects together.
33
+* `ZefyrScaffold`, allows embedding Zefyr toolbar into any custom layout.
34
+
35
+`ZefyrEditor` depends on presence of `ZefyrScaffold` somewhere up the widget tree.
33 36
 
34 37
 Normally you would need to place `ZefyrEditor` inside of a
35 38
 `StatefulWidget`. Shown below is a minimal setup required to use the
@@ -60,9 +63,11 @@ class MyWidgetState extends State<MyWidget> {
60 63
 
61 64
   @override
62 65
   Widget build(BuildContext context) {
63
-    return ZefyrEditor(
64
-      controller: _controller,
65
-      focusNode: _focusNode,
66
+    return ZefyrScaffold(
67
+      child: ZefyrEditor(
68
+        controller: _controller,
69
+        focusNode: _focusNode,
70
+      ),
66 71
     );
67 72
   }
68 73
 }