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
37b48007
Commit
37b48007
authored
Oct 20, 2015
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1695 from Hixie/offstage-tests
RenderOffStage test
parents
1e9e4e15
ff76ceb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+1
-1
offstage_test.dart
packages/unit/test/rendering/offstage_test.dart
+32
-0
No files found.
packages/flutter/lib/src/rendering/viewport.dart
View file @
37b48007
...
...
@@ -32,7 +32,7 @@ class RenderViewport extends RenderBox with RenderObjectWithChildMixin<RenderBox
RenderViewport
({
RenderBox
child
,
Offset
scrollOffset
,
Offset
scrollOffset
:
Offset
.
zero
,
ScrollDirection
scrollDirection:
ScrollDirection
.
vertical
})
:
_scrollOffset
=
scrollOffset
,
_scrollDirection
=
scrollDirection
{
...
...
packages/unit/test/rendering/offstage_test.dart
0 → 100644
View file @
37b48007
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:test/test.dart'
;
import
'rendering_tester.dart'
;
void
main
(
)
{
test
(
"offstage"
,
()
{
RenderBox
child
;
bool
painted
=
false
;
// viewport incoming constraints are tight 800x600
// viewport is vertical by default
RenderBox
root
=
new
RenderViewport
(
child:
new
RenderOffStage
(
child:
new
RenderCustomPaint
(
child:
child
=
new
RenderConstrainedBox
(
additionalConstraints:
new
BoxConstraints
.
tightFor
(
height:
10.0
,
width:
10.0
)
),
onPaint:
(
PaintingCanvas
canvas
,
Size
size
)
{
painted
=
true
;
}
)
)
);
expect
(
child
.
hasSize
,
isFalse
);
expect
(
painted
,
isFalse
);
layout
(
root
,
phase:
EnginePhase
.
paint
);
expect
(
child
.
hasSize
,
isTrue
);
expect
(
painted
,
isFalse
);
expect
(
child
.
size
,
equals
(
const
Size
(
800.0
,
10.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