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
e0f37027
Commit
e0f37027
authored
Jul 01, 2016
by
Adam Barth
Committed by
GitHub
Jul 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some tests for these tweens (#4804)
parent
8cf2c170
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
implicit_animations_test.dart
packages/flutter/test/widget/implicit_animations_test.dart
+50
-0
No files found.
packages/flutter/test/widget/implicit_animations_test.dart
0 → 100644
View file @
e0f37027
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/widgets.dart'
;
void
main
(
)
{
testWidgets
(
'BoxConstraintsTween control test'
,
(
WidgetTester
tester
)
async
{
BoxConstraintsTween
tween
=
new
BoxConstraintsTween
(
begin:
new
BoxConstraints
.
tight
(
new
Size
(
20.0
,
50.0
)),
end:
new
BoxConstraints
.
tight
(
new
Size
(
10.0
,
30.0
))
);
BoxConstraints
result
=
tween
.
lerp
(
0.25
);
expect
(
result
.
minWidth
,
17.5
);
expect
(
result
.
maxWidth
,
17.5
);
expect
(
result
.
minHeight
,
45.0
);
expect
(
result
.
maxHeight
,
45.0
);
});
testWidgets
(
'DecorationTween control test'
,
(
WidgetTester
tester
)
async
{
DecorationTween
tween
=
new
DecorationTween
(
begin:
new
BoxDecoration
(
backgroundColor:
new
Color
(
0xFF00FF00
)),
end:
new
BoxDecoration
(
backgroundColor:
new
Color
(
0xFFFFFF00
))
);
BoxDecoration
result
=
tween
.
lerp
(
0.25
);
expect
(
result
.
backgroundColor
,
new
Color
(
0xFF3FFF00
));
});
testWidgets
(
'EdgeInsetsTween control test'
,
(
WidgetTester
tester
)
async
{
EdgeInsetsTween
tween
=
new
EdgeInsetsTween
(
begin:
new
EdgeInsets
.
symmetric
(
vertical:
50.0
),
end:
new
EdgeInsets
.
only
(
top:
10.0
,
bottom:
30.0
)
);
EdgeInsets
result
=
tween
.
lerp
(
0.25
);
expect
(
result
.
left
,
0.0
);
expect
(
result
.
right
,
0.0
);
expect
(
result
.
top
,
40.0
);
expect
(
result
.
bottom
,
45.0
);
});
testWidgets
(
'Matrix4Tween control test'
,
(
WidgetTester
tester
)
async
{
Matrix4Tween
tween
=
new
Matrix4Tween
(
begin:
new
Matrix4
.
translationValues
(
10.0
,
20.0
,
30.0
),
end:
new
Matrix4
.
translationValues
(
14.0
,
24.0
,
34.0
)
);
Matrix4
result
=
tween
.
lerp
(
0.25
);
expect
(
result
,
equals
(
new
Matrix4
.
translationValues
(
11.0
,
21.0
,
31.0
)));
});
}
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