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
9bc4deed
Commit
9bc4deed
authored
Mar 14, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2664 from Hixie/less-dynamic
Remove some more 'dynamic's
parents
3480d8db
4e6b2878
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
21 deletions
+20
-21
drag_target.dart
packages/flutter/lib/src/widgets/drag_target.dart
+1
-1
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+11
-11
notification_listener.dart
packages/flutter/lib/src/widgets/notification_listener.dart
+2
-2
virtual_viewport.dart
packages/flutter/lib/src/widgets/virtual_viewport.dart
+1
-1
scroll_events_test.dart
packages/flutter/test/widget/scroll_events_test.dart
+5
-5
.analysis_options
packages/flutter_tools/.analysis_options
+0
-1
No files found.
packages/flutter/lib/src/widgets/drag_target.dart
View file @
9bc4deed
...
...
@@ -80,7 +80,7 @@ abstract class DraggableBase<T> extends StatefulWidget {
/// Should return a new MultiDragGestureRecognizer instance
/// constructed with the given arguments.
MultiDragGestureRecognizer
<
dynamic
>
createRecognizer
(
GestureMultiDragStartCallback
onStart
);
MultiDragGestureRecognizer
<
MultiDragPointerState
>
createRecognizer
(
GestureMultiDragStartCallback
onStart
);
_DraggableState
<
T
>
createState
()
=>
new
_DraggableState
<
T
>();
}
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
9bc4deed
...
...
@@ -1410,7 +1410,7 @@ class ParentDataElement<T extends RenderObjectWidget> extends _ProxyElement {
List
<
Widget
>
badAncestors
=
<
Widget
>[];
Element
ancestor
=
parent
;
while
(
ancestor
!=
null
)
{
if
(
ancestor
is
ParentDataElement
<
dynamic
>)
{
if
(
ancestor
is
ParentDataElement
<
RenderObjectWidget
>)
{
badAncestors
.
add
(
ancestor
.
widget
);
}
else
if
(
ancestor
is
RenderObjectElement
)
{
if
(
widget
.
debugIsValidAncestor
(
ancestor
.
widget
))
...
...
@@ -1439,7 +1439,7 @@ class ParentDataElement<T extends RenderObjectWidget> extends _ProxyElement {
if
(
child
is
RenderObjectElement
)
{
child
.
updateParentData
(
widget
);
}
else
{
assert
(
child
is
!
ParentDataElement
<
dynamic
>);
assert
(
child
is
!
ParentDataElement
<
RenderObjectWidget
>);
child
.
visitChildren
(
notifyChildren
);
}
}
...
...
@@ -1509,10 +1509,10 @@ abstract class RenderObjectElement extends BuildableElement {
return
ancestor
;
}
ParentDataElement
<
dynamic
>
_findAncestorParentDataElement
()
{
ParentDataElement
<
RenderObjectWidget
>
_findAncestorParentDataElement
()
{
Element
ancestor
=
_parent
;
while
(
ancestor
!=
null
&&
ancestor
is
!
RenderObjectElement
)
{
if
(
ancestor
is
ParentDataElement
<
dynamic
>)
if
(
ancestor
is
ParentDataElement
<
RenderObjectWidget
>)
return
ancestor
;
ancestor
=
ancestor
.
_parent
;
}
...
...
@@ -1714,7 +1714,7 @@ abstract class RenderObjectElement extends BuildableElement {
widget
.
didUnmountRenderObject
(
renderObject
);
}
void
updateParentData
(
ParentDataWidget
<
dynamic
>
parentData
)
{
void
updateParentData
(
ParentDataWidget
<
RenderObjectWidget
>
parentData
)
{
parentData
.
applyParentData
(
renderObject
);
}
...
...
@@ -1730,7 +1730,7 @@ abstract class RenderObjectElement extends BuildableElement {
_slot
=
newSlot
;
_ancestorRenderObjectElement
=
_findAncestorRenderObjectElement
();
_ancestorRenderObjectElement
?.
insertChildRenderObject
(
renderObject
,
newSlot
);
ParentDataElement
<
dynamic
>
parentDataElement
=
_findAncestorParentDataElement
();
ParentDataElement
<
RenderObjectWidget
>
parentDataElement
=
_findAncestorParentDataElement
();
if
(
parentDataElement
!=
null
)
updateParentData
(
parentDataElement
.
widget
);
}
...
...
@@ -1803,7 +1803,7 @@ class SingleChildRenderObjectElement extends RenderObjectElement {
}
void
insertChildRenderObject
(
RenderObject
child
,
dynamic
slot
)
{
final
RenderObjectWithChildMixin
<
dynamic
>
renderObject
=
this
.
renderObject
;
final
RenderObjectWithChildMixin
<
RenderObject
>
renderObject
=
this
.
renderObject
;
assert
(
slot
==
null
);
renderObject
.
child
=
child
;
assert
(
renderObject
==
this
.
renderObject
);
...
...
@@ -1814,7 +1814,7 @@ class SingleChildRenderObjectElement extends RenderObjectElement {
}
void
removeChildRenderObject
(
RenderObject
child
)
{
final
RenderObjectWithChildMixin
<
dynamic
>
renderObject
=
this
.
renderObject
;
final
RenderObjectWithChildMixin
<
RenderObject
>
renderObject
=
this
.
renderObject
;
assert
(
renderObject
.
child
==
child
);
renderObject
.
child
=
null
;
assert
(
renderObject
==
this
.
renderObject
);
...
...
@@ -1835,19 +1835,19 @@ class MultiChildRenderObjectElement extends RenderObjectElement {
final
Set
<
Element
>
_detachedChildren
=
new
HashSet
<
Element
>();
void
insertChildRenderObject
(
RenderObject
child
,
Element
slot
)
{
final
ContainerRenderObjectMixin
<
dynamic
,
dynamic
>
renderObject
=
this
.
renderObject
;
final
ContainerRenderObjectMixin
<
RenderObject
,
ContainerParentDataMixin
<
RenderObject
>
>
renderObject
=
this
.
renderObject
;
renderObject
.
insert
(
child
,
after:
slot
?.
renderObject
);
assert
(
renderObject
==
this
.
renderObject
);
}
void
moveChildRenderObject
(
RenderObject
child
,
dynamic
slot
)
{
final
ContainerRenderObjectMixin
<
dynamic
,
dynamic
>
renderObject
=
this
.
renderObject
;
final
ContainerRenderObjectMixin
<
RenderObject
,
ContainerParentDataMixin
<
RenderObject
>
>
renderObject
=
this
.
renderObject
;
renderObject
.
move
(
child
,
after:
slot
?.
renderObject
);
assert
(
renderObject
==
this
.
renderObject
);
}
void
removeChildRenderObject
(
RenderObject
child
)
{
final
ContainerRenderObjectMixin
<
dynamic
,
dynamic
>
renderObject
=
this
.
renderObject
;
final
ContainerRenderObjectMixin
<
RenderObject
,
ContainerParentDataMixin
<
RenderObject
>
>
renderObject
=
this
.
renderObject
;
assert
(
child
.
parent
==
renderObject
);
renderObject
.
remove
(
child
);
assert
(
renderObject
==
this
.
renderObject
);
...
...
packages/flutter/lib/src/widgets/notification_listener.dart
View file @
9bc4deed
...
...
@@ -13,8 +13,8 @@ abstract class Notification {
void
dispatch
(
BuildContext
target
)
{
target
.
visitAncestorElements
((
Element
element
)
{
if
(
element
is
StatelessElement
&&
element
.
widget
is
NotificationListener
<
dynamic
>)
{
final
NotificationListener
<
dynamic
>
widget
=
element
.
widget
;
element
.
widget
is
NotificationListener
<
Notification
>)
{
final
NotificationListener
<
Notification
>
widget
=
element
.
widget
;
if
(
widget
.
_dispatch
(
this
))
// that function checks the type dynamically
return
false
;
}
...
...
packages/flutter/lib/src/widgets/virtual_viewport.dart
View file @
9bc4deed
...
...
@@ -72,7 +72,7 @@ abstract class VirtualViewportElement extends RenderObjectElement {
List
<
Element
>
_materializedChildren
=
const
<
Element
>[];
RenderVirtualViewport
<
dynamic
>
get
renderObject
=>
super
.
renderObject
;
RenderVirtualViewport
<
ContainerBoxParentDataMixin
<
RenderBox
>
>
get
renderObject
=>
super
.
renderObject
;
void
visitChildren
(
ElementVisitor
visitor
)
{
if
(
_materializedChildren
==
null
)
...
...
packages/flutter/test/widget/scroll_events_test.dart
View file @
9bc4deed
...
...
@@ -46,7 +46,7 @@ void main() {
test
(
'Scroll scrollTo animation'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
GlobalKey
<
ScrollableState
>
scrollKey
=
new
GlobalKey
<
ScrollableState
>();
GlobalKey
<
ScrollableState
<
Scrollable
>>
scrollKey
=
new
GlobalKey
<
ScrollableState
<
Scrollable
>
>();
List
<
String
>
log
=
<
String
>[];
tester
.
pumpWidget
(
_buildScroller
(
key:
scrollKey
,
log:
log
));
...
...
@@ -64,7 +64,7 @@ void main() {
test
(
'Scroll scrollTo no animation'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
GlobalKey
<
ScrollableState
>
scrollKey
=
new
GlobalKey
<
ScrollableState
>();
GlobalKey
<
ScrollableState
<
Scrollable
>>
scrollKey
=
new
GlobalKey
<
ScrollableState
<
Scrollable
>
>();
List
<
String
>
log
=
<
String
>[];
tester
.
pumpWidget
(
_buildScroller
(
key:
scrollKey
,
log:
log
));
...
...
@@ -76,7 +76,7 @@ void main() {
test
(
'Scroll during animation'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
GlobalKey
<
ScrollableState
>
scrollKey
=
new
GlobalKey
<
ScrollableState
>();
GlobalKey
<
ScrollableState
<
Scrollable
>>
scrollKey
=
new
GlobalKey
<
ScrollableState
<
Scrollable
>
>();
List
<
String
>
log
=
<
String
>[];
tester
.
pumpWidget
(
_buildScroller
(
key:
scrollKey
,
log:
log
));
...
...
@@ -98,7 +98,7 @@ void main() {
test
(
'Scroll during animation'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
GlobalKey
<
ScrollableState
>
scrollKey
=
new
GlobalKey
<
ScrollableState
>();
GlobalKey
<
ScrollableState
<
Scrollable
>>
scrollKey
=
new
GlobalKey
<
ScrollableState
<
Scrollable
>
>();
List
<
String
>
log
=
<
String
>[];
tester
.
pumpWidget
(
_buildScroller
(
key:
scrollKey
,
log:
log
));
...
...
@@ -120,7 +120,7 @@ void main() {
test
(
'fling, fling generates one start/end pair'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
GlobalKey
<
ScrollableState
>
scrollKey
=
new
GlobalKey
<
ScrollableState
>();
GlobalKey
<
ScrollableState
<
Scrollable
>>
scrollKey
=
new
GlobalKey
<
ScrollableState
<
Scrollable
>
>();
List
<
String
>
log
=
<
String
>[];
tester
.
pumpWidget
(
_buildScroller
(
key:
scrollKey
,
log:
log
));
...
...
packages/flutter_tools/.analysis_options
View file @
9bc4deed
...
...
@@ -15,7 +15,6 @@ analyzer:
strong_mode_invalid_method_override: ignore
strong_mode_static_type_error: ignore
strong_mode_down_cast_composite: ignore
type_argument_not_matching_bounds: ignore
# we allow having TODOs in the code
todo: ignore
linter:
...
...
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