未验证 提交 548c78c3 编写于 作者: X xubaolin 提交者: GitHub

fix a LateInitializationError (#26492)

上级 f21e64f5
......@@ -1487,6 +1487,14 @@ class TextInputSetCaretRect extends TextInputCommand {
}
}
class TextInputRequestAutofill extends TextInputCommand {
const TextInputRequestAutofill();
void run(HybridTextEditing textEditing) {
// No-op: not supported on this platform.
}
}
class TextInputFinishAutofillContext extends TextInputCommand {
TextInputFinishAutofillContext({
required this.saveForm,
......@@ -1544,7 +1552,7 @@ class TextEditingChannel {
ByteData? data, ui.PlatformMessageResponseCallback? callback) {
const JSONMethodCodec codec = JSONMethodCodec();
final MethodCall call = codec.decodeMethodCall(data);
late final TextInputCommand command;
final TextInputCommand command;
switch (call.method) {
case 'TextInput.setClient':
command = TextInputSetClient(
......@@ -1595,6 +1603,7 @@ class TextEditingChannel {
// There's no API to request autofill on the web. Instead we let the
// browser show autofill options automatically, if available. We
// therefore simply ignore this message.
command = const TextInputRequestAutofill();
break;
case 'TextInput.finishAutofillContext':
......
......@@ -435,6 +435,13 @@ void testMain() {
textEditing = null;
});
test('TextInput.requestAutofill', () async {
final MethodCall requestAutofill = MethodCall('TextInput.requestAutofill');
sendFrameworkMessage(codec.encodeMethodCall(requestAutofill));
//No-op and without crashing.
});
test('setClient, show, setEditingState, hide', () {
final MethodCall setClient = MethodCall(
'TextInput.setClient', <dynamic>[123, flutterSinglelineConfig]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册