|
@@ -39,7 +39,7 @@ class ZefyrEditableText extends StatefulWidget {
|
39
|
39
|
this.selectionControls,
|
40
|
40
|
this.autofocus = true,
|
41
|
41
|
this.mode = ZefyrMode.edit,
|
42
|
|
- @required this.input,
|
|
42
|
+ // @required this.input,
|
43
|
43
|
this.padding = const EdgeInsets.symmetric(horizontal: 16.0),
|
44
|
44
|
this.physics,
|
45
|
45
|
this.keyboardAppearance = Brightness.light,
|
|
@@ -68,7 +68,7 @@ class ZefyrEditableText extends StatefulWidget {
|
68
|
68
|
/// Editing mode of this text field.
|
69
|
69
|
final ZefyrMode mode;
|
70
|
70
|
|
71
|
|
- final InputConnectionController input;
|
|
71
|
+ // final InputConnectionController input;
|
72
|
72
|
|
73
|
73
|
/// Controls physics of scrollable text field.
|
74
|
74
|
final ScrollPhysics physics;
|
|
@@ -89,10 +89,10 @@ class ZefyrEditableText extends StatefulWidget {
|
89
|
89
|
final Brightness keyboardAppearance;
|
90
|
90
|
|
91
|
91
|
@override
|
92
|
|
- _ZefyrEditableTextState createState() => _ZefyrEditableTextState();
|
|
92
|
+ ZefyrEditableTextState createState() => ZefyrEditableTextState();
|
93
|
93
|
}
|
94
|
94
|
|
95
|
|
-class _ZefyrEditableTextState extends State<ZefyrEditableText>
|
|
95
|
+class ZefyrEditableTextState extends State<ZefyrEditableText>
|
96
|
96
|
with AutomaticKeepAliveClientMixin {
|
97
|
97
|
//
|
98
|
98
|
// New public members
|
|
@@ -176,6 +176,10 @@ class _ZefyrEditableTextState extends State<ZefyrEditableText>
|
176
|
176
|
_focusNode = widget.focusNode;
|
177
|
177
|
super.initState();
|
178
|
178
|
_focusAttachment = _focusNode.attach(context);
|
|
179
|
+ // widget.controller.updateSelection(TextSelection.collapsed(offset: widget.controller.plainTextEditingValue.text.length));
|
|
180
|
+ _input = InputConnectionController(_handleRemoteValueChange);
|
|
181
|
+ // ..openConnection(widget.controller.plainTextEditingValue, widget.keyboardAppearance, showKeyboard: false);
|
|
182
|
+
|
179
|
183
|
_updateSubscriptions();
|
180
|
184
|
}
|
181
|
185
|
|
|
@@ -205,6 +209,7 @@ class _ZefyrEditableTextState extends State<ZefyrEditableText>
|
205
|
209
|
_cursorTimer = scope.cursorTimer;
|
206
|
210
|
_cursorTimer.startOrStop(_focusNode, selection);
|
207
|
211
|
}
|
|
212
|
+ print(FocusScope.of(context));
|
208
|
213
|
focusOrUnfocusIfNeeded();
|
209
|
214
|
}
|
210
|
215
|
|
|
@@ -229,7 +234,8 @@ class _ZefyrEditableTextState extends State<ZefyrEditableText>
|
229
|
234
|
final ScrollController _scrollController = ScrollController();
|
230
|
235
|
ZefyrRenderContext _renderContext;
|
231
|
236
|
CursorTimer _cursorTimer;
|
232
|
|
- InputConnectionController get _input => widget.input;
|
|
237
|
+ InputConnectionController _input;
|
|
238
|
+ // InputConnectionController get _input => widget.input;
|
233
|
239
|
bool _didAutoFocus = false;
|
234
|
240
|
|
235
|
241
|
List<Widget> _buildChildren(BuildContext context) {
|
|
@@ -248,9 +254,6 @@ class _ZefyrEditableTextState extends State<ZefyrEditableText>
|
248
|
254
|
return ZefyrHeading(node: node);
|
249
|
255
|
}
|
250
|
256
|
return ZefyrParagraph(node: node);
|
251
|
|
- // else if (node.style.contains(NotusAttribute.line)) {
|
252
|
|
- // return ZefyrLineDecoration(node: node);
|
253
|
|
- // }
|
254
|
257
|
}
|
255
|
258
|
|
256
|
259
|
final BlockNode block = node;
|
|
@@ -283,7 +286,7 @@ class _ZefyrEditableTextState extends State<ZefyrEditableText>
|
283
|
286
|
if (widget.focusNode != oldWidget.focusNode) {
|
284
|
287
|
oldWidget.focusNode.removeListener(_handleFocusChange);
|
285
|
288
|
widget.focusNode.addListener(_handleFocusChange);
|
286
|
|
- updateKeepAlive();
|
|
289
|
+ // updateKeepAlive();
|
287
|
290
|
}
|
288
|
291
|
}
|
289
|
292
|
|
|
@@ -320,7 +323,7 @@ class _ZefyrEditableTextState extends State<ZefyrEditableText>
|
320
|
323
|
_input.openOrCloseConnection(_focusNode,
|
321
|
324
|
widget.controller.plainTextEditingValue, widget.keyboardAppearance, showKeyboard: showKeyboard);
|
322
|
325
|
_cursorTimer.startOrStop(_focusNode, selection);
|
323
|
|
- updateKeepAlive();
|
|
326
|
+ // updateKeepAlive();
|
324
|
327
|
}
|
325
|
328
|
|
326
|
329
|
void _handleRemoteValueChange(
|