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
0d63d6b7
Commit
0d63d6b7
authored
Sep 24, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port most of scrollable.dart to fn3
parent
e7bc8f57
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
561 additions
and
13 deletions
+561
-13
homogeneous_viewport.dart
packages/flutter/lib/src/fn3/homogeneous_viewport.dart
+2
-2
scrollable.dart
packages/flutter/lib/src/fn3/scrollable.dart
+548
-0
coordinates_test.dart
packages/unit/test/fn3/coordinates_test.dart
+4
-4
homogeneous_viewport_test.dart
packages/unit/test/fn3/homogeneous_viewport_test.dart
+7
-6
block_test.dart
packages/unit/test/widget/block_test.dart
+0
-1
No files found.
packages/flutter/lib/src/fn3/homogeneous_viewport.dart
View file @
0d63d6b7
...
...
@@ -8,7 +8,7 @@ import 'package:sky/rendering.dart';
import
'package:sky/src/fn3/framework.dart'
;
import
'package:sky/src/fn3/basic.dart'
;
typedef
List
<
Widget
>
ListBuilder
(
int
startIndex
,
int
count
,
BuildContext
contex
t
);
typedef
List
<
Widget
>
ListBuilder
(
BuildContext
context
,
int
startIndex
,
int
coun
t
);
class
HomogeneousViewport
extends
RenderObjectWidget
{
HomogeneousViewport
({
...
...
@@ -137,7 +137,7 @@ class HomogeneousViewportElement extends RenderObjectElement<HomogeneousViewport
assert
(
_layoutItemCount
!=
null
);
List
<
Widget
>
newWidgets
;
if
(
_layoutItemCount
>
0
)
newWidgets
=
widget
.
builder
(
_layoutFirstIndex
,
_layoutItemCount
,
this
);
newWidgets
=
widget
.
builder
(
this
,
_layoutFirstIndex
,
_layoutItemCount
);
else
newWidgets
=
<
Widget
>[];
_children
=
updateChildren
(
_children
,
newWidgets
);
...
...
packages/flutter/lib/src/fn3/scrollable.dart
0 → 100644
View file @
0d63d6b7
This diff is collapsed.
Click to expand it.
packages/unit/test/fn3/coordinates_test.dart
View file @
0d63d6b7
import
'package:sky/rendering.dart'
;
import
'package:sky/src/fn3.dart'
;
import
'package:test/test.dart'
;
...
...
@@ -9,7 +10,6 @@ void main() {
Key
keyA
=
new
GlobalKey
();
Key
keyB
=
new
GlobalKey
();
Key
keyC
=
new
GlobalKey
();
tester
.
pumpFrame
(
new
Stack
([
...
...
@@ -34,13 +34,13 @@ void main() {
])
);
expect
(
tester
.
findElementByKey
(
keyA
).
renderObject
.
localToGlobal
(
const
Point
(
0.0
,
0.0
)),
expect
(
(
tester
.
findElementByKey
(
keyA
).
renderObject
as
RenderBox
)
.
localToGlobal
(
const
Point
(
0.0
,
0.0
)),
equals
(
const
Point
(
100.0
,
100.0
)));
expect
(
tester
.
findElementByKey
(
keyB
).
renderObject
.
localToGlobal
(
const
Point
(
0.0
,
0.0
)),
expect
(
(
tester
.
findElementByKey
(
keyB
).
renderObject
as
RenderBox
)
.
localToGlobal
(
const
Point
(
0.0
,
0.0
)),
equals
(
const
Point
(
100.0
,
200.0
)));
expect
(
tester
.
findElementByKey
(
keyB
).
renderObject
.
globalToLocal
(
const
Point
(
110.0
,
205.0
)),
expect
(
(
tester
.
findElementByKey
(
keyB
).
renderObject
as
RenderBox
)
.
globalToLocal
(
const
Point
(
110.0
,
205.0
)),
equals
(
const
Point
(
10.0
,
5.0
)));
});
}
packages/unit/test/fn3/homogeneous_viewport_test.dart
View file @
0d63d6b7
...
...
@@ -33,7 +33,7 @@ void main() {
Widget
builder
()
{
return
new
TestComponent
(
new
HomogeneousViewport
(
builder:
(
int
start
,
int
count
,
BuildContext
contex
t
)
{
builder:
(
BuildContext
context
,
int
start
,
int
coun
t
)
{
List
<
Widget
>
result
=
<
Widget
>[];
for
(
int
index
=
start
;
index
<
start
+
count
;
index
+=
1
)
{
callbackTracker
.
add
(
index
);
...
...
@@ -52,18 +52,19 @@ void main() {
tester
.
pumpFrame
(
builder
());
TestComponentState
testComponent
=
tester
.
findElement
((
element
)
=>
element
.
widget
is
TestComponent
).
state
;
StatefulComponentElement
testComponent
=
tester
.
findElement
((
element
)
=>
element
.
widget
is
TestComponent
);
TestComponentState
testComponentState
=
testComponent
.
state
;
expect
(
callbackTracker
,
equals
([
0
,
1
,
2
,
3
,
4
,
5
]));
callbackTracker
.
clear
();
testComponent
.
go
(
false
);
testComponent
State
.
go
(
false
);
tester
.
pumpFrameWithoutChange
();
expect
(
callbackTracker
,
equals
([]));
callbackTracker
.
clear
();
testComponent
.
go
(
true
);
testComponent
State
.
go
(
true
);
tester
.
pumpFrameWithoutChange
();
expect
(
callbackTracker
,
equals
([
0
,
1
,
2
,
3
,
4
,
5
]));
...
...
@@ -80,7 +81,7 @@ void main() {
double
offset
=
300.0
;
ListBuilder
itemBuilder
=
(
int
start
,
int
count
,
BuildContext
contex
t
)
{
ListBuilder
itemBuilder
=
(
BuildContext
context
,
int
start
,
int
coun
t
)
{
List
<
Widget
>
result
=
<
Widget
>[];
for
(
int
index
=
start
;
index
<
start
+
count
;
index
+=
1
)
{
callbackTracker
.
add
(
index
);
...
...
@@ -130,7 +131,7 @@ void main() {
double
offset
=
300.0
;
ListBuilder
itemBuilder
=
(
int
start
,
int
count
,
BuildContext
contex
t
)
{
ListBuilder
itemBuilder
=
(
BuildContext
context
,
int
start
,
int
coun
t
)
{
List
<
Widget
>
result
=
<
Widget
>[];
for
(
int
index
=
start
;
index
<
start
+
count
;
index
+=
1
)
{
callbackTracker
.
add
(
index
);
...
...
packages/unit/test/widget/block_test.dart
View file @
0d63d6b7
import
'package:quiver/testing/async.dart'
;
import
'package:sky/widgets.dart'
;
import
'package:test/test.dart'
;
...
...
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