Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
94d7f5e6
Unverified
Commit
94d7f5e6
authored
Apr 16, 2022
by
ColdPaleLight
Committed by
GitHub
Apr 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor 'FakeSceneBuilder' to use 'NoSuchMethod Forwarding' (#101970)
parent
f1e4018b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
layers_test.dart
packages/flutter/test/rendering/layers_test.dart
+18
-17
No files found.
packages/flutter/test/rendering/layers_test.dart
View file @
94d7f5e6
...
...
@@ -756,27 +756,28 @@ class FakeSceneBuilder extends Fake implements SceneBuilder {
}
bool
pushedOpacity
=
false
;
bool
pushedOffset
=
false
;
bool
addedPicture
=
false
;
@override
OpacityEngineLayer
pushOpacity
(
int
alpha
,
{
Offset
?
offset
=
Offset
.
zero
,
OpacityEngineLayer
?
oldLayer
})
{
dynamic
noSuchMethod
(
Invocation
invocation
)
{
// Use noSuchMethod forwarding instead of override these methods to make it easier
// for these methods to add new optional arguments in the future.
switch
(
invocation
.
memberName
)
{
case
#pushOpacity
:
pushedOpacity
=
true
;
return
FakeOpacityEngineLayer
();
}
bool
pushedOffset
=
false
;
@override
OffsetEngineLayer
pushOffset
(
double
x
,
double
y
,
{
OffsetEngineLayer
?
oldLayer
})
{
case
#pushOffset
:
pushedOffset
=
true
;
return
FakeOffsetEngineLayer
();
}
bool
addedPicture
=
false
;
@override
void
addPicture
(
Offset
offset
,
Picture
picture
,
{
bool
isComplexHint
=
false
,
bool
willChangeHint
=
false
})
{
case
#addPicture
:
addedPicture
=
true
;
return
;
case
#pop
:
return
;
}
super
.
noSuchMethod
(
invocation
);
}
@override
void
pop
()
{}
}
class
FakeOpacityEngineLayer
extends
FakeEngineLayer
implements
OpacityEngineLayer
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment