Unverified Commit fed6887a authored by Ferhat's avatar Ferhat Committed by GitHub

Remove implements Function (#53113)

parent 197ac525
...@@ -12,10 +12,10 @@ import '../rendering/mock_canvas.dart'; ...@@ -12,10 +12,10 @@ import '../rendering/mock_canvas.dart';
import '../widgets/semantics_tester.dart'; import '../widgets/semantics_tester.dart';
import 'feedback_tester.dart'; import 'feedback_tester.dart';
class MockOnPressedFunction implements Function { class MockOnPressedFunction {
int called = 0; int called = 0;
void call() { void handler() {
called++; called++;
} }
} }
...@@ -31,7 +31,7 @@ void main() { ...@@ -31,7 +31,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
wrap( wrap(
child: IconButton( child: IconButton(
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.link), icon: const Icon(Icons.link),
), ),
), ),
...@@ -49,7 +49,7 @@ void main() { ...@@ -49,7 +49,7 @@ void main() {
wrap( wrap(
child: IconButton( child: IconButton(
iconSize: 10.0, iconSize: 10.0,
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.link), icon: const Icon(Icons.link),
), ),
), ),
...@@ -65,7 +65,7 @@ void main() { ...@@ -65,7 +65,7 @@ void main() {
child: IconButton( child: IconButton(
iconSize: 10.0, iconSize: 10.0,
padding: const EdgeInsets.all(30.0), padding: const EdgeInsets.all(30.0),
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.link), icon: const Icon(Icons.link),
), ),
), ),
...@@ -80,7 +80,7 @@ void main() { ...@@ -80,7 +80,7 @@ void main() {
wrap( wrap(
child: IconButton( child: IconButton(
iconSize: 10.0, iconSize: 10.0,
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.link), icon: const Icon(Icons.link),
constraints: const BoxConstraints(), constraints: const BoxConstraints(),
), ),
...@@ -100,7 +100,7 @@ void main() { ...@@ -100,7 +100,7 @@ void main() {
child: IconButton( child: IconButton(
iconSize: 10.0, iconSize: 10.0,
padding: const EdgeInsets.all(3.0), padding: const EdgeInsets.all(3.0),
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.link), icon: const Icon(Icons.link),
constraints: const BoxConstraints(), constraints: const BoxConstraints(),
), ),
...@@ -121,7 +121,7 @@ void main() { ...@@ -121,7 +121,7 @@ void main() {
data: ThemeData(visualDensity: const VisualDensity(horizontal: 1, vertical: -1)), data: ThemeData(visualDensity: const VisualDensity(horizontal: 1, vertical: -1)),
child: IconButton( child: IconButton(
iconSize: 10.0, iconSize: 10.0,
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.link), icon: const Icon(Icons.link),
constraints: const BoxConstraints(minWidth: 32.0, minHeight: 32.0), constraints: const BoxConstraints(minWidth: 32.0, minHeight: 32.0),
), ),
...@@ -143,7 +143,7 @@ void main() { ...@@ -143,7 +143,7 @@ void main() {
wrap( wrap(
child: IconButton( child: IconButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
iconSize: 80.0, iconSize: 80.0,
), ),
...@@ -163,7 +163,7 @@ void main() { ...@@ -163,7 +163,7 @@ void main() {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget> [ children: <Widget> [
IconButton( IconButton(
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
), ),
], ],
...@@ -180,7 +180,7 @@ void main() { ...@@ -180,7 +180,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
wrap( wrap(
child: IconButton( child: IconButton(
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
iconSize: 80.0, iconSize: 80.0,
), ),
...@@ -197,7 +197,7 @@ void main() { ...@@ -197,7 +197,7 @@ void main() {
home: Material( home: Material(
child: Center( child: Center(
child: IconButton( child: IconButton(
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
), ),
), ),
...@@ -215,7 +215,7 @@ void main() { ...@@ -215,7 +215,7 @@ void main() {
home: Material( home: Material(
child: Center( child: Center(
child: IconButton( child: IconButton(
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
tooltip: 'Test tooltip', tooltip: 'Test tooltip',
), ),
...@@ -239,7 +239,7 @@ void main() { ...@@ -239,7 +239,7 @@ void main() {
actions: <Widget>[ actions: <Widget>[
IconButton( IconButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
), ),
], ],
...@@ -343,7 +343,7 @@ void main() { ...@@ -343,7 +343,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
wrap( wrap(
child: IconButton( child: IconButton(
onPressed: mockOnPressedFunction, onPressed: mockOnPressedFunction.handler,
icon: const Icon(Icons.link, semanticLabel: 'link'), icon: const Icon(Icons.link, semanticLabel: 'link'),
), ),
), ),
......
...@@ -6,10 +6,10 @@ import 'package:flutter/material.dart'; ...@@ -6,10 +6,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class MockOnEndFunction implements Function { class MockOnEndFunction {
int called = 0; int called = 0;
void call() { void handler() {
called++; called++;
} }
} }
...@@ -70,7 +70,7 @@ void main() { ...@@ -70,7 +70,7 @@ void main() {
testWidgets('AnimatedContainer onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedContainer onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedContainerWidgetState(), state: _TestAnimatedContainerWidgetState(),
) )
...@@ -91,7 +91,7 @@ void main() { ...@@ -91,7 +91,7 @@ void main() {
testWidgets('AnimatedPadding onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedPadding onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedPaddingWidgetState(), state: _TestAnimatedPaddingWidgetState(),
) )
...@@ -112,7 +112,7 @@ void main() { ...@@ -112,7 +112,7 @@ void main() {
testWidgets('AnimatedAlign onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedAlign onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedAlignWidgetState(), state: _TestAnimatedAlignWidgetState(),
) )
...@@ -133,7 +133,7 @@ void main() { ...@@ -133,7 +133,7 @@ void main() {
testWidgets('AnimatedPositioned onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedPositioned onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedPositionedWidgetState(), state: _TestAnimatedPositionedWidgetState(),
) )
...@@ -154,7 +154,7 @@ void main() { ...@@ -154,7 +154,7 @@ void main() {
testWidgets('AnimatedPositionedDirectional onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedPositionedDirectional onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedPositionedDirectionalWidgetState(), state: _TestAnimatedPositionedDirectionalWidgetState(),
) )
...@@ -175,7 +175,7 @@ void main() { ...@@ -175,7 +175,7 @@ void main() {
testWidgets('AnimatedOpacity onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedOpacity onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedOpacityWidgetState(), state: _TestAnimatedOpacityWidgetState(),
) )
...@@ -223,7 +223,7 @@ void main() { ...@@ -223,7 +223,7 @@ void main() {
testWidgets('SliverAnimatedOpacity onEnd callback test', (WidgetTester tester) async { testWidgets('SliverAnimatedOpacity onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(TestAnimatedWidget( await tester.pumpWidget(TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestSliverAnimatedOpacityWidgetState(), state: _TestSliverAnimatedOpacityWidgetState(),
)); ));
...@@ -271,7 +271,7 @@ void main() { ...@@ -271,7 +271,7 @@ void main() {
testWidgets('AnimatedDefaultTextStyle onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedDefaultTextStyle onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedDefaultTextStyleWidgetState(), state: _TestAnimatedDefaultTextStyleWidgetState(),
) )
...@@ -292,7 +292,7 @@ void main() { ...@@ -292,7 +292,7 @@ void main() {
testWidgets('AnimatedPhysicalModel onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedPhysicalModel onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedPhysicalModelWidgetState(), state: _TestAnimatedPhysicalModelWidgetState(),
) )
...@@ -313,7 +313,7 @@ void main() { ...@@ -313,7 +313,7 @@ void main() {
testWidgets('TweenAnimationBuilder onEnd callback test', (WidgetTester tester) async { testWidgets('TweenAnimationBuilder onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestTweenAnimationBuilderWidgetState(), state: _TestTweenAnimationBuilderWidgetState(),
) )
...@@ -334,7 +334,7 @@ void main() { ...@@ -334,7 +334,7 @@ void main() {
testWidgets('AnimatedTheme onEnd callback test', (WidgetTester tester) async { testWidgets('AnimatedTheme onEnd callback test', (WidgetTester tester) async {
await tester.pumpWidget(wrap( await tester.pumpWidget(wrap(
child: TestAnimatedWidget( child: TestAnimatedWidget(
callback: mockOnEndFunction, callback: mockOnEndFunction.handler,
switchKey: switchKey, switchKey: switchKey,
state: _TestAnimatedThemeWidgetState(), state: _TestAnimatedThemeWidgetState(),
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment