lucky1213 4 yıl önce
ebeveyn
işleme
9044178051

+ 4
- 2
packages/zefyr/example/ios/Flutter/flutter_export_environment.sh Dosyayı Görüntüle

@@ -2,11 +2,13 @@
2 2
 # This is a generated file; do not edit or check into version control.
3 3
 export "FLUTTER_ROOT=/Users/imac/.fvm/versions/latest-dev"
4 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"
5
+export "FLUTTER_TARGET=lib/main.dart"
6 6
 export "FLUTTER_BUILD_DIR=build"
7 7
 export "SYMROOT=${SOURCE_ROOT}/../build/ios"
8 8
 export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
9 9
 export "FLUTTER_FRAMEWORK_DIR=/Users/imac/.fvm/versions/latest-dev/bin/cache/artifacts/engine/ios"
10 10
 export "FLUTTER_BUILD_NAME=1.0.0"
11 11
 export "FLUTTER_BUILD_NUMBER=1"
12
-export "TRACK_WIDGET_CREATION=true"
12
+export "DART_OBFUSCATION=false"
13
+export "TRACK_WIDGET_CREATION=false"
14
+export "TREE_SHAKE_ICONS=false"

+ 2
- 0
packages/zefyr/lib/src/widgets/buttons.dart Dosyayı Görüntüle

@@ -921,6 +921,8 @@ class _LinkButtonState extends State<LinkButton> {
921 921
           ));
922 922
       editor.formatSelection(NotusAttribute.link.fromString(result.url));
923 923
       editor.closeKeyboard();
924
+    } else {
925
+      editor.updateSelection(_selection, source: ChangeSource.local);
924 926
     }
925 927
   }
926 928
 

+ 1
- 1
packages/zefyr/lib/src/widgets/editable_text.dart Dosyayı Görüntüle

@@ -137,7 +137,7 @@ class ZefyrEditableTextState extends State<ZefyrEditableText>
137 137
 
138 138
   TextSelectionControls defaultSelectionControls(BuildContext context) {
139 139
     TargetPlatform platform = Theme.of(context).platform;
140
-    if (platform == TargetPlatform.iOS) {
140
+    if (platform == TargetPlatform.iOS || platform == TargetPlatform.macOS) {
141 141
       return cupertinoTextSelectionControls;
142 142
     }
143 143
     return materialTextSelectionControls;

+ 1
- 0
packages/zefyr/lib/src/widgets/theme.dart Dosyayı Görüntüle

@@ -360,6 +360,7 @@ class AttributeTheme {
360 360
     String monospaceFontFamily;
361 361
     switch (theme.platform) {
362 362
       case TargetPlatform.iOS:
363
+      case TargetPlatform.macOS:
363 364
         monospaceFontFamily = 'Menlo';
364 365
         break;
365 366
       case TargetPlatform.android:

+ 18
- 19
packages/zefyr/lib/src/widgets/toolbar.dart Dosyayı Görüntüle

@@ -311,6 +311,20 @@ class ZefyrToolbarState extends State<ZefyrToolbar>
311 311
     super.dispose();
312 312
   }
313 313
 
314
+  Widget buildTrailing() {
315
+    Widget widget;
316
+    TargetPlatform platform = Theme.of(context).platform;
317
+    switch (platform) {
318
+      case TargetPlatform.iOS:
319
+      case TargetPlatform.android:
320
+        widget = hasOverlay ? buildButton(context, ZefyrToolbarAction.showKeyboard) : buildButton(context, ZefyrToolbarAction.hideKeyboard);
321
+        break;
322
+      default:
323
+        break;
324
+    }
325
+    return widget;
326
+  }
327
+
314 328
   @override
315 329
   Widget build(BuildContext context) {
316 330
     if (MediaQuery.of(context).viewInsets.bottom > 0) {
@@ -326,10 +340,11 @@ class ZefyrToolbarState extends State<ZefyrToolbar>
326 340
     );
327 341
     final layers = <Widget>[];
328 342
     Widget overlay;
329
-
343
+    var trailing = buildTrailing();
330 344
     // Must set unique key for the toolbar to prevent it from reconstructing
331 345
     // new state each time we toggle overlay.
332 346
     final bottons = <Widget>[
347
+      if (trailing != null)
333 348
       kToolbarDivider,
334 349
       Expanded(child: ListView(
335 350
         scrollDirection: Axis.horizontal,
@@ -353,7 +368,8 @@ class ZefyrToolbarState extends State<ZefyrToolbar>
353 368
       body: Row(
354 369
         children: bottons,
355 370
       ),
356
-      trailing: hasOverlay ? buildButton(context, ZefyrToolbarAction.showKeyboard) : buildButton(context, ZefyrToolbarAction.hideKeyboard),
371
+      trailing: trailing,
372
+      autoImplyTrailing: false,
357 373
     );
358 374
     layers.add(toolbar);
359 375
     if (hasOverlay) {
@@ -384,23 +400,6 @@ class ZefyrToolbarState extends State<ZefyrToolbar>
384 400
       ),
385 401
     );
386 402
   }
387
-
388
-  List<Widget> _buildButtons(BuildContext context) {
389
-    final buttons = <Widget>[
390
-      HeadingButton(),
391
-      buildButton(context, ZefyrToolbarAction.emoji),
392
-      if (editor.imageDelegate != null) ImageButton(),
393
-      // ImageButton(),
394
-      LinkButton(),
395
-      
396
-      // buildButton(context, ZefyrToolbarAction.bulletList),
397
-      // buildButton(context, ZefyrToolbarAction.numberList),
398
-      // buildButton(context, ZefyrToolbarAction.quote),
399
-      // buildButton(context, ZefyrToolbarAction.code),
400
-      // buildButton(context, ZefyrToolbarAction.horizontalRule),
401
-    ];
402
-    return buttons;
403
-  }
404 403
 }
405 404
 
406 405
 /// Scrollable list of toolbar buttons.