@@ -591,16 +591,16 @@ void main() {
591
591
controller.selection = new TextSelection .collapsed (offset: controller.text.length);
592
592
593
593
controls = new MockTextSelectionControls ();
594
- when (controls.buildHandle (any, any, any)).thenReturn (new Container ());
595
- when (controls.buildToolbar (any, any, any, any)).thenReturn (new Container ());
594
+ when (controls.buildHandle (typed ( any), typed ( any), typed ( any) )).thenReturn (new Container ());
595
+ when (controls.buildToolbar (typed ( any), typed ( any), typed ( any), typed ( any) )).thenReturn (new Container ());
596
596
});
597
597
598
598
testWidgets ('are exposed' , (WidgetTester tester) async {
599
599
final SemanticsTester semantics = new SemanticsTester (tester);
600
600
601
- when (controls.canCopy (any)).thenReturn (false );
602
- when (controls.canCut (any)).thenReturn (false );
603
- when (controls.canPaste (any)).thenReturn (false );
601
+ when (controls.canCopy (typed ( any) )).thenReturn (false );
602
+ when (controls.canCut (typed ( any) )).thenReturn (false );
603
+ when (controls.canPaste (typed ( any) )).thenReturn (false );
604
604
605
605
await _buildApp (controls, tester);
606
606
await tester.tap (find.byType (EditableText ));
@@ -614,7 +614,7 @@ void main() {
614
614
],
615
615
));
616
616
617
- when (controls.canCopy (any)).thenReturn (true );
617
+ when (controls.canCopy (typed ( any) )).thenReturn (true );
618
618
await _buildApp (controls, tester);
619
619
expect (semantics, includesNodeWith (
620
620
value: 'test' ,
@@ -625,8 +625,8 @@ void main() {
625
625
],
626
626
));
627
627
628
- when (controls.canCopy (any)).thenReturn (false );
629
- when (controls.canPaste (any)).thenReturn (true );
628
+ when (controls.canCopy (typed ( any) )).thenReturn (false );
629
+ when (controls.canPaste (typed ( any) )).thenReturn (true );
630
630
await _buildApp (controls, tester);
631
631
expect (semantics, includesNodeWith (
632
632
value: 'test' ,
@@ -637,8 +637,8 @@ void main() {
637
637
],
638
638
));
639
639
640
- when (controls.canPaste (any)).thenReturn (false );
641
- when (controls.canCut (any)).thenReturn (true );
640
+ when (controls.canPaste (typed ( any) )).thenReturn (false );
641
+ when (controls.canCut (typed ( any) )).thenReturn (true );
642
642
await _buildApp (controls, tester);
643
643
expect (semantics, includesNodeWith (
644
644
value: 'test' ,
@@ -649,9 +649,9 @@ void main() {
649
649
],
650
650
));
651
651
652
- when (controls.canCopy (any)).thenReturn (true );
653
- when (controls.canCut (any)).thenReturn (true );
654
- when (controls.canPaste (any)).thenReturn (true );
652
+ when (controls.canCopy (typed ( any) )).thenReturn (true );
653
+ when (controls.canCut (typed ( any) )).thenReturn (true );
654
+ when (controls.canPaste (typed ( any) )).thenReturn (true );
655
655
await _buildApp (controls, tester);
656
656
expect (semantics, includesNodeWith (
657
657
value: 'test' ,
@@ -670,9 +670,9 @@ void main() {
670
670
testWidgets ('can copy/cut/paste with a11y' , (WidgetTester tester) async {
671
671
final SemanticsTester semantics = new SemanticsTester (tester);
672
672
673
- when (controls.canCopy (any)).thenReturn (true );
674
- when (controls.canCut (any)).thenReturn (true );
675
- when (controls.canPaste (any)).thenReturn (true );
673
+ when (controls.canCopy (typed ( any) )).thenReturn (true );
674
+ when (controls.canCut (typed ( any) )).thenReturn (true );
675
+ when (controls.canPaste (typed ( any) )).thenReturn (true );
676
676
await _buildApp (controls, tester);
677
677
await tester.tap (find.byType (EditableText ));
678
678
await tester.pump ();
@@ -703,13 +703,13 @@ void main() {
703
703
), ignoreRect: true , ignoreTransform: true ));
704
704
705
705
owner.performAction (expectedNodeId, SemanticsAction .copy);
706
- verify (controls.handleCopy (any)).called (1 );
706
+ verify (controls.handleCopy (typed ( any) )).called (1 );
707
707
708
708
owner.performAction (expectedNodeId, SemanticsAction .cut);
709
- verify (controls.handleCut (any)).called (1 );
709
+ verify (controls.handleCut (typed ( any) )).called (1 );
710
710
711
711
owner.performAction (expectedNodeId, SemanticsAction .paste);
712
- verify (controls.handlePaste (any)).called (1 );
712
+ verify (controls.handlePaste (typed ( any) )).called (1 );
713
713
714
714
semantics.dispose ();
715
715
});
0 commit comments