Commit da925c7d authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by Adam Barth

Replace @checked with covariant (#8300)

Fixes #7734
parent 1e1f7703
...@@ -111,7 +111,7 @@ class ShrineGridDelegate extends SliverGridDelegate { ...@@ -111,7 +111,7 @@ class ShrineGridDelegate extends SliverGridDelegate {
} }
@override @override
bool shouldRelayout(@checked SliverGridDelegate oldDelegate) => false; bool shouldRelayout(covariant SliverGridDelegate oldDelegate) => false;
} }
/// Displays the Vendor's name and avatar. /// Displays the Vendor's name and avatar.
......
...@@ -21,7 +21,6 @@ export 'src/foundation/print.dart'; ...@@ -21,7 +21,6 @@ export 'src/foundation/print.dart';
export 'src/foundation/synchronous_future.dart'; export 'src/foundation/synchronous_future.dart';
export 'package:meta/meta.dart' show export 'package:meta/meta.dart' show
checked,
mustCallSuper, mustCallSuper,
optionalTypeArgs, optionalTypeArgs,
protected, protected,
......
...@@ -552,7 +552,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { ...@@ -552,7 +552,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
} }
@override @override
bool shouldRebuild(@checked _SliverAppBarDelegate oldDelegate) { bool shouldRebuild(covariant _SliverAppBarDelegate oldDelegate) {
return leading != oldDelegate.leading return leading != oldDelegate.leading
|| title != oldDelegate.title || title != oldDelegate.title
|| actions != oldDelegate.actions || actions != oldDelegate.actions
......
...@@ -958,7 +958,7 @@ class _IntrinsicDimensionsCacheEntry { ...@@ -958,7 +958,7 @@ class _IntrinsicDimensionsCacheEntry {
/// these classes, however, you must implement the algorithm yourself. /// these classes, however, you must implement the algorithm yourself.
abstract class RenderBox extends RenderObject { abstract class RenderBox extends RenderObject {
@override @override
void setupParentData(@checked RenderObject child) { void setupParentData(covariant RenderObject child) {
if (child.parentData is! BoxParentData) if (child.parentData is! BoxParentData)
child.parentData = new BoxParentData(); child.parentData = new BoxParentData();
} }
...@@ -1863,7 +1863,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1863,7 +1863,7 @@ abstract class RenderBox extends RenderObject {
/// ``` /// ```
// TODO(ianh): Fix the type of the argument here once https://github.com/dart-lang/sdk/issues/25232 is fixed // TODO(ianh): Fix the type of the argument here once https://github.com/dart-lang/sdk/issues/25232 is fixed
@override @override
void handleEvent(PointerEvent event, @checked HitTestEntry entry) { void handleEvent(PointerEvent event, covariant HitTestEntry entry) {
super.handleEvent(event, entry); super.handleEvent(event, entry);
} }
......
...@@ -243,7 +243,7 @@ abstract class MultiChildLayoutDelegate { ...@@ -243,7 +243,7 @@ abstract class MultiChildLayoutDelegate {
/// This should compare the fields of the current delegate and the given /// This should compare the fields of the current delegate and the given
/// `oldDelegate` and return true if the fields are such that the layout would /// `oldDelegate` and return true if the fields are such that the layout would
/// be different. /// be different.
bool shouldRelayout(@checked MultiChildLayoutDelegate oldDelegate); bool shouldRelayout(covariant MultiChildLayoutDelegate oldDelegate);
/// Override this method to include additional information in the /// Override this method to include additional information in the
/// debugging data printed by [debugDumpRenderTree] and friends. /// debugging data printed by [debugDumpRenderTree] and friends.
......
...@@ -108,7 +108,7 @@ abstract class FlowDelegate { ...@@ -108,7 +108,7 @@ abstract class FlowDelegate {
/// This should compare the fields of the current delegate and the given /// This should compare the fields of the current delegate and the given
/// oldDelegate and return true if the fields are such that the layout would /// oldDelegate and return true if the fields are such that the layout would
/// be different. /// be different.
bool shouldRelayout(@checked FlowDelegate oldDelegate) => false; bool shouldRelayout(covariant FlowDelegate oldDelegate) => false;
/// Override this method to return true when the children need to be /// Override this method to return true when the children need to be
/// repainted. This should compare the fields of the current delegate and the /// repainted. This should compare the fields of the current delegate and the
...@@ -123,7 +123,7 @@ abstract class FlowDelegate { ...@@ -123,7 +123,7 @@ abstract class FlowDelegate {
/// The flow container might repaint even if this function returns false, for /// The flow container might repaint even if this function returns false, for
/// example if layout triggers painting (e.g., if [shouldRelayout] returns /// example if layout triggers painting (e.g., if [shouldRelayout] returns
/// true). /// true).
bool shouldRepaint(@checked FlowDelegate oldDelegate); bool shouldRepaint(covariant FlowDelegate oldDelegate);
/// Override this method to include additional information in the /// Override this method to include additional information in the
/// debugging data printed by [debugDumpRenderTree] and friends. /// debugging data printed by [debugDumpRenderTree] and friends.
......
...@@ -83,7 +83,7 @@ class AbstractNode { ...@@ -83,7 +83,7 @@ class AbstractNode {
/// Subclasses with children should [attach] all their children to the same /// Subclasses with children should [attach] all their children to the same
/// [owner] whenever this method is called. /// [owner] whenever this method is called.
@mustCallSuper @mustCallSuper
void attach(@checked Object owner) { void attach(covariant Object owner) {
assert(owner != null); assert(owner != null);
assert(_owner == null); assert(_owner == null);
_owner = owner; _owner = owner;
...@@ -111,7 +111,7 @@ class AbstractNode { ...@@ -111,7 +111,7 @@ class AbstractNode {
/// Subclasses should call this function when they acquire a new child. /// Subclasses should call this function when they acquire a new child.
@protected @protected
@mustCallSuper @mustCallSuper
void adoptChild(@checked AbstractNode child) { void adoptChild(covariant AbstractNode child) {
assert(child != null); assert(child != null);
assert(child._parent == null); assert(child._parent == null);
assert(() { assert(() {
...@@ -132,7 +132,7 @@ class AbstractNode { ...@@ -132,7 +132,7 @@ class AbstractNode {
/// Subclasses should call this function when they lose a child. /// Subclasses should call this function when they lose a child.
@protected @protected
@mustCallSuper @mustCallSuper
void dropChild(@checked AbstractNode child) { void dropChild(covariant AbstractNode child) {
assert(child != null); assert(child != null);
assert(child._parent == this); assert(child._parent == this);
assert(child.attached == attached); assert(child.attached == attached);
......
...@@ -1255,7 +1255,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { ...@@ -1255,7 +1255,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// ///
/// You can call this function to set up the parent data for child before the /// You can call this function to set up the parent data for child before the
/// child is added to the parent's child list. /// child is added to the parent's child list.
void setupParentData(@checked RenderObject child) { void setupParentData(covariant RenderObject child) {
assert(_debugCanPerformMutations); assert(_debugCanPerformMutations);
if (child.parentData is! ParentData) if (child.parentData is! ParentData)
child.parentData = new ParentData(); child.parentData = new ParentData();
...@@ -2143,7 +2143,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { ...@@ -2143,7 +2143,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// ///
/// Used by coordinate conversion functions to translate coordinates local to /// Used by coordinate conversion functions to translate coordinates local to
/// one render object into coordinates local to another render object. /// one render object into coordinates local to another render object.
void applyPaintTransform(@checked RenderObject child, Matrix4 transform) { void applyPaintTransform(covariant RenderObject child, Matrix4 transform) {
assert(child.parent == this); assert(child.parent == this);
} }
...@@ -2155,7 +2155,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { ...@@ -2155,7 +2155,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// ///
/// This is used in the semantics phase to avoid including children /// This is used in the semantics phase to avoid including children
/// that are not physically visible. /// that are not physically visible.
Rect describeApproximatePaintClip(@checked RenderObject child) => null; Rect describeApproximatePaintClip(covariant RenderObject child) => null;
// SEMANTICS // SEMANTICS
...@@ -2383,7 +2383,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { ...@@ -2383,7 +2383,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// Override this method to handle pointer events that hit this render object. /// Override this method to handle pointer events that hit this render object.
@override @override
void handleEvent(PointerEvent event, @checked HitTestEntry entry) { } void handleEvent(PointerEvent event, covariant HitTestEntry entry) { }
// HIT TESTING // HIT TESTING
......
...@@ -918,7 +918,7 @@ abstract class CustomClipper<T> { ...@@ -918,7 +918,7 @@ abstract class CustomClipper<T> {
/// It's possible that the [getClip] method will get called even if /// It's possible that the [getClip] method will get called even if
/// [shouldReclip] returns false or if the [shouldReclip] method is never /// [shouldReclip] returns false or if the [shouldReclip] method is never
/// called at all (e.g. if the box changes size). /// called at all (e.g. if the box changes size).
bool shouldReclip(@checked CustomClipper<T> oldClipper); bool shouldReclip(covariant CustomClipper<T> oldClipper);
} }
abstract class _RenderCustomClip<T> extends RenderProxyBox { abstract class _RenderCustomClip<T> extends RenderProxyBox {
...@@ -1761,7 +1761,7 @@ abstract class CustomPainter { ...@@ -1761,7 +1761,7 @@ abstract class CustomPainter {
/// repaints should be avoided as much as possible, a [RepaintBoundary] or /// repaints should be avoided as much as possible, a [RepaintBoundary] or
/// [RenderRepaintBoundary] (or other render object with [isRepaintBoundary] /// [RenderRepaintBoundary] (or other render object with [isRepaintBoundary]
/// set to true) might be helpful. /// set to true) might be helpful.
bool shouldRepaint(@checked CustomPainter oldDelegate); bool shouldRepaint(covariant CustomPainter oldDelegate);
/// Called whenever a hit test is being performed on an object that is using /// Called whenever a hit test is being performed on an object that is using
/// this custom paint delegate. /// this custom paint delegate.
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
import 'dart:math' as math; import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'box.dart'; import 'box.dart';
import 'debug.dart'; import 'debug.dart';
import 'object.dart'; import 'object.dart';
...@@ -748,7 +746,7 @@ abstract class SingleChildLayoutDelegate { ...@@ -748,7 +746,7 @@ abstract class SingleChildLayoutDelegate {
/// It's also possible that the layout method will get called /// It's also possible that the layout method will get called
/// without [shouldRelayout] being called at all (e.g. if the parent changes /// without [shouldRelayout] being called at all (e.g. if the parent changes
/// size). /// size).
bool shouldRelayout(@checked SingleChildLayoutDelegate oldDelegate); bool shouldRelayout(covariant SingleChildLayoutDelegate oldDelegate);
} }
/// Defers the layout of its single child to a delegate. /// Defers the layout of its single child to a delegate.
......
...@@ -913,7 +913,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -913,7 +913,7 @@ abstract class RenderSliver extends RenderObject {
/// of the sliver whereas [childScrollOffset] gives the distance from sliver's /// of the sliver whereas [childScrollOffset] gives the distance from sliver's
/// zero scroll offset. /// zero scroll offset.
@protected @protected
double childMainAxisPosition(@checked RenderObject child) { double childMainAxisPosition(covariant RenderObject child) {
assert(() { assert(() {
throw new FlutterError('$runtimeType does not implement childPosition.'); throw new FlutterError('$runtimeType does not implement childPosition.');
}); });
...@@ -931,7 +931,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -931,7 +931,7 @@ abstract class RenderSliver extends RenderObject {
/// ///
/// Calling this for a child that is not visible is not valid. /// Calling this for a child that is not visible is not valid.
@protected @protected
double childCrossAxisPosition(@checked RenderObject child) => 0.0; double childCrossAxisPosition(covariant RenderObject child) => 0.0;
/// Returns the scroll offset for the leading edge of the given child. /// Returns the scroll offset for the leading edge of the given child.
/// ///
...@@ -941,7 +941,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -941,7 +941,7 @@ abstract class RenderSliver extends RenderObject {
/// [childMainAxisPosition] gives the distance from the leading _visible_ edge /// [childMainAxisPosition] gives the distance from the leading _visible_ edge
/// of the sliver whereas [childScrollOffset] gives the distance from sliver's /// of the sliver whereas [childScrollOffset] gives the distance from sliver's
/// zero scroll offset. /// zero scroll offset.
double childScrollOffset(@checked RenderObject child) { double childScrollOffset(covariant RenderObject child) {
assert(child.parent == this); assert(child.parent == this);
return 0.0; return 0.0;
} }
......
...@@ -227,7 +227,7 @@ abstract class SliverGridDelegate { ...@@ -227,7 +227,7 @@ abstract class SliverGridDelegate {
/// Returns information about the size and position of the tiles in the grid. /// Returns information about the size and position of the tiles in the grid.
SliverGridLayout getLayout(SliverConstraints constraints); SliverGridLayout getLayout(SliverConstraints constraints);
bool shouldRelayout(@checked SliverGridDelegate oldDelegate); bool shouldRelayout(covariant SliverGridDelegate oldDelegate);
} }
/// Creates grid layouts with a fixed number of tiles in the cross axis. /// Creates grid layouts with a fixed number of tiles in the cross axis.
......
...@@ -133,7 +133,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje ...@@ -133,7 +133,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
/// ///
/// If there is no child, this should return 0.0. /// If there is no child, this should return 0.0.
@override @override
double childMainAxisPosition(@checked RenderObject child) => super.childMainAxisPosition(child); double childMainAxisPosition(covariant RenderObject child) => super.childMainAxisPosition(child);
@override @override
bool hitTestChildren(HitTestResult result, { @required double mainAxisPosition, @required double crossAxisPosition }) { bool hitTestChildren(HitTestResult result, { @required double mainAxisPosition, @required double crossAxisPosition }) {
......
...@@ -1860,7 +1860,7 @@ class Flex extends MultiChildRenderObjectWidget { ...@@ -1860,7 +1860,7 @@ class Flex extends MultiChildRenderObjectWidget {
} }
@override @override
void updateRenderObject(BuildContext context, @checked RenderFlex renderObject) { void updateRenderObject(BuildContext context, covariant RenderFlex renderObject) {
renderObject renderObject
..direction = direction ..direction = direction
..mainAxisAlignment = mainAxisAlignment ..mainAxisAlignment = mainAxisAlignment
......
...@@ -824,7 +824,7 @@ abstract class State<T extends StatefulWidget> { ...@@ -824,7 +824,7 @@ abstract class State<T extends StatefulWidget> {
/// super.didUpdateConfig(oldConfig). /// super.didUpdateConfig(oldConfig).
// TODO(abarth): Add @mustCallSuper. // TODO(abarth): Add @mustCallSuper.
@protected @protected
void didUpdateConfig(@checked T oldConfig) { } void didUpdateConfig(covariant T oldConfig) { }
/// Called whenever the application is reassembled during debugging. /// Called whenever the application is reassembled during debugging.
/// ///
...@@ -1189,7 +1189,7 @@ abstract class InheritedWidget extends ProxyWidget { ...@@ -1189,7 +1189,7 @@ abstract class InheritedWidget extends ProxyWidget {
/// The given widget is guaranteed to have the same [runtimeType] as this /// The given widget is guaranteed to have the same [runtimeType] as this
/// object. /// object.
@protected @protected
bool updateShouldNotify(@checked InheritedWidget oldWidget); bool updateShouldNotify(covariant InheritedWidget oldWidget);
} }
/// RenderObjectWidgets provide the configuration for [RenderObjectElement]s, /// RenderObjectWidgets provide the configuration for [RenderObjectElement]s,
...@@ -1226,13 +1226,13 @@ abstract class RenderObjectWidget extends Widget { ...@@ -1226,13 +1226,13 @@ abstract class RenderObjectWidget extends Widget {
/// [createElement] method. See, for example, /// [createElement] method. See, for example,
/// [SingleChildRenderObjectElement.update]. /// [SingleChildRenderObjectElement.update].
@protected @protected
void updateRenderObject(BuildContext context, @checked RenderObject renderObject) { } void updateRenderObject(BuildContext context, covariant RenderObject renderObject) { }
/// A render object previously associated with this widget has been removed /// A render object previously associated with this widget has been removed
/// from the tree. The given [RenderObject] will be of the same type as /// from the tree. The given [RenderObject] will be of the same type as
/// returned by this object's [createRenderObject]. /// returned by this object's [createRenderObject].
@protected @protected
void didUnmountRenderObject(@checked RenderObject renderObject) { } void didUnmountRenderObject(covariant RenderObject renderObject) { }
} }
/// A superclass for RenderObjectWidgets that configure RenderObject subclasses /// A superclass for RenderObjectWidgets that configure RenderObject subclasses
...@@ -2141,7 +2141,7 @@ abstract class Element implements BuildContext { ...@@ -2141,7 +2141,7 @@ abstract class Element implements BuildContext {
/// ///
/// This function is called only during the "active" lifecycle state. /// This function is called only during the "active" lifecycle state.
@mustCallSuper @mustCallSuper
void update(@checked Widget newWidget) { void update(covariant Widget newWidget) {
// This code is hot when hot reloading, so we try to // This code is hot when hot reloading, so we try to
// only call _AssertionError._evaluateAssertion once. // only call _AssertionError._evaluateAssertion once.
assert(_debugLifecycleState == _ElementLifecycle.active assert(_debugLifecycleState == _ElementLifecycle.active
...@@ -3159,7 +3159,7 @@ abstract class ProxyElement extends ComponentElement { ...@@ -3159,7 +3159,7 @@ abstract class ProxyElement extends ComponentElement {
/// Called during [update] after changing the widget associated with this /// Called during [update] after changing the widget associated with this
/// element but before rebuilding this element. /// element but before rebuilding this element.
@protected @protected
void notifyClients(@checked ProxyWidget oldWidget); void notifyClients(covariant ProxyWidget oldWidget);
} }
/// An [Element] that uses a [ParentDataWidget] as its configuration. /// An [Element] that uses a [ParentDataWidget] as its configuration.
...@@ -3483,7 +3483,7 @@ abstract class RenderObjectElement extends BuildableElement { ...@@ -3483,7 +3483,7 @@ abstract class RenderObjectElement extends BuildableElement {
} }
@override @override
void update(@checked RenderObjectWidget newWidget) { void update(covariant RenderObjectWidget newWidget) {
super.update(newWidget); super.update(newWidget);
assert(widget == newWidget); assert(widget == newWidget);
assert(() { _debugUpdateRenderObjectOwner(); return true; }); assert(() { _debugUpdateRenderObjectOwner(); return true; });
...@@ -3729,7 +3729,7 @@ abstract class RenderObjectElement extends BuildableElement { ...@@ -3729,7 +3729,7 @@ abstract class RenderObjectElement extends BuildableElement {
/// element has a list of children, the previous sibling is a convenient value /// element has a list of children, the previous sibling is a convenient value
/// for the slot. /// for the slot.
@protected @protected
void insertChildRenderObject(@checked RenderObject child, @checked dynamic slot); void insertChildRenderObject(covariant RenderObject child, covariant dynamic slot);
/// Move the given child to the given slot. /// Move the given child to the given slot.
/// ///
...@@ -3740,13 +3740,13 @@ abstract class RenderObjectElement extends BuildableElement { ...@@ -3740,13 +3740,13 @@ abstract class RenderObjectElement extends BuildableElement {
/// element has a list of children, the previous sibling is a convenient value /// element has a list of children, the previous sibling is a convenient value
/// for the slot. /// for the slot.
@protected @protected
void moveChildRenderObject(@checked RenderObject child, @checked dynamic slot); void moveChildRenderObject(covariant RenderObject child, covariant dynamic slot);
/// Remove the given child from [renderObject]. /// Remove the given child from [renderObject].
/// ///
/// The given child is guaranteed to have [renderObject] as its parent. /// The given child is guaranteed to have [renderObject] as its parent.
@protected @protected
void removeChildRenderObject(@checked RenderObject child); void removeChildRenderObject(covariant RenderObject child);
@override @override
void debugFillDescription(List<String> description) { void debugFillDescription(List<String> description) {
......
...@@ -53,7 +53,7 @@ class ScrollBehavior { ...@@ -53,7 +53,7 @@ class ScrollBehavior {
return null; return null;
} }
bool shouldNotify(@checked ScrollBehavior oldDelegate) => false; bool shouldNotify(covariant ScrollBehavior oldDelegate) => false;
} }
class ScrollConfiguration extends InheritedWidget { class ScrollConfiguration extends InheritedWidget {
......
...@@ -38,7 +38,7 @@ abstract class SliverChildDelegate { ...@@ -38,7 +38,7 @@ abstract class SliverChildDelegate {
double trailingScrollOffset, double trailingScrollOffset,
) => null; ) => null;
bool shouldRebuild(@checked SliverChildDelegate oldDelegate); bool shouldRebuild(covariant SliverChildDelegate oldDelegate);
@override @override
String toString() { String toString() {
...@@ -81,7 +81,7 @@ class SliverChildBuilderDelegate extends SliverChildDelegate { ...@@ -81,7 +81,7 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
int get estimatedChildCount => childCount; int get estimatedChildCount => childCount;
@override @override
bool shouldRebuild(@checked SliverChildBuilderDelegate oldDelegate) => true; bool shouldRebuild(covariant SliverChildBuilderDelegate oldDelegate) => true;
} }
// /// // ///
...@@ -127,7 +127,7 @@ class SliverChildListDelegate extends SliverChildDelegate { ...@@ -127,7 +127,7 @@ class SliverChildListDelegate extends SliverChildDelegate {
int get estimatedChildCount => children.length; int get estimatedChildCount => children.length;
@override @override
bool shouldRebuild(@checked SliverChildListDelegate oldDelegate) { bool shouldRebuild(covariant SliverChildListDelegate oldDelegate) {
return children != oldDelegate.children; return children != oldDelegate.children;
} }
} }
...@@ -427,7 +427,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render ...@@ -427,7 +427,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
} }
@override @override
void insertChildRenderObject(@checked RenderObject child, int slot) { void insertChildRenderObject(covariant RenderObject child, int slot) {
assert(slot != null); assert(slot != null);
assert(_currentlyUpdatingChildIndex == slot); assert(_currentlyUpdatingChildIndex == slot);
renderObject.insert(child, after: _currentBeforeChild); renderObject.insert(child, after: _currentBeforeChild);
...@@ -439,14 +439,14 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render ...@@ -439,14 +439,14 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
} }
@override @override
void moveChildRenderObject(@checked RenderObject child, int slot) { void moveChildRenderObject(covariant RenderObject child, int slot) {
// TODO(ianh): At some point we should be better about noticing when a // TODO(ianh): At some point we should be better about noticing when a
// particular LocalKey changes slot, and handle moving the nodes around. // particular LocalKey changes slot, and handle moving the nodes around.
assert(false); assert(false);
} }
@override @override
void removeChildRenderObject(@checked RenderObject child) { void removeChildRenderObject(covariant RenderObject child) {
assert(_currentlyUpdatingChildIndex != null); assert(_currentlyUpdatingChildIndex != null);
renderObject.remove(child); renderObject.remove(child);
} }
......
...@@ -18,7 +18,7 @@ abstract class SliverPersistentHeaderDelegate { ...@@ -18,7 +18,7 @@ abstract class SliverPersistentHeaderDelegate {
double get maxExtent; double get maxExtent;
bool shouldRebuild(@checked SliverPersistentHeaderDelegate oldDelegate); bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate);
} }
class SliverPersistentHeader extends StatelessWidget { class SliverPersistentHeader extends StatelessWidget {
...@@ -116,17 +116,17 @@ class _SliverPersistentHeaderElement extends RenderObjectElement { ...@@ -116,17 +116,17 @@ class _SliverPersistentHeaderElement extends RenderObjectElement {
} }
@override @override
void insertChildRenderObject(@checked RenderObject child, Null slot) { void insertChildRenderObject(covariant RenderObject child, Null slot) {
renderObject.child = child; renderObject.child = child;
} }
@override @override
void moveChildRenderObject(@checked RenderObject child, Null slot) { void moveChildRenderObject(covariant RenderObject child, Null slot) {
assert(false); assert(false);
} }
@override @override
void removeChildRenderObject(@checked RenderObject child) { void removeChildRenderObject(covariant RenderObject child) {
renderObject.child = null; renderObject.child = null;
} }
......
...@@ -11,7 +11,6 @@ import 'package:flutter/rendering.dart'; ...@@ -11,7 +11,6 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:meta/meta.dart';
class TestImage extends ui.Image { class TestImage extends ui.Image {
TestImage(this.scale); TestImage(this.scale);
...@@ -97,7 +96,7 @@ class TestAssetImage extends AssetImage { ...@@ -97,7 +96,7 @@ class TestAssetImage extends AssetImage {
} }
@override @override
Future<ui.Image> decodeImage(@checked TestByteData data) { Future<ui.Image> decodeImage(covariant TestByteData data) {
return new SynchronousFuture<ui.Image>(new TestImage(data.scale)); return new SynchronousFuture<ui.Image>(new TestImage(data.scale));
} }
} }
......
...@@ -6,7 +6,6 @@ import 'dart:collection'; ...@@ -6,7 +6,6 @@ import 'dart:collection';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
final List<String> results = <String>[]; final List<String> results = <String>[];
...@@ -45,7 +44,7 @@ class TestRoute extends LocalHistoryRoute<String> { ...@@ -45,7 +44,7 @@ class TestRoute extends LocalHistoryRoute<String> {
} }
@override @override
void didReplace(@checked TestRoute oldRoute) { void didReplace(covariant TestRoute oldRoute) {
log('didReplace ${oldRoute.name}'); log('didReplace ${oldRoute.name}');
super.didReplace(oldRoute); super.didReplace(oldRoute);
} }
...@@ -60,13 +59,13 @@ class TestRoute extends LocalHistoryRoute<String> { ...@@ -60,13 +59,13 @@ class TestRoute extends LocalHistoryRoute<String> {
} }
@override @override
void didPopNext(@checked TestRoute nextRoute) { void didPopNext(covariant TestRoute nextRoute) {
log('didPopNext ${nextRoute.name}'); log('didPopNext ${nextRoute.name}');
super.didPopNext(nextRoute); super.didPopNext(nextRoute);
} }
@override @override
void didChangeNext(@checked TestRoute nextRoute) { void didChangeNext(covariant TestRoute nextRoute) {
log('didChangeNext ${nextRoute?.name}'); log('didChangeNext ${nextRoute?.name}');
super.didChangeNext(nextRoute); super.didChangeNext(nextRoute);
} }
......
...@@ -125,7 +125,7 @@ class _HasSemantics extends Matcher { ...@@ -125,7 +125,7 @@ class _HasSemantics extends Matcher {
final TestSemantics _semantics; final TestSemantics _semantics;
@override @override
bool matches(@checked SemanticsTester item, Map<dynamic, dynamic> matchState) { bool matches(covariant SemanticsTester item, Map<dynamic, dynamic> matchState) {
return _semantics._matches(item.tester.binding.pipelineOwner.semanticsOwner.rootSemanticsNode, matchState); return _semantics._matches(item.tester.binding.pipelineOwner.semanticsOwner.rootSemanticsNode, matchState);
} }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:markdown/markdown.dart' as md; import 'package:markdown/markdown.dart' as md;
import 'package:meta/meta.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
...@@ -67,7 +66,7 @@ class MarkdownRaw extends StatelessWidget { ...@@ -67,7 +66,7 @@ class MarkdownRaw extends StatelessWidget {
MarkdownBodyRaw createMarkdownBody({ MarkdownBodyRaw createMarkdownBody({
String data, String data,
@checked MarkdownStyleRaw markdownStyle, covariant MarkdownStyleRaw markdownStyle,
SyntaxHighlighter syntaxHighlighter, SyntaxHighlighter syntaxHighlighter,
MarkdownLinkCallback onTapLink MarkdownLinkCallback onTapLink
}) { }) {
......
...@@ -847,7 +847,7 @@ class _LiveTestRenderView extends RenderView { ...@@ -847,7 +847,7 @@ class _LiveTestRenderView extends RenderView {
@override @override
TestViewConfiguration get configuration => super.configuration; TestViewConfiguration get configuration => super.configuration;
@override @override
set configuration(@checked TestViewConfiguration value) { super.configuration = value; } set configuration(covariant TestViewConfiguration value) { super.configuration = value; }
final Map<int, _LiveTestPointerRecord> _pointers = <int, _LiveTestPointerRecord>{}; final Map<int, _LiveTestPointerRecord> _pointers = <int, _LiveTestPointerRecord>{};
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
import 'package:meta/meta.dart';
import 'finders.dart'; import 'finders.dart';
...@@ -96,7 +95,7 @@ class _FindsWidgetMatcher extends Matcher { ...@@ -96,7 +95,7 @@ class _FindsWidgetMatcher extends Matcher {
final int max; final int max;
@override @override
bool matches(@checked Finder finder, Map<dynamic, dynamic> matchState) { bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) {
assert(min != null || max != null); assert(min != null || max != null);
assert(min == null || max == null || min <= max); assert(min == null || max == null || min <= max);
matchState[Finder] = finder; matchState[Finder] = finder;
...@@ -190,7 +189,7 @@ class _IsOffstage extends Matcher { ...@@ -190,7 +189,7 @@ class _IsOffstage extends Matcher {
const _IsOffstage(); const _IsOffstage();
@override @override
bool matches(@checked Finder finder, Map<dynamic, dynamic> matchState) { bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) {
return _hasAncestorMatching(finder, (Widget widget) { return _hasAncestorMatching(finder, (Widget widget) {
if (widget is Offstage) if (widget is Offstage)
return widget.offstage; return widget.offstage;
...@@ -206,7 +205,7 @@ class _IsOnstage extends Matcher { ...@@ -206,7 +205,7 @@ class _IsOnstage extends Matcher {
const _IsOnstage(); const _IsOnstage();
@override @override
bool matches(@checked Finder finder, Map<dynamic, dynamic> matchState) { bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) {
Iterable<Element> nodes = finder.evaluate(); Iterable<Element> nodes = finder.evaluate();
if (nodes.length != 1) if (nodes.length != 1)
return false; return false;
...@@ -230,7 +229,7 @@ class _IsInCard extends Matcher { ...@@ -230,7 +229,7 @@ class _IsInCard extends Matcher {
const _IsInCard(); const _IsInCard();
@override @override
bool matches(@checked Finder finder, Map<dynamic, dynamic> matchState) => _hasAncestorOfType(finder, Card); bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) => _hasAncestorOfType(finder, Card);
@override @override
Description describe(Description description) => description.add('in card'); Description describe(Description description) => description.add('in card');
...@@ -240,7 +239,7 @@ class _IsNotInCard extends Matcher { ...@@ -240,7 +239,7 @@ class _IsNotInCard extends Matcher {
const _IsNotInCard(); const _IsNotInCard();
@override @override
bool matches(@checked Finder finder, Map<dynamic, dynamic> matchState) => !_hasAncestorOfType(finder, Card); bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) => !_hasAncestorOfType(finder, Card);
@override @override
Description describe(Description description) => description.add('not in card'); Description describe(Description description) => description.add('not in card');
......
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