|
|
|
|
2
|
|
2
|
|
3
|
Zefyr project consists of two packages:
|
3
|
Zefyr project consists of two packages:
|
4
|
|
4
|
|
5
|
-1. [zefyr](https://pub.dev/packages/zefyr) - Flutter package which provides the UI part.
|
|
|
6
|
-2. [notus](https://pub.dev/packages/notus) - platform-agnostic package which provides document model used in Zefyr editor.
|
|
|
|
|
5
|
+1. [zefyr](https://pub.dev/packages/zefyr) - Flutter package which provides all necessary UI widgets
|
|
|
6
|
+2. [notus](https://pub.dev/packages/notus) - package containing document model used by `zefyr` package. `notus` package is platform-agnostic and can be used outside of Flutter apps (web or server-side Dart projects).
|
7
|
|
7
|
|
8
|
### Installation
|
8
|
### Installation
|
9
|
|
9
|
|
10
|
-> We assume that you already installed [Flutter](https://flutter.dev/docs/get-started/install) and created a [project](https://flutter.dev/docs/get-started/test-drive).
|
|
|
|
|
10
|
+Before installing Zefyr make sure that you installed [Flutter](https://flutter.dev/docs/get-started/install)
|
|
|
11
|
+and created a [project](https://flutter.dev/docs/get-started/test-drive).
|
11
|
|
12
|
|
12
|
Add `zefyr` package as a dependency to `pubspec.yaml` of your project:
|
13
|
Add `zefyr` package as a dependency to `pubspec.yaml` of your project:
|
13
|
|
14
|
|
|
|
|
|
109
|
```
|
110
|
```
|
110
|
|
111
|
|
111
|
> Notice that we pass `BuildContext` to `_saveDocument`. This is required
|
112
|
> Notice that we pass `BuildContext` to `_saveDocument`. This is required
|
112
|
-> to get access to our page's `Scaffold` state, so that we can show `SnackBar`.
|
|
|
|
|
113
|
+> to get access to our page's `Scaffold` state, so that we can show a `SnackBar`.
|
113
|
|
114
|
|
114
|
Now we just need to add a button to the AppBar, so we need to modify `build`
|
115
|
Now we just need to add a button to the AppBar, so we need to modify `build`
|
115
|
method as follows:
|
116
|
method as follows:
|
|
|
|
|
117
|
```dart
|
118
|
```dart
|
118
|
class EditorPageState extends State<EditorPage> {
|
119
|
class EditorPageState extends State<EditorPage> {
|
119
|
|
120
|
|
120
|
- // ... replace build method with following
|
|
|
|
|
121
|
+ // ... replace build() method with following
|
121
|
|
122
|
|
122
|
@override
|
123
|
@override
|
123
|
Widget build(BuildContext context) {
|
124
|
Widget build(BuildContext context) {
|