Quellcode durchsuchen

Updated image selection test to check for toolbar; removed unused code

Anatoly Pulyaevskiy vor 6 Jahren
Ursprung
Commit
bf79a8c04d

+ 0
- 29
packages/zefyr/lib/src/widgets/editable_text.dart Datei anzeigen

@@ -55,35 +55,6 @@ class ZefyrEditableText extends StatefulWidget {
55 55
   _ZefyrEditableTextState createState() => new _ZefyrEditableTextState();
56 56
 }
57 57
 
58
-/// Provides access to shared state of [ZefyrEditableText].
59
-class _ZefyrEditableTextScope extends InheritedWidget {
60
-  static const _kEquality = const SetEquality<RenderEditableBox>();
61
-
62
-  _ZefyrEditableTextScope({
63
-    Key key,
64
-    @required Widget child,
65
-    @required this.selection,
66
-    @required this.showCursor,
67
-    @required this.renderContext,
68
-    @required this.imageDelegate,
69
-  })  : _activeBoxes = new Set.from(renderContext.active),
70
-        super(key: key, child: child);
71
-
72
-  final TextSelection selection;
73
-  final ValueNotifier<bool> showCursor;
74
-  final ZefyrRenderContext renderContext;
75
-  final ZefyrImageDelegate imageDelegate;
76
-  final Set<RenderEditableBox> _activeBoxes;
77
-
78
-  @override
79
-  bool updateShouldNotify(_ZefyrEditableTextScope oldWidget) {
80
-    return selection != oldWidget.selection ||
81
-        showCursor != oldWidget.showCursor ||
82
-        imageDelegate != oldWidget.imageDelegate ||
83
-        !_kEquality.equals(_activeBoxes, oldWidget._activeBoxes);
84
-  }
85
-}
86
-
87 58
 class _ZefyrEditableTextState extends State<ZefyrEditableText>
88 59
     with AutomaticKeepAliveClientMixin {
89 60
   //

+ 1
- 0
packages/zefyr/test/widgets/image_test.dart Datei anzeigen

@@ -105,6 +105,7 @@ void main() {
105 105
       EmbedNode embed = line.children.single;
106 106
       expect(editor.selection.baseOffset, embed.documentOffset);
107 107
       expect(editor.selection.extentOffset, embed.documentOffset + 1);
108
+      expect(find.text('Paste'), findsOneWidget);
108 109
     });
109 110
   });
110 111
 }