|
@@ -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
|
//
|