Browse Source

update ui

lucky1213 4 years ago
parent
commit
2090b17c2b

+ 3
- 0
README.md View File

@@ -12,6 +12,9 @@ For questions and general discussions check out our
12 12
 
13 13
 [issue tracker]: https://github.com/memspace/zefyr/issues
14 14
 
15
+## PhotoManager
16
+请检查配置,相册预览使用了[PhotoManager](https://github.com/CaiJingLong/flutter_photo_manager/blob/master/README.md)
17
+
15 18
 ## Clean and modern look
16 19
 
17 20
 Zefyr's rich text editor is built with simplicity and flexibility in

+ 5
- 4
packages/zefyr/example/ios/Flutter/flutter_export_environment.sh View File

@@ -1,11 +1,12 @@
1 1
 #!/bin/sh
2 2
 # This is a generated file; do not edit or check into version control.
3
-export "FLUTTER_ROOT=/Users/anatoly/Projects/flutter"
4
-export "FLUTTER_APPLICATION_PATH=/Users/anatoly/Projects/zefyr/packages/zefyr/example"
5
-export "FLUTTER_TARGET=/Users/anatoly/Projects/zefyr/packages/zefyr/example/lib/main.dart"
3
+export "FLUTTER_ROOT=/Users/imac/.fvm/versions/latest-dev"
4
+export "FLUTTER_APPLICATION_PATH=/Users/imac/Documents/flutter/projects/zefyr/packages/zefyr/example"
5
+export "FLUTTER_TARGET=/Users/imac/Documents/flutter/projects/zefyr/packages/zefyr/example/lib/main.dart"
6 6
 export "FLUTTER_BUILD_DIR=build"
7 7
 export "SYMROOT=${SOURCE_ROOT}/../build/ios"
8
-export "FLUTTER_FRAMEWORK_DIR=/Users/anatoly/Projects/flutter/bin/cache/artifacts/engine/ios"
8
+export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
9
+export "FLUTTER_FRAMEWORK_DIR=/Users/imac/.fvm/versions/latest-dev/bin/cache/artifacts/engine/ios"
9 10
 export "FLUTTER_BUILD_NAME=1.0.0"
10 11
 export "FLUTTER_BUILD_NUMBER=1"
11 12
 export "TRACK_WIDGET_CREATION=true"

+ 1
- 1
packages/zefyr/example/ios/Podfile View File

@@ -1,5 +1,5 @@
1 1
 # Uncomment this line to define a global platform for your project
2
-# platform :ios, '9.0'
2
+platform :ios, '9.0'
3 3
 
4 4
 # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 5
 ENV['COCOAPODS_DISABLE_STATS'] = 'true'

+ 8
- 2
packages/zefyr/example/ios/Podfile.lock View File

@@ -4,6 +4,8 @@ PODS:
4 4
     - Flutter
5 5
   - image_picker (0.0.1):
6 6
     - Flutter
7
+  - photo_manager (0.0.1):
8
+    - Flutter
7 9
   - url_launcher (0.0.1):
8 10
     - Flutter
9 11
   - url_launcher_macos (0.0.1):
@@ -15,6 +17,7 @@ DEPENDENCIES:
15 17
   - Flutter (from `Flutter`)
16 18
   - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
17 19
   - image_picker (from `.symlinks/plugins/image_picker/ios`)
20
+  - photo_manager (from `.symlinks/plugins/photo_manager/ios`)
18 21
   - url_launcher (from `.symlinks/plugins/url_launcher/ios`)
19 22
   - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
20 23
   - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
@@ -26,6 +29,8 @@ EXTERNAL SOURCES:
26 29
     :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
27 30
   image_picker:
28 31
     :path: ".symlinks/plugins/image_picker/ios"
32
+  photo_manager:
33
+    :path: ".symlinks/plugins/photo_manager/ios"
29 34
   url_launcher:
30 35
     :path: ".symlinks/plugins/url_launcher/ios"
31 36
   url_launcher_macos:
@@ -37,10 +42,11 @@ SPEC CHECKSUMS:
37 42
   Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
38 43
   flutter_plugin_android_lifecycle: 47de533a02850f070f5696a623995e93eddcdb9b
39 44
   image_picker: e3eacd46b94694dde7cf2705955cece853aa1a8f
45
+  photo_manager: f7c619c2cc8c2adb8d85c63363babac477de9c67
40 46
   url_launcher: a1c0cc845906122c4784c542523d8cacbded5626
41 47
   url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
42 48
   url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
43 49
 
44
-PODFILE CHECKSUM: 3dbe063e9c90a5d7c9e4e76e70a821b9e2c1d271
50
+PODFILE CHECKSUM: 49ec7d4076524b7e225c38b98147173651ac4b9d
45 51
 
46
-COCOAPODS: 1.7.2
52
+COCOAPODS: 1.8.4

+ 7
- 13
packages/zefyr/example/ios/Runner.xcodeproj/project.pbxproj View File

@@ -9,10 +9,6 @@
9 9
 /* Begin PBXBuildFile section */
10 10
 		1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 11
 		3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12
-		3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13
-		3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
14
-		9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
15
-		9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
16 12
 		9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
17 13
 		9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
18 14
 		978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
@@ -30,8 +26,6 @@
30 26
 			dstPath = "";
31 27
 			dstSubfolderSpec = 10;
32 28
 			files = (
33
-				3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
34
-				9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
35 29
 			);
36 30
 			name = "Embed Frameworks";
37 31
 			runOnlyForDeploymentPostprocessing = 0;
@@ -43,14 +37,14 @@
43 37
 		1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
44 38
 		2BB550984C4EB178783ADADA /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
45 39
 		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
46
-		3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
47 40
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
48 41
 		7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
49 42
 		7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
43
+		8846C66824444D08002B47A3 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
44
+		8846C66924444D08002B47A3 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
50 45
 		892F13FEEEDA93A39D86B7F4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
51 46
 		9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
52 47
 		9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
53
-		9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
54 48
 		97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
55 49
 		97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
56 50
 		97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -65,8 +59,6 @@
65 59
 			isa = PBXFrameworksBuildPhase;
66 60
 			buildActionMask = 2147483647;
67 61
 			files = (
68
-				9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
69
-				3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
70 62
 				A287E1B0D09CE333E91C72F8 /* libPods-Runner.a in Frameworks */,
71 63
 			);
72 64
 			runOnlyForDeploymentPostprocessing = 0;
@@ -85,9 +77,7 @@
85 77
 		9740EEB11CF90186004384FC /* Flutter */ = {
86 78
 			isa = PBXGroup;
87 79
 			children = (
88
-				3B80C3931E831B6300D905FE /* App.framework */,
89 80
 				3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
90
-				9740EEBA1CF902C7004384FC /* Flutter.framework */,
91 81
 				9740EEB21CF90195004384FC /* Debug.xcconfig */,
92 82
 				7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
93 83
 				9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -191,8 +181,10 @@
191 181
 			developmentRegion = English;
192 182
 			hasScannedForEncodings = 0;
193 183
 			knownRegions = (
184
+				English,
194 185
 				en,
195 186
 				Base,
187
+				"zh-Hans",
196 188
 			);
197 189
 			mainGroup = 97C146E51CF9000F007C117D;
198 190
 			productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
@@ -248,7 +240,7 @@
248 240
 			);
249 241
 			runOnlyForDeploymentPostprocessing = 0;
250 242
 			shellPath = /bin/sh;
251
-			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
243
+			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
252 244
 		};
253 245
 		497F746AAAAAA284327A4563 /* [CP] Check Pods Manifest.lock */ = {
254 246
 			isa = PBXShellScriptBuildPhase;
@@ -302,6 +294,7 @@
302 294
 			isa = PBXVariantGroup;
303 295
 			children = (
304 296
 				97C146FB1CF9000F007C117D /* Base */,
297
+				8846C66824444D08002B47A3 /* zh-Hans */,
305 298
 			);
306 299
 			name = Main.storyboard;
307 300
 			sourceTree = "<group>";
@@ -310,6 +303,7 @@
310 303
 			isa = PBXVariantGroup;
311 304
 			children = (
312 305
 				97C147001CF9000F007C117D /* Base */,
306
+				8846C66924444D08002B47A3 /* zh-Hans */,
313 307
 			);
314 308
 			name = LaunchScreen.storyboard;
315 309
 			sourceTree = "<group>";

+ 0
- 8
packages/zefyr/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings View File

@@ -1,8 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
-<plist version="1.0">
4
-<dict>
5
-	<key>BuildSystemType</key>
6
-	<string>Original</string>
7
-</dict>
8
-</plist>

+ 1
- 0
packages/zefyr/example/ios/Runner/zh-Hans.lproj/LaunchScreen.strings View File

@@ -0,0 +1 @@
1
+

+ 1
- 0
packages/zefyr/example/ios/Runner/zh-Hans.lproj/Main.strings View File

@@ -0,0 +1 @@
1
+

+ 4
- 10
packages/zefyr/example/pubspec.yaml View File

@@ -20,10 +20,6 @@ dependencies:
20 20
   zefyr:
21 21
     path: ../
22 22
 
23
-dependency_overrides:
24
-  notus:
25
-    path: ../../notus
26
-
27 23
 dev_dependencies:
28 24
   flutter_test:
29 25
     sdk: flutter
@@ -55,12 +51,10 @@ flutter:
55 51
   # "family" key with the font family name, and a "fonts" key with a
56 52
   # list giving the asset and other descriptors for the font. For
57 53
   # example:
58
-  # fonts:
59
-  #   - family: Schyler
60
-  #     fonts:
61
-  #       - asset: fonts/Schyler-Regular.ttf
62
-  #       - asset: fonts/Schyler-Italic.ttf
63
-  #         style: italic
54
+  fonts:
55
+    - family: ZefyrFont
56
+      fonts:
57
+        - asset: ../lib/fonts/iconfont.ttf
64 58
   #   - family: Trajan Pro
65 59
   #     fonts:
66 60
   #       - asset: fonts/TrajanPro.ttf

BIN
packages/zefyr/lib/fonts/iconfont.ttf View File


+ 359
- 20
packages/zefyr/lib/src/widgets/buttons.dart View File

@@ -1,10 +1,15 @@
1 1
 // Copyright (c) 2018, the Zefyr project authors.  Please see the AUTHORS file
2 2
 // for details. All rights reserved. Use of this source code is governed by a
3 3
 // BSD-style license that can be found in the LICENSE file.
4
+import 'dart:io';
5
+import 'dart:typed_data';
6
+
4 7
 import 'package:flutter/material.dart';
5 8
 import 'package:flutter/services.dart';
6 9
 import 'package:notus/notus.dart';
10
+import 'package:photo_manager/photo_manager.dart';
7 11
 import 'package:url_launcher/url_launcher.dart';
12
+import 'package:zefyr/src/widgets/gallery_item.dart';
8 13
 
9 14
 import 'scope.dart';
10 15
 import 'theme.dart';
@@ -76,18 +81,18 @@ class ZefyrButton extends StatelessWidget {
76 81
         action: action,
77 82
         icon: _icon,
78 83
         size: _iconSize,
79
-        iconColor: iconColor,
80
-        color: _getColor(editor, toolbarTheme),
84
+        iconColor: _getColor(editor, toolbarTheme),
85
+        color: _getFillColor(action, toolbarTheme),
81 86
         onPressed: _getPressedHandler(editor, toolbar),
82 87
       );
83 88
     } else {
84 89
       assert(_text != null);
85 90
       var style = _textStyle ?? TextStyle();
86
-      style = style.copyWith(color: iconColor);
91
+      style = style.copyWith(color: _getColor(editor, toolbarTheme),);
87 92
       return RawZefyrButton(
88 93
         action: action,
89 94
         child: Text(_text, style: style),
90
-        color: _getColor(editor, toolbarTheme),
95
+        color: _getFillColor(action, toolbarTheme),
91 96
         onPressed: _getPressedHandler(editor, toolbar),
92 97
       );
93 98
     }
@@ -104,6 +109,13 @@ class ZefyrButton extends StatelessWidget {
104 109
     return null;
105 110
   }
106 111
 
112
+  Color _getFillColor(ZefyrToolbarAction action, ToolbarTheme theme) {
113
+    if (action == ZefyrToolbarAction.text || action == ZefyrToolbarAction.heading || action == ZefyrToolbarAction.hideKeyboard || action == ZefyrToolbarAction.emoji || action == ZefyrToolbarAction.image || action == ZefyrToolbarAction.link) {
114
+      return theme.color;
115
+    }
116
+    return theme.iconFillColor;
117
+  }
118
+
107 119
   VoidCallback _getPressedHandler(
108 120
       ZefyrScope editor, ZefyrToolbarState toolbar) {
109 121
     if (onPressed != null) {
@@ -176,12 +188,23 @@ class RawZefyrButton extends StatelessWidget {
176 188
   @override
177 189
   Widget build(BuildContext context) {
178 190
     final theme = Theme.of(context);
179
-    final width = theme.buttonTheme.constraints.minHeight + 4.0;
180 191
     final constraints = theme.buttonTheme.constraints.copyWith(
181
-        minWidth: width, maxHeight: theme.buttonTheme.constraints.minHeight);
182
-    final radius = BorderRadius.all(Radius.circular(3.0));
192
+      minWidth: 64, minHeight: 40, maxHeight: 40,
193
+    );
194
+    var radius = BorderRadius.all(Radius.circular(0));
195
+    if (action == ZefyrToolbarAction.headingLevel1 || action == ZefyrToolbarAction.bold || action == ZefyrToolbarAction.numberList) {
196
+      radius = BorderRadius.horizontal(left: Radius.circular(4));
197
+    }
198
+    if (action == ZefyrToolbarAction.headingLevel6 || action == ZefyrToolbarAction.deleteline || action == ZefyrToolbarAction.bulletList) {
199
+      radius = BorderRadius.horizontal(left: Radius.circular(4));
200
+    }
201
+    if (action == ZefyrToolbarAction.quote || action == ZefyrToolbarAction.horizontalRule || action == ZefyrToolbarAction.code) {
202
+      radius = BorderRadius.all(Radius.circular(4));
203
+    }
183 204
     return Padding(
184
-      padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 6.0),
205
+      padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 6.0).copyWith(
206
+        left: action == ZefyrToolbarAction.code || action == ZefyrToolbarAction.quote ? 12.0 : 1.0,
207
+      ),
185 208
       child: RawMaterialButton(
186 209
         shape: RoundedRectangleBorder(borderRadius: radius),
187 210
         elevation: 0.0,
@@ -221,17 +244,180 @@ class _HeadingButtonState extends State<HeadingButton> {
221 244
     toolbar.showOverlay(buildOverlay);
222 245
   }
223 246
 
247
+  Widget _buildButtonsView(List<Widget> buttons) {
248
+    return Container(
249
+      height: 52,
250
+      child: ListView(
251
+        scrollDirection: Axis.horizontal,
252
+        children: buttons,
253
+        physics: ClampingScrollPhysics(),
254
+      ),
255
+    );
256
+  }
257
+
224 258
   Widget buildOverlay(BuildContext context) {
259
+    final theme = ZefyrTheme.of(context).toolbarTheme;
225 260
     final toolbar = ZefyrToolbar.of(context);
226
-    final buttons = Row(
227
-      children: <Widget>[
228
-        SizedBox(width: 8.0),
229
-        toolbar.buildButton(context, ZefyrToolbarAction.headingLevel1),
230
-        toolbar.buildButton(context, ZefyrToolbarAction.headingLevel2),
231
-        toolbar.buildButton(context, ZefyrToolbarAction.headingLevel3),
232
-      ],
261
+    final headingButtons = <Widget>[
262
+      toolbar.buildButton(context, ZefyrToolbarAction.headingLevel1),
263
+      toolbar.buildButton(context, ZefyrToolbarAction.headingLevel2),
264
+      toolbar.buildButton(context, ZefyrToolbarAction.headingLevel3),
265
+      toolbar.buildButton(context, ZefyrToolbarAction.headingLevel4),
266
+      toolbar.buildButton(context, ZefyrToolbarAction.headingLevel5),
267
+      toolbar.buildButton(context, ZefyrToolbarAction.headingLevel6),
268
+    ];
269
+    final textButtons = <Widget>[
270
+      toolbar.buildButton(context, ZefyrToolbarAction.bold),
271
+      toolbar.buildButton(context, ZefyrToolbarAction.italic),
272
+      toolbar.buildButton(context, ZefyrToolbarAction.underline),
273
+      toolbar.buildButton(context, ZefyrToolbarAction.deleteline),
274
+      toolbar.buildButton(context, ZefyrToolbarAction.quote),
275
+    ];
276
+    final listButtons = <Widget>[
277
+      toolbar.buildButton(context, ZefyrToolbarAction.numberList),
278
+      toolbar.buildButton(context, ZefyrToolbarAction.bulletList),
279
+    ];
280
+    final otherButtons = <Widget>[
281
+      toolbar.buildButton(context, ZefyrToolbarAction.horizontalRule),
282
+      toolbar.buildButton(context, ZefyrToolbarAction.code),
283
+    ];
284
+    return Material(
285
+      color: theme.color,
286
+          child: Container(
287
+        decoration: BoxDecoration(
288
+          border: Border(
289
+            top: BorderSide(color: theme.dividerColor, width: 1)
290
+          ),
291
+        ),
292
+        child: Column(
293
+          children: [
294
+            Container(
295
+              padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
296
+              child: Column(
297
+                children: [
298
+                  _buildButtonsView(headingButtons),
299
+                  _buildButtonsView(textButtons),
300
+                  _buildButtonsView(listButtons),
301
+                  _buildButtonsView(otherButtons),
302
+                ],
303
+              ),
304
+            ),
305
+            Container(
306
+              decoration: BoxDecoration(
307
+                border: Border(
308
+                  top: BorderSide(color: theme.dividerColor, width: 1)
309
+                ),
310
+              ),
311
+              padding: EdgeInsets.symmetric(vertical: 16),
312
+              margin: EdgeInsets.symmetric(horizontal: 16),
313
+              child: Row(
314
+                children: <Widget>[
315
+                  Padding(
316
+                    padding: EdgeInsets.only(right: 12),
317
+                    child: Text('文字色', style: Theme.of(context).textTheme.caption.copyWith(
318
+                      color: Theme.of(context).colorScheme.onSurface,
319
+                      fontSize: 14,
320
+                      fontWeight: FontWeight.w500,
321
+                    ),),
322
+                  ),
323
+                  Expanded(
324
+                    child: Container(
325
+                      height: 20,
326
+                      child: ListView(
327
+                        scrollDirection: Axis.horizontal,
328
+                        children: [
329
+                          Container(
330
+                            padding: EdgeInsets.all(1),
331
+                            decoration: ShapeDecoration(
332
+                              shape: CircleBorder(
333
+                                side: BorderSide(width: 1, color: theme.toggleColor),
334
+                              ),
335
+                            ),
336
+                            margin: EdgeInsets.symmetric(horizontal: 8),
337
+                            child: Container(
338
+                              width: 16,
339
+                              height: 16,
340
+                              decoration: ShapeDecoration(
341
+                                color: Color(0xFFE02020),
342
+                                shape: CircleBorder(),
343
+                              ),
344
+                            ),
345
+                          ),
346
+                          Container(
347
+                            padding: EdgeInsets.all(1),
348
+                            decoration: ShapeDecoration(
349
+                              shape: CircleBorder(
350
+                                side: BorderSide.none,
351
+                              ),
352
+                            ),
353
+                            margin: EdgeInsets.symmetric(horizontal: 8),
354
+                            child: Container(
355
+                              width: 16,
356
+                              height: 16,
357
+                              decoration: ShapeDecoration(
358
+                                color: Color(0xFFFA6400),
359
+                                shape: CircleBorder(),
360
+                              ),
361
+                            ),
362
+                          ),
363
+                          Container(
364
+                            padding: EdgeInsets.all(1),
365
+                            decoration: ShapeDecoration(
366
+                              shape: CircleBorder(
367
+                                side: BorderSide.none,
368
+                              ),
369
+                            ),
370
+                            margin: EdgeInsets.symmetric(horizontal: 8),
371
+                            child: Container(
372
+                              width: 16,
373
+                              height: 16,
374
+                              decoration: ShapeDecoration(
375
+                                color: Color(0xFF0091FF),
376
+                                shape: CircleBorder(),
377
+                              ),
378
+                            ),
379
+                          ),
380
+                        ],
381
+                        physics: ClampingScrollPhysics(),
382
+                      ),
383
+                    ),
384
+                  ),
385
+                ],
386
+              ),
387
+            ),
388
+          ],
389
+        ),
390
+      ),
233 391
     );
234
-    return ZefyrToolbarScaffold(body: buttons);
392
+    // ZefyrToolbarScaffold(body: Container(
393
+    //   height: 200,
394
+    //   child: buttons,
395
+    // ));
396
+  }
397
+}
398
+
399
+// TODO(lucky1213): image预览这个无效
400
+extension AssetEntityExtension on AssetEntity {
401
+  static String idd;
402
+  static Uint8List _cacheThumbData;
403
+
404
+  Future<Uint8List> getThumbData() async {
405
+      print((idd ?? '') != id);
406
+      print(id);
407
+    if ((idd ?? '') != id) {
408
+      idd = id;
409
+      _cacheThumbData = await thumbData;
410
+      return thumbData;
411
+    } else {
412
+      print(idd);
413
+      return _cacheThumbData;
414
+    }
415
+    if (_cacheThumbData == null) {
416
+      _cacheThumbData = await thumbData;
417
+      return thumbData;
418
+    } else {
419
+      return _cacheThumbData;
420
+    }
235 421
   }
236 422
 }
237 423
 
@@ -247,6 +433,7 @@ class ImageButton extends StatefulWidget {
247 433
 }
248 434
 
249 435
 class _ImageButtonState extends State<ImageButton> {
436
+  List<AssetEntity> assetList = [];
250 437
   @override
251 438
   Widget build(BuildContext context) {
252 439
     final toolbar = ZefyrToolbar.of(context);
@@ -257,12 +444,24 @@ class _ImageButtonState extends State<ImageButton> {
257 444
     );
258 445
   }
259 446
 
260
-  void showOverlay() {
447
+  Future<void> showOverlay() async {
261 448
     final toolbar = ZefyrToolbar.of(context);
262
-    toolbar.showOverlay(buildOverlay);
449
+    if (Platform.isIOS || Platform.isAndroid) {
450
+      var result = await PhotoManager.requestPermission();
451
+      if (result) {
452
+        var list = await PhotoManager.getAssetPathList(onlyAll: true, type: RequestType.image);
453
+        assetList = await list[0].assetList;
454
+        return toolbar.showOverlay(buildOverlay);
455
+      } else {
456
+        PhotoManager.openSetting();
457
+      }
458
+    } else {
459
+      print('打开file');
460
+    }
263 461
   }
264 462
 
265 463
   Widget buildOverlay(BuildContext context) {
464
+    final theme = ZefyrTheme.of(context).toolbarTheme;
266 465
     final toolbar = ZefyrToolbar.of(context);
267 466
     final buttons = Row(
268 467
       children: <Widget>[
@@ -273,7 +472,147 @@ class _ImageButtonState extends State<ImageButton> {
273 472
             onPressed: _pickFromGallery),
274 473
       ],
275 474
     );
276
-    return ZefyrToolbarScaffold(body: buttons);
475
+    return Material(
476
+      color: theme.color,
477
+      child: Container(
478
+        height: 260,
479
+        child: Column(
480
+          children: <Widget>[
481
+            Expanded(
482
+              child: Container(
483
+                decoration: BoxDecoration(
484
+                  border: Border(
485
+                    top: BorderSide(color: theme.dividerColor, width: 1),
486
+                    bottom: BorderSide(color: theme.dividerColor, width: 1),
487
+                  ),
488
+                ),
489
+                child: Row(
490
+                  children: [
491
+                    Container(
492
+                      width: 58,
493
+                      child: Column(
494
+                        children: [
495
+                          Expanded(
496
+                            child: FlatButton(
497
+                              shape: RoundedRectangleBorder(),
498
+                              color: Color(0xFFF6F6F6),
499
+                              onPressed: () {
500
+
501
+                              }, 
502
+                              child: Container(
503
+                                child: Column(
504
+                                  mainAxisAlignment: MainAxisAlignment.center,
505
+                                  children: [
506
+                                    Icon(kDefaultButtonIcons[ZefyrToolbarAction.cameraImage], size: 24, color: Color(0xFFBFBFBF),),
507
+                                    Padding(
508
+                                      padding: EdgeInsets.only(top: 6),
509
+                                      child: Text('拍照', style: TextStyle(
510
+                                        fontSize: 12,
511
+                                        color: Color(0xFF8C8C8C),
512
+                                      ),),
513
+                                    )
514
+                                  ],
515
+                                ),
516
+                              )
517
+                            ),
518
+                          ),
519
+                          Expanded(
520
+                            child: FlatButton(
521
+                              shape: RoundedRectangleBorder(),
522
+                              color: Color(0xFFF6F6F6),
523
+                              onPressed: () {
524
+
525
+                              }, 
526
+                              child: Container(
527
+                                child: Column(
528
+                                  mainAxisAlignment: MainAxisAlignment.center,
529
+                                  children: [
530
+                                    Icon(kDefaultButtonIcons[ZefyrToolbarAction.galleryImage], size: 24, color: Color(0xFFBFBFBF),),
531
+                                    Padding(
532
+                                      padding: EdgeInsets.only(top: 6),
533
+                                      child: Text('相册', style: TextStyle(
534
+                                        fontSize: 12,
535
+                                        color: Color(0xFF8C8C8C),
536
+                                      ),),
537
+                                    )
538
+                                  ],
539
+                                ),
540
+                              )
541
+                            ),
542
+                          ),
543
+                        ],
544
+                      ),
545
+                    ),
546
+                    Expanded(
547
+                      child: ListView.builder(
548
+                        key: ValueKey(assetList.length),
549
+                        scrollDirection: Axis.horizontal,
550
+                        physics: ClampingScrollPhysics(),
551
+                        itemCount: assetList.length,
552
+                        itemExtent: 122,
553
+                        itemBuilder: (context, index) {
554
+                          return GalleryItem(key: ObjectKey(assetList[index].id), asset: assetList[index],);
555
+                        },
556
+                      ),
557
+                    ),
558
+                  ],
559
+                ),
560
+              ),
561
+            ),
562
+            Container(
563
+              height: 50,
564
+              color: theme.color,
565
+              padding: EdgeInsets.symmetric(horizontal: 20),
566
+              child: Row(
567
+                children: [
568
+                  Expanded(
569
+                    child: Row(
570
+                      children: [
571
+                        SizedBox(
572
+                          width: 16,
573
+                          height: 16,
574
+                          child: Radio<bool>(
575
+                            value: false, 
576
+                            groupValue: false, 
577
+                            onChanged: (bool result) {
578
+
579
+                            },
580
+                          ),
581
+                        ),
582
+                        Padding(
583
+                          padding: EdgeInsets.symmetric(horizontal: 8),
584
+                          child: Text('原图', style: TextStyle(
585
+                            color: theme.iconColor,
586
+                            fontSize: 16
587
+                          ),),
588
+                        ),
589
+                      ],
590
+                    ),
591
+                  ),
592
+                  FlatButton(
593
+                    padding: EdgeInsets.zero,
594
+                    color: theme.toggleColor,
595
+                    shape: StadiumBorder(),
596
+                    onPressed: () {
597
+
598
+                    }, 
599
+                    child: Container(
600
+                      height: 30,
601
+                      alignment: Alignment.center,
602
+                      padding: EdgeInsets.symmetric(horizontal: 20),
603
+                      child: Text('上传 (2)', style: TextStyle(
604
+                        color: Colors.white,
605
+                        fontSize: 14,
606
+                      ),),
607
+                    ),
608
+                  ),
609
+                ],
610
+              ),
611
+            )
612
+          ],
613
+        ),
614
+      ),
615
+    );
277 616
   }
278 617
 
279 618
   void _pickFromCamera() async {
@@ -582,4 +921,4 @@ class _LinkView extends StatelessWidget {
582 921
     }
583 922
     return widget;
584 923
   }
585
-}
924
+}

+ 86
- 0
packages/zefyr/lib/src/widgets/gallery_item.dart View File

@@ -0,0 +1,86 @@
1
+import 'dart:typed_data';
2
+
3
+import 'package:flutter/material.dart';
4
+import 'package:photo_manager/photo_manager.dart';
5
+
6
+import 'iconfont.dart';
7
+import 'theme.dart';
8
+
9
+class GalleryItem extends StatefulWidget {
10
+  const GalleryItem({Key key, this.asset}) : super(key: key);
11
+  final AssetEntity asset;
12
+
13
+  @override
14
+  _GalleryItemState createState() => _GalleryItemState();
15
+}
16
+
17
+class _GalleryItemState extends State<GalleryItem> {
18
+  final ValueNotifier<bool> _checked = ValueNotifier<bool>(false);
19
+  Uint8List _thumbData;
20
+
21
+  @override
22
+  Widget build(BuildContext context) {
23
+    final theme = ZefyrTheme.of(context).toolbarTheme;
24
+    return Stack(
25
+      children: <Widget>[
26
+        GestureDetector(
27
+          behavior: HitTestBehavior.opaque,
28
+          child: Container(
29
+            height: 210,
30
+            margin: EdgeInsets.only(left: 4),
31
+            child: _thumbData != null
32
+                ? Image.memory(
33
+                    _thumbData,
34
+                    fit: BoxFit.cover,
35
+                  )
36
+                : FutureBuilder<Uint8List>(
37
+                    future: widget.asset.thumbData,
38
+                    builder: (BuildContext context, snapshot) {
39
+                      Widget w;
40
+                      if (snapshot.hasError) {
41
+                        w = ErrorWidget(snapshot.error);
42
+                      } else if (snapshot.hasData) {
43
+                        _thumbData = snapshot.data;
44
+                        w = Image.memory(
45
+                          snapshot.data,
46
+                          fit: BoxFit.cover,
47
+                        );
48
+                      } else {
49
+                        w = Center(
50
+                          child: Container(
51
+                            color: Colors.white,
52
+                            padding: const EdgeInsets.all(20),
53
+                            child: CircularProgressIndicator(),
54
+                          ),
55
+                        );
56
+                      }
57
+                      return w;
58
+                    },
59
+                  ),
60
+          ),
61
+          onTap: () {},
62
+        ),
63
+        Positioned(
64
+          top: 6,
65
+          right: 6,
66
+          child: ValueListenableBuilder(
67
+            valueListenable: _checked,
68
+            builder: (BuildContext context, bool value, Widget child) {
69
+              return GestureDetector(
70
+                behavior: HitTestBehavior.opaque,
71
+                onTap: () {
72
+                  _checked.value = !value;
73
+                },
74
+                child: Icon(
75
+                  IconFont.list_update_complete,
76
+                  size: 24,
77
+                  color: value ? theme.toggleColor : Colors.white,
78
+                ),
79
+              );
80
+            },
81
+          ),
82
+        ),
83
+      ],
84
+    );
85
+  }
86
+}

+ 318
- 0
packages/zefyr/lib/src/widgets/iconfont.dart View File

@@ -0,0 +1,318 @@
1
+import 'package:flutter/widgets.dart';
2
+
3
+class IconFont {
4
+  IconFont._();
5
+  static const String _family = 'ZefyrFont';
6
+  static const IconData global_language = IconData(0xe725, fontFamily: _family);
7
+	static const IconData light = IconData(0xe723, fontFamily: _family);
8
+	static const IconData checked = IconData(0xe724, fontFamily: _family);
9
+  static const IconData largetitle_dropdown = IconData(0xe722, fontFamily: _family);
10
+	static const IconData global_toast_loading_delete = IconData(0xe721, fontFamily: _family);
11
+	static const IconData toast_fail = IconData(0xe71e, fontFamily: _family);
12
+	static const IconData toast_success = IconData(0xe71f, fontFamily: _family);
13
+	static const IconData toast_loading = IconData(0xe720, fontFamily: _family);
14
+	static const IconData global_sidebar_profile = IconData(0xe71d, fontFamily: _family);
15
+	static const IconData lightmode = IconData(0xe71c, fontFamily: _family);
16
+	static const IconData salary_details_time = IconData(0xe71b, fontFamily: _family);
17
+	static const IconData share = IconData(0xe719, fontFamily: _family);
18
+	static const IconData btn_global_videoplay = IconData(0xe6c5, fontFamily: _family);
19
+	static const IconData im_groupdetails_archive = IconData(0xe6cf, fontFamily: _family);
20
+	static const IconData im_notice_arrow = IconData(0xe71a, fontFamily: _family);
21
+	static const IconData minus = IconData(0xe718, fontFamily: _family);
22
+	static const IconData staffdetails_review = IconData(0xe716, fontFamily: _family);
23
+	static const IconData staffdetails_salary = IconData(0xe717, fontFamily: _family);
24
+  static const IconData list_update_fail =
25
+      IconData(0xe715, fontFamily: _family);
26
+  static const IconData list_update_complete =
27
+      IconData(0xe712, fontFamily: _family);
28
+  static const IconData list_update_pull =
29
+      IconData(0xe713, fontFamily: _family);
30
+  static const IconData list_update_loading =
31
+      IconData(0xe714, fontFamily: _family);
32
+  static const IconData contact_organization =
33
+      IconData(0xe70d, fontFamily: _family);
34
+  static const IconData contact_outsider =
35
+      IconData(0xe70e, fontFamily: _family);
36
+  static const IconData contact_new = IconData(0xe70f, fontFamily: _family);
37
+  static const IconData contact_mygroup = IconData(0xe710, fontFamily: _family);
38
+  static const IconData contact_robot = IconData(0xe711, fontFamily: _family);
39
+  static const IconData note_createnote = IconData(0xe70b, fontFamily: _family);
40
+  static const IconData note_createfolder =
41
+      IconData(0xe70c, fontFamily: _family);
42
+  static const IconData rating_full = IconData(0xe708, fontFamily: _family);
43
+  static const IconData rating_half = IconData(0xe709, fontFamily: _family);
44
+  static const IconData rating_unfull = IconData(0xe70a, fontFamily: _family);
45
+  static const IconData note_searchfile_pre =
46
+      IconData(0xe706, fontFamily: _family);
47
+  static const IconData note_searchfile_next =
48
+      IconData(0xe707, fontFamily: _family);
49
+  static const IconData note_notelist_more =
50
+      IconData(0xe705, fontFamily: _family);
51
+  static const IconData note_notelist_folder =
52
+      IconData(0xe700, fontFamily: _family);
53
+  static const IconData note_notelist_emptyfolder =
54
+      IconData(0xe701, fontFamily: _family);
55
+  static const IconData note_notelist_rubbish =
56
+      IconData(0xe702, fontFamily: _family);
57
+  static const IconData note_notelist_note =
58
+      IconData(0xe703, fontFamily: _family);
59
+  static const IconData note_notelist_savefolder =
60
+      IconData(0xe704, fontFamily: _family);
61
+  static const IconData note_more_comment =
62
+      IconData(0xe6f7, fontFamily: _family);
63
+  static const IconData note_more_history =
64
+      IconData(0xe6f8, fontFamily: _family);
65
+  static const IconData note_more_info = IconData(0xe6f9, fontFamily: _family);
66
+  static const IconData note_more_search =
67
+      IconData(0xe6fa, fontFamily: _family);
68
+  static const IconData note_more_copy = IconData(0xe6fb, fontFamily: _family);
69
+  static const IconData note_more_pin = IconData(0xe6fc, fontFamily: _family);
70
+  static const IconData note_more_delete =
71
+      IconData(0xe6fd, fontFamily: _family);
72
+  static const IconData note_more_favorite =
73
+      IconData(0xe6fe, fontFamily: _family);
74
+  static const IconData note_more_move = IconData(0xe6ff, fontFamily: _family);
75
+  static const IconData note_editor_text_h =
76
+      IconData(0xe6e4, fontFamily: _family);
77
+  static const IconData note_editor_text_code =
78
+      IconData(0xe6e5, fontFamily: _family);
79
+  static const IconData note_editor_text_bold =
80
+      IconData(0xe6e6, fontFamily: _family);
81
+  static const IconData note_editor_text_h1 =
82
+      IconData(0xe6e7, fontFamily: _family);
83
+  static const IconData note_editor_text_center =
84
+      IconData(0xe6e8, fontFamily: _family);
85
+  static const IconData note_editor_text_deleteline =
86
+      IconData(0xe6e9, fontFamily: _family);
87
+  static const IconData note_editor_text_left =
88
+      IconData(0xe6ea, fontFamily: _family);
89
+  static const IconData note_editor_text_h2 =
90
+      IconData(0xe6eb, fontFamily: _family);
91
+  static const IconData note_editor_text_h3 =
92
+      IconData(0xe6ec, fontFamily: _family);
93
+  static const IconData note_editor_text_right =
94
+      IconData(0xe6ed, fontFamily: _family);
95
+  static const IconData note_editor_text_hr =
96
+      IconData(0xe6ee, fontFamily: _family);
97
+  static const IconData note_editor_text_h4 =
98
+      IconData(0xe6ef, fontFamily: _family);
99
+  static const IconData note_editor_text_underline =
100
+      IconData(0xe6f0, fontFamily: _family);
101
+  static const IconData note_editor_text_ul =
102
+      IconData(0xe6f1, fontFamily: _family);
103
+  static const IconData note_editor_text_quote =
104
+      IconData(0xe6f2, fontFamily: _family);
105
+  static const IconData note_editor_text_in =
106
+      IconData(0xe6f3, fontFamily: _family);
107
+  static const IconData note_editor_text_h5 =
108
+      IconData(0xe6f4, fontFamily: _family);
109
+  static const IconData note_editor_text_para =
110
+      IconData(0xe6f5, fontFamily: _family);
111
+  static const IconData note_editor_text_ol =
112
+      IconData(0xe6f6, fontFamily: _family);
113
+  static const IconData note_editor_unkeyboard =
114
+      IconData(0xe6dc, fontFamily: _family);
115
+  static const IconData note_editor_keyboard =
116
+      IconData(0xe6dd, fontFamily: _family);
117
+  static const IconData note_editor_redo =
118
+      IconData(0xe6de, fontFamily: _family);
119
+  static const IconData note_editor_undo =
120
+      IconData(0xe6df, fontFamily: _family);
121
+  static const IconData note_editor_text =
122
+      IconData(0xe6e0, fontFamily: _family);
123
+  static const IconData note_editor_image =
124
+      IconData(0xe6e1, fontFamily: _family);
125
+  static const IconData note_editor_link =
126
+      IconData(0xe6e2, fontFamily: _family);
127
+  static const IconData note_editor_save =
128
+      IconData(0xe6e3, fontFamily: _family);
129
+  static const IconData desktop_todolist_warning =
130
+      IconData(0xe6d8, fontFamily: _family);
131
+  static const IconData desktop_global_calender =
132
+      IconData(0xe6d9, fontFamily: _family);
133
+  static const IconData desktop_global_repeat =
134
+      IconData(0xe6da, fontFamily: _family);
135
+  static const IconData desktop_global_important =
136
+      IconData(0xe6db, fontFamily: _family);
137
+  static const IconData startpage_jointeam =
138
+      IconData(0xe6d6, fontFamily: _family);
139
+  static const IconData startpage_creatteam =
140
+      IconData(0xe6d7, fontFamily: _family);
141
+  static const IconData staffdetails_videocall =
142
+      IconData(0xe6d3, fontFamily: _family);
143
+  static const IconData staffdetails_voicecall =
144
+      IconData(0xe6d4, fontFamily: _family);
145
+  static const IconData staffdetails_sendmessage =
146
+      IconData(0xe6d5, fontFamily: _family);
147
+  static const IconData staffdetails_job =
148
+      IconData(0xe6d0, fontFamily: _family);
149
+  static const IconData staffdetails_contact =
150
+      IconData(0xe6d1, fontFamily: _family);
151
+  static const IconData staffdetails_basic =
152
+      IconData(0xe6d2, fontFamily: _family);
153
+  static const IconData selectpeople_delete =
154
+      IconData(0xe6cf, fontFamily: _family);
155
+  static const IconData im_comment_empty =
156
+      IconData(0xe6ce, fontFamily: _family);
157
+  static const IconData im_filebar_download =
158
+      IconData(0xe6c8, fontFamily: _family);
159
+  static const IconData im_filebar_favorite_faved =
160
+      IconData(0xe6c9, fontFamily: _family);
161
+  static const IconData im_filebar_forward =
162
+      IconData(0xe6ca, fontFamily: _family);
163
+  static const IconData im_filebar_comment =
164
+      IconData(0xe6cb, fontFamily: _family);
165
+  static const IconData im_filebar_delete =
166
+      IconData(0xe6cc, fontFamily: _family);
167
+  static const IconData im_filebar_favorite_unfav =
168
+      IconData(0xe6cd, fontFamily: _family);
169
+  static const IconData im_groupdetails_edit =
170
+      IconData(0xe6c5, fontFamily: _family);
171
+  static const IconData im_groupdetails_member =
172
+      IconData(0xe6c6, fontFamily: _family);
173
+  static const IconData im_groupdetails_robot =
174
+      IconData(0xe6c7, fontFamily: _family);
175
+  static const IconData im_groupdetails_file =
176
+      IconData(0xe6c1, fontFamily: _family);
177
+  static const IconData im_groupdetails_history =
178
+      IconData(0xe6c2, fontFamily: _family);
179
+  static const IconData im_groupdetails_pin =
180
+      IconData(0xe6c3, fontFamily: _family);
181
+  static const IconData im_groupdetails_board =
182
+      IconData(0xe6c4, fontFamily: _family);
183
+  static const IconData im_list_nodisturb =
184
+      IconData(0xe6c0, fontFamily: _family);
185
+  static const IconData im_videocall_camera =
186
+      IconData(0xe6ba, fontFamily: _family);
187
+  static const IconData im_voicecall_sound =
188
+      IconData(0xe6bb, fontFamily: _family);
189
+  static const IconData im_videocall_stretch =
190
+      IconData(0xe6bc, fontFamily: _family);
191
+  static const IconData im_voicecall_video =
192
+      IconData(0xe6bd, fontFamily: _family);
193
+  static const IconData im_videocall_voice =
194
+      IconData(0xe6be, fontFamily: _family);
195
+  static const IconData im_voicecall_mute =
196
+      IconData(0xe6bf, fontFamily: _family);
197
+  static const IconData im_sidebar_favorite =
198
+      IconData(0xe6b6, fontFamily: _family);
199
+  static const IconData im_sidebar_file = IconData(0xe6b7, fontFamily: _family);
200
+  static const IconData im_sidebar_at = IconData(0xe6b8, fontFamily: _family);
201
+  static const IconData im_sidebar_notice =
202
+      IconData(0xe6b9, fontFamily: _family);
203
+  static const IconData im_dialoge_more_voicecall =
204
+      IconData(0xe6af, fontFamily: _family);
205
+  static const IconData im_dialoge_more_takephoto =
206
+      IconData(0xe6b0, fontFamily: _family);
207
+  static const IconData im_dialoge_more_album =
208
+      IconData(0xe6b1, fontFamily: _family);
209
+  static const IconData im_dialoge_more_note =
210
+      IconData(0xe6b2, fontFamily: _family);
211
+  static const IconData im_dialoge_more_task =
212
+      IconData(0xe6b3, fontFamily: _family);
213
+  static const IconData im_dialoge_more_videocall =
214
+      IconData(0xe6b4, fontFamily: _family);
215
+  static const IconData im_dialoge_more_project =
216
+      IconData(0xe6b5, fontFamily: _family);
217
+  static const IconData im_dialogebar_sendmore =
218
+      IconData(0xe6ac, fontFamily: _family);
219
+  static const IconData im_dialogebar_sendemoji =
220
+      IconData(0xe6ad, fontFamily: _family);
221
+  static const IconData im_dialogebar_sendvoice =
222
+      IconData(0xe6ae, fontFamily: _family);
223
+  static const IconData im_dialoge_voicestop =
224
+      IconData(0xe6a7, fontFamily: _family);
225
+  static const IconData im_dialoge_voice =
226
+      IconData(0xe6a8, fontFamily: _family);
227
+  static const IconData im_dialoge_pin = IconData(0xe6a9, fontFamily: _family);
228
+  static const IconData im_dialoge_voiceplay =
229
+      IconData(0xe6aa, fontFamily: _family);
230
+  static const IconData im_dialoge_record =
231
+      IconData(0xe6ab, fontFamily: _family);
232
+  static const IconData global_list_arrow =
233
+      IconData(0xe6a5, fontFamily: _family);
234
+  static const IconData global_list_delete =
235
+      IconData(0xe6a6, fontFamily: _family);
236
+  static const IconData multiselect_unselected =
237
+      IconData(0xe6a2, fontFamily: _family);
238
+  static const IconData multiselect_audio =
239
+      IconData(0xe6a3, fontFamily: _family);
240
+  static const IconData multiselect_selected =
241
+      IconData(0xe6a4, fontFamily: _family);
242
+  static const IconData login_dropdown = IconData(0xe6a1, fontFamily: _family);
243
+  static const IconData global_actionsheet_close =
244
+      IconData(0xe6a0, fontFamily: _family);
245
+  static const IconData global_sidebar_status =
246
+      IconData(0xe69f, fontFamily: _family);
247
+  static const IconData global_sidebar_qrcode =
248
+      IconData(0xe69a, fontFamily: _family);
249
+  static const IconData global_sidebar_teamsetting =
250
+      IconData(0xe69b, fontFamily: _family);
251
+  static const IconData global_sidebar_account =
252
+      IconData(0xe69c, fontFamily: _family);
253
+  static const IconData global_sidebar_noticesetting =
254
+      IconData(0xe69d, fontFamily: _family);
255
+  static const IconData global_sidebar_system =
256
+      IconData(0xe69e, fontFamily: _family);
257
+  static const IconData global_sidebar_notice =
258
+      IconData(0xe698, fontFamily: _family);
259
+  static const IconData global_sidebar_darkmode =
260
+      IconData(0xe699, fontFamily: _family);
261
+  static const IconData global_sidebar_lightmode =
262
+      IconData(0xe71c, fontFamily: _family);
263
+  static const IconData global_sidebar_add =
264
+      IconData(0xe697, fontFamily: _family);
265
+  static const IconData global_share_more =
266
+      IconData(0xe691, fontFamily: _family);
267
+  static const IconData global_share_message =
268
+      IconData(0xe692, fontFamily: _family);
269
+  static const IconData global_share_qq = IconData(0xe693, fontFamily: _family);
270
+  static const IconData global_share_copylink =
271
+      IconData(0xe694, fontFamily: _family);
272
+  static const IconData global_share_weibo =
273
+      IconData(0xe695, fontFamily: _family);
274
+  static const IconData global_share_wechat =
275
+      IconData(0xe696, fontFamily: _family);
276
+  static const IconData global_searchbox_delete =
277
+      IconData(0xe68f, fontFamily: _family);
278
+  static const IconData global_searchbox_search =
279
+      IconData(0xe690, fontFamily: _family);
280
+  static const IconData global_invitecode_refresh =
281
+      IconData(0xe68c, fontFamily: _family);
282
+  static const IconData global_invitecode_link =
283
+      IconData(0xe68d, fontFamily: _family);
284
+  static const IconData global_invitecode_qrcode =
285
+      IconData(0xe68e, fontFamily: _family);
286
+  static const IconData global_invite_qrcode =
287
+      IconData(0xe688, fontFamily: _family);
288
+  static const IconData global_invite_code =
289
+      IconData(0xe689, fontFamily: _family);
290
+  static const IconData global_invite_wechat =
291
+      IconData(0xe68a, fontFamily: _family);
292
+  static const IconData global_invite_qq =
293
+      IconData(0xe68b, fontFamily: _family);
294
+  static const IconData global_hoverbtn_add =
295
+      IconData(0xe686, fontFamily: _family);
296
+  static const IconData global_hoverbtn_close =
297
+      IconData(0xe687, fontFamily: _family);
298
+  static const IconData tabbar_note = IconData(0xe681, fontFamily: _family);
299
+  static const IconData tabbar_desktop = IconData(0xe682, fontFamily: _family);
300
+  static const IconData tabbar_explore = IconData(0xe683, fontFamily: _family);
301
+  static const IconData tabbar_message = IconData(0xe684, fontFamily: _family);
302
+  static const IconData tabbar_contact = IconData(0xe685, fontFamily: _family);
303
+  static const IconData topbar_back = IconData(0xe680, fontFamily: _family);
304
+  static const IconData topbar_closesidebar =
305
+      IconData(0xe67d, fontFamily: _family);
306
+  static const IconData topbar_people = IconData(0xe67e, fontFamily: _family);
307
+  static const IconData topbar_sidebar = IconData(0xe67f, fontFamily: _family);
308
+  static const IconData topbar_add = IconData(0xe674, fontFamily: _family);
309
+  static const IconData topbar_more = IconData(0xe675, fontFamily: _family);
310
+  static const IconData topbar_addrobot = IconData(0xe676, fontFamily: _family);
311
+  static const IconData topbar_calenderview =
312
+      IconData(0xe677, fontFamily: _family);
313
+  static const IconData topbar_invite = IconData(0xe678, fontFamily: _family);
314
+  static const IconData topbar_share = IconData(0xe679, fontFamily: _family);
315
+  static const IconData topbar_group = IconData(0xe67a, fontFamily: _family);
316
+  static const IconData topbar_setting = IconData(0xe67b, fontFamily: _family);
317
+  static const IconData topbar_close = IconData(0xe67c, fontFamily: _family);
318
+}

+ 22
- 9
packages/zefyr/lib/src/widgets/theme.dart View File

@@ -494,32 +494,37 @@ class ToolbarTheme {
494 494
   /// Color of buttons in toggled state.
495 495
   final Color toggleColor;
496 496
 
497
+  /// Color of button icons.
498
+  final Color iconFillColor;
499
+
497 500
   /// Color of button icons.
498 501
   final Color iconColor;
499 502
 
500 503
   /// Color of button icons in disabled state.
501 504
   final Color disabledIconColor;
505
+  
506
+  final Color dividerColor;
502 507
 
503 508
   /// Creates default theme for editor toolbar.
504 509
   factory ToolbarTheme.fallback(BuildContext context) {
505 510
     final theme = Theme.of(context);
506 511
     return ToolbarTheme._(
507
-      color: theme.primaryColorBrightness == Brightness.light
508
-          ? Colors.grey.shade300
509
-          : Colors.grey.shade800,
510
-      toggleColor: theme.primaryColorBrightness == Brightness.light
511
-          ? Colors.grey.shade400
512
-          : Colors.grey.shade900,
513
-      iconColor: theme.primaryIconTheme.color,
514
-      disabledIconColor: theme.disabledColor,
512
+      color: theme.brightness == Brightness.dark ? Color(0xFF282828) : Color(0xFFFFFFFF),
513
+      toggleColor: Color(0xFF01AAFF),
514
+      iconFillColor: theme.brightness == Brightness.dark ? Color(0xFF1F1F1F) : Color(0xFFF2F2F2),
515
+      iconColor: Color(0xFF595959),
516
+      disabledIconColor: Color(0xFF8C8C8C),
517
+      dividerColor: theme.brightness == Brightness.dark ? Color(0xFF3B3B3B) : Color(0xFFF2F2F2),
515 518
     );
516 519
   }
517 520
 
518 521
   ToolbarTheme._({
519 522
     @required this.color,
520 523
     @required this.toggleColor,
524
+    @required this.iconFillColor,
521 525
     @required this.iconColor,
522 526
     @required this.disabledIconColor,
527
+    @required this.dividerColor,
523 528
   });
524 529
 
525 530
   /// Creates a new [ToolbarTheme] where each property from this object has
@@ -527,14 +532,18 @@ class ToolbarTheme {
527 532
   ToolbarTheme copyWith({
528 533
     Color color,
529 534
     Color toggleColor,
535
+    Color iconFillColor,
530 536
     Color iconColor,
531 537
     Color disabledIconColor,
538
+    Color dividerColor,
532 539
   }) {
533 540
     return ToolbarTheme._(
534 541
       color: color ?? this.color,
535 542
       toggleColor: toggleColor ?? this.toggleColor,
543
+      iconFillColor: iconFillColor ?? this.iconFillColor,
536 544
       iconColor: iconColor ?? this.iconColor,
537 545
       disabledIconColor: disabledIconColor ?? this.disabledIconColor,
546
+      dividerColor: dividerColor ?? this.dividerColor,
538 547
     );
539 548
   }
540 549
 
@@ -545,8 +554,10 @@ class ToolbarTheme {
545 554
     return copyWith(
546 555
       color: other.color ?? color,
547 556
       toggleColor: other.toggleColor ?? toggleColor,
557
+      iconFillColor: other.iconFillColor ?? iconFillColor,
548 558
       iconColor: other.iconColor ?? iconColor,
549 559
       disabledIconColor: other.disabledIconColor ?? disabledIconColor,
560
+      dividerColor: other.dividerColor ?? dividerColor,
550 561
     );
551 562
   }
552 563
 
@@ -556,11 +567,13 @@ class ToolbarTheme {
556 567
     final ToolbarTheme otherTheme = other;
557 568
     return (otherTheme.color == color) &&
558 569
         (otherTheme.toggleColor == toggleColor) &&
570
+        (otherTheme.iconFillColor == iconFillColor) &&
559 571
         (otherTheme.iconColor == iconColor) &&
560 572
         (otherTheme.disabledIconColor == disabledIconColor);
573
+        (otherTheme.dividerColor == dividerColor);
561 574
   }
562 575
 
563 576
   @override
564 577
   int get hashCode =>
565
-      hashValues(color, toggleColor, iconColor, disabledIconColor);
578
+      hashValues(color, toggleColor, iconFillColor, iconColor, disabledIconColor, dividerColor);
566 579
 }

+ 94
- 73
packages/zefyr/lib/src/widgets/toolbar.dart View File

@@ -7,6 +7,7 @@ import 'dart:ui' as ui;
7 7
 import 'package:flutter/material.dart';
8 8
 import 'package:notus/notus.dart';
9 9
 
10
+import 'iconfont.dart';
10 11
 import 'buttons.dart';
11 12
 import 'scope.dart';
12 13
 import 'theme.dart';
@@ -15,14 +16,21 @@ import 'theme.dart';
15 16
 enum ZefyrToolbarAction {
16 17
   bold,
17 18
   italic,
19
+  underline,
20
+  deleteline,
18 21
   link,
19 22
   unlink,
23
+  emoji,
20 24
   clipboardCopy,
21 25
   openInBrowser,
22 26
   heading,
27
+  text,
23 28
   headingLevel1,
24 29
   headingLevel2,
25 30
   headingLevel3,
31
+  headingLevel4,
32
+  headingLevel5,
33
+  headingLevel6,
26 34
   bulletList,
27 35
   numberList,
28 36
   code,
@@ -51,6 +59,47 @@ final kZefyrToolbarAttributeActions = <ZefyrToolbarAction, NotusAttributeKey>{
51 59
   ZefyrToolbarAction.horizontalRule: NotusAttribute.embed.horizontalRule,
52 60
 };
53 61
 
62
+const kDefaultButtonIcons = {
63
+  ZefyrToolbarAction.bold: IconFont.note_editor_text_bold,
64
+  ZefyrToolbarAction.italic: IconFont.note_editor_text_in,
65
+  ZefyrToolbarAction.underline: IconFont.note_editor_text_underline,
66
+  ZefyrToolbarAction.deleteline: IconFont.note_editor_text_deleteline,
67
+  ZefyrToolbarAction.quote: IconFont.note_editor_text_quote,
68
+  ZefyrToolbarAction.numberList: IconFont.note_editor_text_ol,
69
+  ZefyrToolbarAction.bulletList: IconFont.note_editor_text_ul,
70
+  ZefyrToolbarAction.link: IconFont.note_editor_link,
71
+  ZefyrToolbarAction.unlink: Icons.link_off,
72
+  ZefyrToolbarAction.emoji: IconFont.im_dialogebar_sendemoji,
73
+  ZefyrToolbarAction.clipboardCopy: Icons.content_copy,
74
+  ZefyrToolbarAction.openInBrowser: Icons.open_in_new,
75
+  ZefyrToolbarAction.heading: IconFont.note_editor_text,
76
+  ZefyrToolbarAction.headingLevel1: IconFont.note_editor_text_h,
77
+  ZefyrToolbarAction.headingLevel2: IconFont.note_editor_text_h1,
78
+  ZefyrToolbarAction.headingLevel3: IconFont.note_editor_text_h2,
79
+  ZefyrToolbarAction.headingLevel4: IconFont.note_editor_text_h3,
80
+  ZefyrToolbarAction.headingLevel5: IconFont.note_editor_text_h4,
81
+  ZefyrToolbarAction.headingLevel6: IconFont.note_editor_text_h5,
82
+  ZefyrToolbarAction.text: IconFont.note_editor_text,
83
+  ZefyrToolbarAction.code: IconFont.note_editor_text_code,
84
+  ZefyrToolbarAction.horizontalRule: IconFont.note_editor_text_hr,
85
+  ZefyrToolbarAction.image: IconFont.note_editor_image,
86
+  ZefyrToolbarAction.cameraImage: IconFont.im_dialoge_more_takephoto,
87
+  ZefyrToolbarAction.galleryImage: IconFont.im_dialoge_more_album,
88
+  ZefyrToolbarAction.hideKeyboard: IconFont.note_editor_keyboard,
89
+  ZefyrToolbarAction.close: Icons.close,
90
+  ZefyrToolbarAction.confirm: Icons.check,
91
+};
92
+
93
+const kSpecialIconSizes = {
94
+  ZefyrToolbarAction.unlink: 20.0,
95
+  ZefyrToolbarAction.clipboardCopy: 20.0,
96
+  ZefyrToolbarAction.openInBrowser: 20.0,
97
+  ZefyrToolbarAction.close: 20.0,
98
+  ZefyrToolbarAction.confirm: 20.0,
99
+};
100
+
101
+const kDefaultButtonTexts = {};
102
+
54 103
 /// Allows customizing appearance of [ZefyrToolbar].
55 104
 abstract class ZefyrToolbarDelegate {
56 105
   /// Builds toolbar button for specified [action].
@@ -80,16 +129,21 @@ class ZefyrToolbarScaffold extends StatelessWidget {
80 129
     final constraints =
81 130
         BoxConstraints.tightFor(height: ZefyrToolbar.kToolbarHeight);
82 131
     final children = <Widget>[
83
-      Expanded(child: body),
132
+      if (trailing != null)
133
+        trailing
134
+      else if (autoImplyTrailing)
135
+        toolbar.buildButton(context, ZefyrToolbarAction.close)
84 136
     ];
85 137
 
86
-    if (trailing != null) {
87
-      children.add(trailing);
88
-    } else if (autoImplyTrailing) {
89
-      children.add(toolbar.buildButton(context, ZefyrToolbarAction.close));
90
-    }
138
+    children.add(Expanded(child: body));
139
+
91 140
     return Container(
92 141
       constraints: constraints,
142
+      decoration: BoxDecoration(
143
+        border: Border(
144
+          top: BorderSide(color: theme.dividerColor, width: 1)
145
+        ),
146
+      ),
93 147
       child: Material(color: theme.color, child: Row(children: children)),
94 148
     );
95 149
   }
@@ -153,7 +207,7 @@ class ZefyrToolbarState extends State<ZefyrToolbar>
153 207
     setState(() {
154 208
       if (_selection != editor.selection) {
155 209
         _selection = editor.selection;
156
-        closeOverlay();
210
+        // closeOverlay();
157 211
       }
158 212
     });
159 213
   }
@@ -164,7 +218,9 @@ class ZefyrToolbarState extends State<ZefyrToolbar>
164 218
   }
165 219
 
166 220
   Future<void> showOverlay(WidgetBuilder builder) async {
167
-    assert(_overlayBuilder == null);
221
+    if (hasOverlay) {
222
+      closeOverlay();
223
+    }
168 224
     final completer = Completer<void>();
169 225
     setState(() {
170 226
       _overlayBuilder = builder;
@@ -218,6 +274,7 @@ class ZefyrToolbarState extends State<ZefyrToolbar>
218 274
 
219 275
     // Must set unique key for the toolbar to prevent it from reconstructing
220 276
     // new state each time we toggle overlay.
277
+
221 278
     final toolbar = ZefyrToolbarScaffold(
222 279
       key: _toolbarKey,
223 280
       body: ZefyrButtonList(buttons: _buildButtons(context)),
@@ -236,30 +293,26 @@ class ZefyrToolbarState extends State<ZefyrToolbar>
236 293
       );
237 294
       layers.add(overlay);
238 295
     }
239
-
240
-    final constraints =
241
-        BoxConstraints.tightFor(height: ZefyrToolbar.kToolbarHeight);
242 296
     return _ZefyrToolbarScope(
243 297
       toolbar: this,
244
-      child: Container(
245
-        constraints: constraints,
246
-        child: Stack(children: layers),
298
+      child: Column(
299
+        children: layers
247 300
       ),
248 301
     );
249 302
   }
250 303
 
251 304
   List<Widget> _buildButtons(BuildContext context) {
252 305
     final buttons = <Widget>[
253
-      buildButton(context, ZefyrToolbarAction.bold),
254
-      buildButton(context, ZefyrToolbarAction.italic),
255
-      LinkButton(),
256 306
       HeadingButton(),
257
-      buildButton(context, ZefyrToolbarAction.bulletList),
258
-      buildButton(context, ZefyrToolbarAction.numberList),
259
-      buildButton(context, ZefyrToolbarAction.quote),
260
-      buildButton(context, ZefyrToolbarAction.code),
261
-      buildButton(context, ZefyrToolbarAction.horizontalRule),
307
+      buildButton(context, ZefyrToolbarAction.emoji),
262 308
       if (editor.imageDelegate != null) ImageButton(),
309
+      LinkButton(),
310
+      
311
+      // buildButton(context, ZefyrToolbarAction.bulletList),
312
+      // buildButton(context, ZefyrToolbarAction.numberList),
313
+      // buildButton(context, ZefyrToolbarAction.quote),
314
+      // buildButton(context, ZefyrToolbarAction.code),
315
+      // buildButton(context, ZefyrToolbarAction.horizontalRule),
263 316
     ];
264 317
     return buttons;
265 318
   }
@@ -306,21 +359,23 @@ class _ZefyrButtonListState extends State<ZefyrButtonList> {
306 359
     final rightArrow = _showRightArrow
307 360
         ? Icon(Icons.arrow_right, size: 18.0, color: color)
308 361
         : null;
309
-    return Row(
310
-      children: <Widget>[
311
-        SizedBox(
312
-          width: 12.0,
313
-          height: ZefyrToolbar.kToolbarHeight,
314
-          child: Container(child: leftArrow, color: theme.color),
315
-        ),
316
-        Expanded(child: ClipRect(child: list)),
317
-        SizedBox(
318
-          width: 12.0,
319
-          height: ZefyrToolbar.kToolbarHeight,
320
-          child: Container(child: rightArrow, color: theme.color),
321
-        ),
322
-      ],
323
-    );
362
+    return ClipRect(child: list);
363
+    
364
+    // Row(
365
+    //   children: <Widget>[
366
+    //     SizedBox(
367
+    //       width: 12.0,
368
+    //       height: ZefyrToolbar.kToolbarHeight,
369
+    //       child: Container(child: leftArrow, color: theme.color),
370
+    //     ),
371
+    //     Expanded(child: ClipRect(child: list)),
372
+    //     SizedBox(
373
+    //       width: 12.0,
374
+    //       height: ZefyrToolbar.kToolbarHeight,
375
+    //       child: Container(child: rightArrow, color: theme.color),
376
+    //     ),
377
+    //   ],
378
+    // );
324 379
   }
325 380
 
326 381
   void _handleScroll() {
@@ -334,40 +389,7 @@ class _ZefyrButtonListState extends State<ZefyrButtonList> {
334 389
 }
335 390
 
336 391
 class _DefaultZefyrToolbarDelegate implements ZefyrToolbarDelegate {
337
-  static const kDefaultButtonIcons = {
338
-    ZefyrToolbarAction.bold: Icons.format_bold,
339
-    ZefyrToolbarAction.italic: Icons.format_italic,
340
-    ZefyrToolbarAction.link: Icons.link,
341
-    ZefyrToolbarAction.unlink: Icons.link_off,
342
-    ZefyrToolbarAction.clipboardCopy: Icons.content_copy,
343
-    ZefyrToolbarAction.openInBrowser: Icons.open_in_new,
344
-    ZefyrToolbarAction.heading: Icons.format_size,
345
-    ZefyrToolbarAction.bulletList: Icons.format_list_bulleted,
346
-    ZefyrToolbarAction.numberList: Icons.format_list_numbered,
347
-    ZefyrToolbarAction.code: Icons.code,
348
-    ZefyrToolbarAction.quote: Icons.format_quote,
349
-    ZefyrToolbarAction.horizontalRule: Icons.remove,
350
-    ZefyrToolbarAction.image: Icons.photo,
351
-    ZefyrToolbarAction.cameraImage: Icons.photo_camera,
352
-    ZefyrToolbarAction.galleryImage: Icons.photo_library,
353
-    ZefyrToolbarAction.hideKeyboard: Icons.keyboard_hide,
354
-    ZefyrToolbarAction.close: Icons.close,
355
-    ZefyrToolbarAction.confirm: Icons.check,
356
-  };
357
-
358
-  static const kSpecialIconSizes = {
359
-    ZefyrToolbarAction.unlink: 20.0,
360
-    ZefyrToolbarAction.clipboardCopy: 20.0,
361
-    ZefyrToolbarAction.openInBrowser: 20.0,
362
-    ZefyrToolbarAction.close: 20.0,
363
-    ZefyrToolbarAction.confirm: 20.0,
364
-  };
365
-
366
-  static const kDefaultButtonTexts = {
367
-    ZefyrToolbarAction.headingLevel1: 'H1',
368
-    ZefyrToolbarAction.headingLevel2: 'H2',
369
-    ZefyrToolbarAction.headingLevel3: 'H3',
370
-  };
392
+  
371 393
 
372 394
   @override
373 395
   Widget buildButton(BuildContext context, ZefyrToolbarAction action,
@@ -385,8 +407,7 @@ class _DefaultZefyrToolbarDelegate implements ZefyrToolbarDelegate {
385 407
     } else {
386 408
       final text = kDefaultButtonTexts[action];
387 409
       assert(text != null);
388
-      final style = theme.textTheme.caption
389
-          .copyWith(fontWeight: FontWeight.bold, fontSize: 14.0);
410
+      final style = theme.textTheme.caption.copyWith(fontSize: 14.0);
390 411
       return ZefyrButton.text(
391 412
         action: action,
392 413
         text: text,

+ 1
- 1
packages/zefyr/lib/util.dart View File

@@ -37,4 +37,4 @@ int getPositionDelta(Delta user, Delta actual) {
37 37
     }
38 38
   }
39 39
   return diff;
40
-}
40
+}

+ 11
- 2
packages/zefyr/pubspec.yaml View File

@@ -5,7 +5,7 @@ author: Anatoly Pulyaevskiy <anatoly.pulyaevskiy@gmail.com>
5 5
 homepage: https://github.com/memspace/zefyr
6 6
 
7 7
 environment:
8
-  sdk: '>=2.2.2 <3.0.0'
8
+  sdk: '>=2.7.0 <3.0.0'
9 9
 
10 10
 dependencies:
11 11
   flutter:
@@ -13,11 +13,20 @@ dependencies:
13 13
   collection: ^1.14.6
14 14
   url_launcher: ^5.0.0
15 15
   quill_delta: ^1.0.1
16
-  notus: ^0.1.0
16
+  notus: 
17
+    path: ../notus
17 18
   meta: ^1.1.0
18 19
   quiver_hashcode: ^2.0.0
20
+  photo_manager: ^0.5.1-dev.4
19 21
 
20 22
 dev_dependencies:
21 23
   flutter_test:
22 24
     sdk: flutter
23 25
   pedantic: ^1.0.0
26
+
27
+flutter:
28
+  uses-material-design: true
29
+  fonts:
30
+    - family: ZefyrFont
31
+      fonts:
32
+        - asset: lib/fonts/iconfont.ttf