Commit 9bc4deed authored by Ian Hickson's avatar Ian Hickson

Merge pull request #2664 from Hixie/less-dynamic

Remove some more 'dynamic's
parents 3480d8db 4e6b2878
......@@ -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>();
}
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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));
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment