@@ -562,6 +562,32 @@ void main() {
562
562
expect (client.latestMethodCall, 'performPrivateCommand' );
563
563
});
564
564
565
+ test ('TextInputClient performPrivateCommand method is called with no data at all' , () async {
566
+ // Assemble a TextInputConnection so we can verify its change in state.
567
+ final FakeTextInputClient client = FakeTextInputClient (TextEditingValue .empty);
568
+ const TextInputConfiguration configuration = TextInputConfiguration ();
569
+ TextInput .attach (client, configuration);
570
+
571
+ expect (client.latestMethodCall, isEmpty);
572
+
573
+ // Send performPrivateCommand message.
574
+ final ByteData ? messageBytes = const JSONMessageCodec ().encodeMessage (< String , dynamic > {
575
+ 'args' : < dynamic > [
576
+ 1 ,
577
+ jsonDecode ('{"action": "actionCommand"}' ), // No `data` parameter.
578
+ ],
579
+ 'method' : 'TextInputClient.performPrivateCommand' ,
580
+ });
581
+ await ServicesBinding .instance.defaultBinaryMessenger.handlePlatformMessage (
582
+ 'flutter/textinput' ,
583
+ messageBytes,
584
+ (ByteData ? _) {},
585
+ );
586
+
587
+ expect (client.latestMethodCall, 'performPrivateCommand' );
588
+ expect (client.latestPrivateCommandData, < String , dynamic > {});
589
+ });
590
+
565
591
test ('TextInputClient showAutocorrectionPromptRect method is called' , () async {
566
592
// Assemble a TextInputConnection so we can verify its change in state.
567
593
final FakeTextInputClient client = FakeTextInputClient (TextEditingValue .empty);
@@ -933,6 +959,7 @@ class FakeTextInputClient with TextInputClient {
933
959
934
960
String latestMethodCall = '' ;
935
961
final List <String > performedSelectors = < String > [];
962
+ late Map <String , dynamic >? latestPrivateCommandData;
936
963
937
964
@override
938
965
TextEditingValue currentTextEditingValue;
@@ -946,8 +973,9 @@ class FakeTextInputClient with TextInputClient {
946
973
}
947
974
948
975
@override
949
- void performPrivateCommand (String action, Map <String , dynamic > data) {
976
+ void performPrivateCommand (String action, Map <String , dynamic >? data) {
950
977
latestMethodCall = 'performPrivateCommand' ;
978
+ latestPrivateCommandData = data;
951
979
}
952
980
953
981
@override
0 commit comments