Enable always_declare_return_types lint
And fix a zillion omissions this uncovered.
This commit is contained in:
parent
bdc8388699
commit
c7339de6bc
@ -121,7 +121,7 @@ Widget splashScreen() {
|
||||
);
|
||||
}
|
||||
|
||||
main() async {
|
||||
Future main() async {
|
||||
runApp(splashScreen());
|
||||
|
||||
PianoApp app = new PianoApp();
|
||||
|
@ -6,7 +6,7 @@ import 'dart:async';
|
||||
import 'package:flutter_driver/flutter_driver.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() {
|
||||
void main() {
|
||||
group('scrolling performance test', () {
|
||||
FlutterDriver driver;
|
||||
|
||||
|
@ -23,7 +23,7 @@ class Param extends _EquationMember {
|
||||
double get value => variable.value;
|
||||
|
||||
String get name => variable.name;
|
||||
set name(String name) { variable.name = name; }
|
||||
void set name(String name) { variable.name = name; }
|
||||
|
||||
Expression asExpression() => new Expression([new Term(variable, 1.0)], 0.0);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class _Row {
|
||||
double add(double value) => constant += value;
|
||||
|
||||
void insertSymbol(_Symbol symbol, [double coefficient = 1.0]) {
|
||||
double val = _elvis(cells[symbol], 0.0);
|
||||
double val = cells[symbol] ?? 0.0;
|
||||
|
||||
if (_nearZero(val + coefficient)) {
|
||||
cells.remove(symbol);
|
||||
@ -52,7 +52,7 @@ class _Row {
|
||||
solveForSymbol(rhs);
|
||||
}
|
||||
|
||||
double coefficientForSymbol(_Symbol symbol) => _elvis(cells[symbol], 0.0);
|
||||
double coefficientForSymbol(_Symbol symbol) => cells[symbol] ?? 0.0;
|
||||
|
||||
void substitute(_Symbol symbol, _Row row) {
|
||||
double coefficient = cells[symbol];
|
||||
|
@ -583,7 +583,7 @@ class Solver {
|
||||
}
|
||||
}
|
||||
|
||||
return _elvis(entering, new _Symbol(_SymbolType.invalid, 0));
|
||||
return entering ?? new _Symbol(_SymbolType.invalid, 0);
|
||||
}
|
||||
|
||||
String toString() {
|
||||
|
@ -9,11 +9,6 @@ bool _nearZero(double value) {
|
||||
return value < 0.0 ? -value < epsilon : value < epsilon;
|
||||
}
|
||||
|
||||
// Workaround for the lack of a null coalescing operator. Uses a ternary
|
||||
// instead. Sadly, due the lack of generic types on functions, we have to use
|
||||
// dynamic instead.
|
||||
_elvis(a, b) => a != null ? a : b;
|
||||
|
||||
class _Pair<X, Y> {
|
||||
X first;
|
||||
Y second;
|
||||
|
@ -21,7 +21,7 @@ class Variable {
|
||||
return res;
|
||||
}
|
||||
|
||||
String get debugName => _elvis(name, 'variable$_tick');
|
||||
String get debugName => name ?? 'variable$_tick';
|
||||
|
||||
@override
|
||||
String toString() => debugName;
|
||||
|
@ -35,7 +35,7 @@ class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, Service
|
||||
return _instance;
|
||||
}
|
||||
|
||||
initInstances() {
|
||||
void initInstances() {
|
||||
super.initInstances();
|
||||
_instance = this;
|
||||
BuildableElement.scheduleBuildFor = scheduleBuildFor;
|
||||
|
@ -311,7 +311,7 @@ class _SemanticsDebuggerListener implements mojom.SemanticsListener {
|
||||
|
||||
int generation = 0;
|
||||
|
||||
updateSemanticsTree(List<mojom.SemanticsNode> nodes) {
|
||||
void updateSemanticsTree(List<mojom.SemanticsNode> nodes) {
|
||||
generation += 1;
|
||||
for (mojom.SemanticsNode node in nodes)
|
||||
_updateNode(node);
|
||||
|
@ -7,7 +7,7 @@ import 'package:test/test.dart';
|
||||
|
||||
|
||||
void main() {
|
||||
approx(double value, double expectation) {
|
||||
bool approx(double value, double expectation) {
|
||||
const double eps = 1e-6;
|
||||
return (value - expectation).abs() < eps;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ class TestSemanticsListener implements mojom.SemanticsListener {
|
||||
SemanticsNode.addListener(this);
|
||||
}
|
||||
final List<mojom.SemanticsNode> updates = <mojom.SemanticsNode>[];
|
||||
updateSemanticsTree(List<mojom.SemanticsNode> nodes) {
|
||||
void updateSemanticsTree(List<mojom.SemanticsNode> nodes) {
|
||||
assert(!nodes.any((mojom.SemanticsNode node) => node == null));
|
||||
updates.addAll(nodes);
|
||||
updates.add(null);
|
||||
|
@ -7,6 +7,10 @@ import 'message.dart';
|
||||
|
||||
const List<Type> _supportedKeyValueTypes = const <Type>[String, int];
|
||||
|
||||
DriverError _createInvalidKeyValueTypeError(String invalidType) {
|
||||
return new DriverError('Unsupported key value type $invalidType. Flutter Driver only supports ${_supportedKeyValueTypes.join(", ")}');
|
||||
}
|
||||
|
||||
/// Command to find an element.
|
||||
class Find extends Command {
|
||||
final String kind = 'find';
|
||||
@ -20,10 +24,6 @@ class Find extends Command {
|
||||
static Find deserialize(Map<String, String> json) {
|
||||
return new Find(SearchSpecification.deserialize(json));
|
||||
}
|
||||
|
||||
static _throwInvalidKeyValueType(String invalidType) {
|
||||
throw new DriverError('Unsupported key value type $invalidType. Flutter Driver only supports ${_supportedKeyValueTypes.join(", ")}');
|
||||
}
|
||||
}
|
||||
|
||||
/// Describes how to the driver should search for elements.
|
||||
@ -89,7 +89,7 @@ class ByValueKey extends SearchSpecification {
|
||||
this.keyValueString = '$keyValue',
|
||||
this.keyValueType = '${keyValue.runtimeType}' {
|
||||
if (!_supportedKeyValueTypes.contains(keyValue.runtimeType))
|
||||
_throwInvalidKeyValueType('$keyValue.runtimeType');
|
||||
throw _createInvalidKeyValueTypeError('$keyValue.runtimeType');
|
||||
}
|
||||
|
||||
/// The true value of the key.
|
||||
@ -117,13 +117,9 @@ class ByValueKey extends SearchSpecification {
|
||||
case 'String':
|
||||
return new ByValueKey(keyValueString);
|
||||
default:
|
||||
return _throwInvalidKeyValueType(keyValueType);
|
||||
throw _createInvalidKeyValueTypeError(keyValueType);
|
||||
}
|
||||
}
|
||||
|
||||
static _throwInvalidKeyValueType(String invalidType) {
|
||||
throw new DriverError('Unsupported key value type $invalidType. Flutter Driver only supports ${_supportedKeyValueTypes.join(", ")}');
|
||||
}
|
||||
}
|
||||
|
||||
/// Command to read the text from a given element.
|
||||
|
@ -9,7 +9,7 @@ import 'message.dart';
|
||||
class GetHealth implements Command {
|
||||
final String kind = 'get_health';
|
||||
|
||||
static deserialize(Map<String, String> json) => new GetHealth();
|
||||
static GetHealth deserialize(Map<String, String> json) => new GetHealth();
|
||||
|
||||
Map<String, String> serialize() => const {};
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import 'package:mockito/mockito.dart';
|
||||
import 'package:quiver/testing/async.dart';
|
||||
import 'package:vm_service_client/vm_service_client.dart';
|
||||
|
||||
main() {
|
||||
void main() {
|
||||
group('FlutterDriver.connect', () {
|
||||
List<LogRecord> log;
|
||||
StreamSubscription logSub;
|
||||
@ -21,7 +21,7 @@ main() {
|
||||
MockVM mockVM;
|
||||
MockIsolate mockIsolate;
|
||||
|
||||
expectLogContains(String message) {
|
||||
void expectLogContains(String message) {
|
||||
expect(log.map((r) => '$r'), anyElement(contains(message)));
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ import 'package:quiver/testing/time.dart';
|
||||
|
||||
import 'package:flutter_driver/src/retry.dart';
|
||||
|
||||
main() {
|
||||
void main() {
|
||||
group('retry', () {
|
||||
FakeAsync fakeAsync;
|
||||
|
||||
|
@ -125,7 +125,7 @@ class ActionRepeatForever extends Action {
|
||||
/// var myInifiniteLoop = new ActionRepeatForever(myAction);
|
||||
ActionRepeatForever(this.action);
|
||||
|
||||
step(double dt) {
|
||||
void step(double dt) {
|
||||
_elapsedInAction += dt;
|
||||
while (_elapsedInAction > action.duration) {
|
||||
_elapsedInAction -= action.duration;
|
||||
|
@ -67,7 +67,7 @@ class EffectLine extends Node {
|
||||
|
||||
List<Point> get points => _points;
|
||||
|
||||
set points(List<Point> points) {
|
||||
void set points(List<Point> points) {
|
||||
_points = points;
|
||||
_pointAges = <double>[];
|
||||
for (int i = 0; i < _points.length; i++) {
|
||||
|
@ -15,7 +15,7 @@ class Label extends Node {
|
||||
/// The text being drawn by the label.
|
||||
String get text => _text;
|
||||
|
||||
set text(String text) {
|
||||
void set text(String text) {
|
||||
_text = text;
|
||||
_painter = null;
|
||||
}
|
||||
@ -25,7 +25,7 @@ class Label extends Node {
|
||||
/// The style to draw the text in.
|
||||
TextStyle get textStyle => _textStyle;
|
||||
|
||||
set textStyle(TextStyle textStyle) {
|
||||
void set textStyle(TextStyle textStyle) {
|
||||
_textStyle = textStyle;
|
||||
_painter = null;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ class Node {
|
||||
return _constraints;
|
||||
}
|
||||
|
||||
set constraints(List<Constraint> constraints) {
|
||||
void set constraints(List<Constraint> constraints) {
|
||||
_constraints = constraints;
|
||||
if (_spriteBox != null) _spriteBox._constrainedNodes = null;
|
||||
}
|
||||
@ -803,7 +803,7 @@ class Node {
|
||||
/// );
|
||||
PhysicsBody get physicsBody => _physicsBody;
|
||||
|
||||
set physicsBody(PhysicsBody physicsBody) {
|
||||
void set physicsBody(PhysicsBody physicsBody) {
|
||||
if (parent != null) {
|
||||
assert(parent is PhysicsWorld);
|
||||
|
||||
|
@ -13,7 +13,7 @@ class Node3D extends Node {
|
||||
/// The node's rotation around the x axis in degrees.
|
||||
double get rotationX => _rotationX;
|
||||
|
||||
set rotationX(double rotationX) {
|
||||
void set rotationX(double rotationX) {
|
||||
_rotationX = rotationX;
|
||||
invalidateTransformMatrix();
|
||||
}
|
||||
@ -23,7 +23,7 @@ class Node3D extends Node {
|
||||
/// The node's rotation around the y axis in degrees.
|
||||
double get rotationY => _rotationY;
|
||||
|
||||
set rotationY(double rotationY) {
|
||||
void set rotationY(double rotationY) {
|
||||
_rotationY = rotationY;
|
||||
invalidateTransformMatrix();
|
||||
}
|
||||
@ -33,7 +33,7 @@ class Node3D extends Node {
|
||||
/// The projection depth. Default value is 500.0.
|
||||
double get projectionDepth => _projectionDepth;
|
||||
|
||||
set projectionDepth(double projectionDepth) {
|
||||
void set projectionDepth(double projectionDepth) {
|
||||
_projectionDepth = projectionDepth;
|
||||
invalidateTransformMatrix();
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ class PhysicsBody {
|
||||
/// myBody.density = 0.5;
|
||||
double get density => _density;
|
||||
|
||||
set density(double density) {
|
||||
void set density(double density) {
|
||||
_density = density;
|
||||
|
||||
if (_body == null)
|
||||
@ -109,7 +109,7 @@ class PhysicsBody {
|
||||
/// myBody.friction = 0.4;
|
||||
double get friction => _friction;
|
||||
|
||||
set friction(double friction) {
|
||||
void set friction(double friction) {
|
||||
_friction = friction;
|
||||
|
||||
if (_body == null)
|
||||
@ -127,7 +127,7 @@ class PhysicsBody {
|
||||
/// the range of 0.0 to 1.0.
|
||||
///
|
||||
/// myBody.restitution = 0.5;
|
||||
set restitution(double restitution) {
|
||||
void set restitution(double restitution) {
|
||||
_restitution = restitution;
|
||||
|
||||
if (_body == null)
|
||||
@ -146,7 +146,7 @@ class PhysicsBody {
|
||||
/// myBody.isSensor = true;
|
||||
bool get isSensor => _isSensor;
|
||||
|
||||
set isSensor(bool isSensor) {
|
||||
void set isSensor(bool isSensor) {
|
||||
_isSensor = isSensor;
|
||||
|
||||
if (_body == null)
|
||||
@ -171,7 +171,7 @@ class PhysicsBody {
|
||||
}
|
||||
}
|
||||
|
||||
set linearVelocity(Offset linearVelocity) {
|
||||
void set linearVelocity(Offset linearVelocity) {
|
||||
_linearVelocity = linearVelocity;
|
||||
|
||||
if (_body != null) {
|
||||
@ -195,7 +195,7 @@ class PhysicsBody {
|
||||
return _body.angularVelocity;
|
||||
}
|
||||
|
||||
set angularVelocity(double angularVelocity) {
|
||||
void set angularVelocity(double angularVelocity) {
|
||||
_angularVelocity = angularVelocity;
|
||||
|
||||
if (_body != null) {
|
||||
@ -217,7 +217,7 @@ class PhysicsBody {
|
||||
/// myBody.angularDampening = 0.1;
|
||||
double get angularDampening => _angularDampening;
|
||||
|
||||
set angularDampening(double angularDampening) {
|
||||
void set angularDampening(double angularDampening) {
|
||||
_angularDampening = angularDampening;
|
||||
|
||||
if (_body != null)
|
||||
@ -231,7 +231,7 @@ class PhysicsBody {
|
||||
/// myBody.allowSleep = false;
|
||||
bool get allowSleep => _allowSleep;
|
||||
|
||||
set allowSleep(bool allowSleep) {
|
||||
void set allowSleep(bool allowSleep) {
|
||||
_allowSleep = allowSleep;
|
||||
|
||||
if (_body != null)
|
||||
@ -250,7 +250,7 @@ class PhysicsBody {
|
||||
return _awake;
|
||||
}
|
||||
|
||||
set awake(bool awake) {
|
||||
void set awake(bool awake) {
|
||||
_awake = awake;
|
||||
|
||||
if (_body != null)
|
||||
@ -264,7 +264,7 @@ class PhysicsBody {
|
||||
/// myBody.fixedRotation = true;
|
||||
bool get fixedRotation => _fixedRotation;
|
||||
|
||||
set fixedRotation(bool fixedRotation) {
|
||||
void set fixedRotation(bool fixedRotation) {
|
||||
_fixedRotation = fixedRotation;
|
||||
|
||||
if (_body != null)
|
||||
@ -280,7 +280,7 @@ class PhysicsBody {
|
||||
/// if neccessary.
|
||||
///
|
||||
/// myBody.bullet = true;
|
||||
set bullet(bool bullet) {
|
||||
void set bullet(bool bullet) {
|
||||
_bullet = bullet;
|
||||
|
||||
if (_body != null) {
|
||||
@ -301,7 +301,7 @@ class PhysicsBody {
|
||||
return _active;
|
||||
}
|
||||
|
||||
set active(bool active) {
|
||||
void set active(bool active) {
|
||||
_active = active;
|
||||
|
||||
if (_body != null)
|
||||
@ -321,7 +321,7 @@ class PhysicsBody {
|
||||
return _collisionCategory;
|
||||
}
|
||||
|
||||
set collisionCategory(Object collisionCategory) {
|
||||
void set collisionCategory(Object collisionCategory) {
|
||||
_collisionCategory = collisionCategory;
|
||||
_updateFilter();
|
||||
}
|
||||
@ -334,7 +334,7 @@ class PhysicsBody {
|
||||
/// myBody.collisionMask = ["Air", "Ground"];
|
||||
List<Object> get collisionMask => _collisionMask;
|
||||
|
||||
set collisionMask(List<Object> collisionMask) {
|
||||
void set collisionMask(List<Object> collisionMask) {
|
||||
_collisionMask = collisionMask;
|
||||
_updateFilter();
|
||||
}
|
||||
|
@ -9,37 +9,37 @@ part of flutter_sprites;
|
||||
/// group.addChild(myNode);
|
||||
class PhysicsGroup extends Node {
|
||||
|
||||
set scaleX(double scaleX) {
|
||||
void set scaleX(double scaleX) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
set scaleY(double scaleX) {
|
||||
void set scaleY(double scaleX) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
set skewX(double scaleX) {
|
||||
void set skewX(double scaleX) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
set skewY(double scaleX) {
|
||||
void set skewY(double scaleX) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
set physicsBody(PhysicsBody body) {
|
||||
void set physicsBody(PhysicsBody body) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
set position(Point position) {
|
||||
void set position(Point position) {
|
||||
super.position = position;
|
||||
_invalidatePhysicsBodies(this);
|
||||
}
|
||||
|
||||
set rotation(double rotation) {
|
||||
void set rotation(double rotation) {
|
||||
super.rotation = rotation;
|
||||
_invalidatePhysicsBodies(this);
|
||||
}
|
||||
|
||||
set scale(double scale) {
|
||||
void set scale(double scale) {
|
||||
super.scale = scale;
|
||||
_invalidatePhysicsBodies(this);
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ class PhysicsJointRevolute extends PhysicsJoint {
|
||||
/// useful you also need to set [motorSpeed] and [maxMotorTorque].
|
||||
bool get enableMotor => _enableMotor;
|
||||
|
||||
set enableMotor(bool enableMotor) {
|
||||
void set enableMotor(bool enableMotor) {
|
||||
_enableMotor = enableMotor;
|
||||
if (_joint != null) {
|
||||
box2d.RevoluteJoint revoluteJoint = _joint;
|
||||
@ -161,7 +161,7 @@ class PhysicsJointRevolute extends PhysicsJoint {
|
||||
/// set to true and [maxMotorTorque] is set to a non zero value.
|
||||
double get motorSpeed => _motorSpeed;
|
||||
|
||||
set motorSpeed(double motorSpeed) {
|
||||
void set motorSpeed(double motorSpeed) {
|
||||
_motorSpeed = motorSpeed;
|
||||
if (_joint != null) {
|
||||
box2d.RevoluteJoint revoluteJoint = _joint;
|
||||
@ -175,7 +175,7 @@ class PhysicsJointRevolute extends PhysicsJoint {
|
||||
|
||||
/// Sets the motor torque of this joint, will only work if [enableMotor] is
|
||||
/// set to true and [motorSpeed] is set to a non zero value.
|
||||
set maxMotorTorque(double maxMotorTorque) {
|
||||
void set maxMotorTorque(double maxMotorTorque) {
|
||||
_maxMotorTorque = maxMotorTorque;
|
||||
if (_joint != null) {
|
||||
box2d.RevoluteJoint revoluteJoint = _joint;
|
||||
@ -252,7 +252,7 @@ class PhysicsJointPrismatic extends PhysicsJoint {
|
||||
/// [maxMotorForce].
|
||||
bool get enableMotor => _enableMotor;
|
||||
|
||||
set enableMotor(bool enableMotor) {
|
||||
void set enableMotor(bool enableMotor) {
|
||||
_enableMotor = enableMotor;
|
||||
if (_joint != null) {
|
||||
box2d.PrismaticJoint prismaticJoint = _joint;
|
||||
@ -266,7 +266,7 @@ class PhysicsJointPrismatic extends PhysicsJoint {
|
||||
/// set to true and [maxMotorForce] is set to a non zero value.
|
||||
double get motorSpeed => _motorSpeed;
|
||||
|
||||
set motorSpeed(double motorSpeed) {
|
||||
void set motorSpeed(double motorSpeed) {
|
||||
_motorSpeed = motorSpeed;
|
||||
if (_joint != null) {
|
||||
box2d.PrismaticJoint prismaticJoint = _joint;
|
||||
@ -280,7 +280,7 @@ class PhysicsJointPrismatic extends PhysicsJoint {
|
||||
/// set to true and [motorSpeed] is set to a non zero value.
|
||||
double get maxMotorForce => _maxMotorForce;
|
||||
|
||||
set maxMotorForce(double maxMotorForce) {
|
||||
void set maxMotorForce(double maxMotorForce) {
|
||||
_maxMotorForce = maxMotorForce;
|
||||
if (_joint != null) {
|
||||
box2d.PrismaticJoint prismaticJoint = _joint;
|
||||
|
@ -74,7 +74,7 @@ class PhysicsWorld extends Node {
|
||||
return new Offset(g.x, g.y);
|
||||
}
|
||||
|
||||
set gravity(Offset gravity) {
|
||||
void set gravity(Offset gravity) {
|
||||
// Convert from points/s^2 to m/s^2
|
||||
b2World.setGravity(new Vector2(gravity.dx / b2WorldToNodeConversionFactor,
|
||||
gravity.dy / b2WorldToNodeConversionFactor));
|
||||
@ -83,14 +83,14 @@ class PhysicsWorld extends Node {
|
||||
/// If set to true, objects can fall asleep if the haven't moved in a while.
|
||||
bool get allowSleep => b2World.isAllowSleep();
|
||||
|
||||
set allowSleep(bool allowSleep) {
|
||||
void set allowSleep(bool allowSleep) {
|
||||
b2World.setAllowSleep(allowSleep);
|
||||
}
|
||||
|
||||
/// True if sub stepping should be used in the simulation.
|
||||
bool get subStepping => b2World.isSubStepping();
|
||||
|
||||
set subStepping(bool subStepping) {
|
||||
void set subStepping(bool subStepping) {
|
||||
b2World.setSubStepping(subStepping);
|
||||
}
|
||||
|
||||
|
@ -137,11 +137,8 @@ SoundTrackPlayer _sharedSoundTrackPlayer;
|
||||
class SoundTrackPlayer {
|
||||
Set<SoundTrack> _soundTracks = new HashSet<SoundTrack>();
|
||||
|
||||
static sharedInstance() {
|
||||
if (_sharedSoundTrackPlayer == null) {
|
||||
_sharedSoundTrackPlayer = new SoundTrackPlayer();
|
||||
}
|
||||
return _sharedSoundTrackPlayer;
|
||||
static SoundTrackPlayer sharedInstance() {
|
||||
return _sharedSoundTrackPlayer ??= new SoundTrackPlayer();
|
||||
}
|
||||
|
||||
SoundTrackPlayer() {
|
||||
|
@ -38,7 +38,8 @@ class SpriteBox extends RenderBox {
|
||||
|| value.size.height > 0);
|
||||
|
||||
// Remove sprite box references
|
||||
if (_rootNode != null) _removeSpriteBoxReference(_rootNode);
|
||||
if (_rootNode != null)
|
||||
_removeSpriteBoxReference(_rootNode);
|
||||
|
||||
// Update the value
|
||||
_rootNode = value;
|
||||
@ -374,7 +375,7 @@ class SpriteBox extends RenderBox {
|
||||
double delta = (timeStamp - _lastTimeStamp).inMicroseconds.toDouble() / Duration.MICROSECONDS_PER_SECOND;
|
||||
_lastTimeStamp = timeStamp;
|
||||
|
||||
_frameRate = 1.0/delta;
|
||||
_frameRate = 1.0 / delta;
|
||||
|
||||
if (_initialized) {
|
||||
_callConstraintsPreUpdate(delta);
|
||||
@ -497,7 +498,7 @@ class SpriteBox extends RenderBox {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
_addNodesAtPosition(Node node, Point position, List<Node> list) {
|
||||
void _addNodesAtPosition(Node node, Point position, List<Node> list) {
|
||||
// Visit children first
|
||||
for (Node child in node.children) {
|
||||
_addNodesAtPosition(child, position, list);
|
||||
|
@ -21,7 +21,7 @@ class TexturedLinePainter {
|
||||
|
||||
List<Point> get points => _points;
|
||||
|
||||
set points(List<Point> points) {
|
||||
void set points(List<Point> points) {
|
||||
_points = points;
|
||||
_calculatedTextureStops = null;
|
||||
}
|
||||
@ -32,7 +32,7 @@ class TexturedLinePainter {
|
||||
|
||||
Texture get texture => _texture;
|
||||
|
||||
set texture(Texture texture) {
|
||||
void set texture(Texture texture) {
|
||||
_texture = texture;
|
||||
if (texture == null) {
|
||||
_cachedPaint = new Paint();
|
||||
@ -68,9 +68,9 @@ class TexturedLinePainter {
|
||||
|
||||
double _textureLoopLength;
|
||||
|
||||
get textureLoopLength => textureLoopLength;
|
||||
double get textureLoopLength => textureLoopLength;
|
||||
|
||||
set textureLoopLength(double textureLoopLength) {
|
||||
void set textureLoopLength(double textureLoopLength) {
|
||||
_textureLoopLength = textureLoopLength;
|
||||
_calculatedTextureStops = null;
|
||||
}
|
||||
|
@ -4,4 +4,6 @@
|
||||
|
||||
import 'package:flutter_tools/executable.dart' as executable;
|
||||
|
||||
main(List<String> args) => executable.main(args);
|
||||
void main(List<String> args) {
|
||||
executable.main(args);
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ class AdbDevice {
|
||||
/// Device model; can be null. `XT1045`, `Nexus_7`
|
||||
String get modelID => _info['model'];
|
||||
|
||||
set modelID(String value) {
|
||||
void set modelID(String value) {
|
||||
_info['model'] = value;
|
||||
}
|
||||
|
||||
|
@ -288,6 +288,7 @@ analyzer:
|
||||
todo: ignore
|
||||
linter:
|
||||
rules:
|
||||
- always_declare_return_types
|
||||
# we'll turn on avoid_as as soon as it doesn't complain about "as dynamic"
|
||||
# - avoid_as
|
||||
- camel_case_types
|
||||
|
@ -5,9 +5,7 @@
|
||||
import 'package:flutter_tools/src/android/adb.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
Adb adb = new Adb('adb');
|
||||
|
||||
// We only test the [Adb] class is we're able to locate the adb binary.
|
||||
|
@ -14,9 +14,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
AnalysisServer server;
|
||||
Directory tempDir;
|
||||
|
||||
|
@ -7,9 +7,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('android_device', () {
|
||||
testUsingContext('stores the requested id', () {
|
||||
String deviceId = '1234';
|
||||
|
@ -7,9 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_tools/src/base/utils.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('ItemListNotifier', () {
|
||||
test('sends notifications', () async {
|
||||
ItemListNotifier<String> list = new ItemListNotifier<String>();
|
||||
|
@ -7,9 +7,7 @@ import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/globals.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('DeviceManager', () {
|
||||
test('error', () async {
|
||||
AppContext context = new AppContext();
|
||||
|
@ -13,9 +13,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('create', () {
|
||||
Directory temp;
|
||||
|
||||
|
@ -17,9 +17,7 @@ import 'package:test/test.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
Daemon daemon;
|
||||
AppContext appContext;
|
||||
NotifyingLogger notifyingLogger;
|
||||
|
@ -7,9 +7,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('DeviceManager', () {
|
||||
testUsingContext('getDevices', () async {
|
||||
// Test that DeviceManager.getDevices() doesn't throw.
|
||||
|
@ -10,9 +10,7 @@ import 'package:test/test.dart';
|
||||
import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('devices', () {
|
||||
testUsingContext('returns 0 when called', () {
|
||||
DevicesCommand command = new DevicesCommand();
|
||||
|
@ -20,9 +20,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('drive', () {
|
||||
DriveCommand command;
|
||||
Device mockDevice;
|
||||
@ -182,7 +180,7 @@ defineTests() {
|
||||
});
|
||||
|
||||
group('findTargetDevice on iOS', () {
|
||||
setOs() {
|
||||
void setOs() {
|
||||
when(os.isMacOS).thenReturn(true);
|
||||
when(os.isLinux).thenReturn(false);
|
||||
}
|
||||
@ -222,7 +220,7 @@ defineTests() {
|
||||
});
|
||||
|
||||
group('findTargetDevice on Linux', () {
|
||||
setOs() {
|
||||
void setOs() {
|
||||
when(os.isMacOS).thenReturn(false);
|
||||
when(os.isLinux).thenReturn(true);
|
||||
}
|
||||
|
@ -10,9 +10,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('install', () {
|
||||
testUsingContext('returns 0 when Android is connected and ready for an install', () {
|
||||
InstallCommand command = new InstallCommand();
|
||||
|
@ -9,9 +9,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('listen', () {
|
||||
testUsingContext('returns 1 when no device is connected', () {
|
||||
ListenCommand command = new ListenCommand(singleRun: true);
|
||||
|
@ -9,9 +9,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('logs', () {
|
||||
testUsingContext('fail with a bad device id', () {
|
||||
LogsCommand command = new LogsCommand();
|
||||
|
@ -8,9 +8,7 @@ import 'package:flutter_tools/src/base/os.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('OperatingSystemUtils', () {
|
||||
Directory temp;
|
||||
|
||||
|
@ -9,9 +9,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('run', () {
|
||||
testUsingContext('fails when target not found', () {
|
||||
RunCommand command = new RunCommand();
|
||||
|
@ -9,9 +9,7 @@ import 'package:flutter_tools/src/service_protocol.dart';
|
||||
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('service_protocol', () {
|
||||
test('Discovery Heartbeat', () async {
|
||||
MockDeviceLogReader logReader = new MockDeviceLogReader();
|
||||
|
@ -12,9 +12,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('stop', () {
|
||||
testUsingContext('returns 0 when Android is connected and ready to be stopped', () {
|
||||
StopCommand command = new StopCommand();
|
||||
|
@ -9,9 +9,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('trace', () {
|
||||
testUsingContext('returns 1 when no Android device is connected', () {
|
||||
TraceCommand command = new TraceCommand();
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert' hide BASE64;
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
@ -7,7 +8,7 @@ import 'package:flx/bundle.dart';
|
||||
import 'package:flx/signing.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() async {
|
||||
Future main() async {
|
||||
// The following constant was generated via the openssl shell commands:
|
||||
// openssl ecparam -genkey -name prime256v1 -out privatekey.pem
|
||||
// openssl ec -in privatekey.pem -outform DER | base64
|
||||
|
@ -8,7 +8,7 @@ import 'package:crypto/crypto.dart';
|
||||
import 'package:flx/signing.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() async {
|
||||
Future main() async {
|
||||
// The following constant was generated via the openssl shell commands:
|
||||
// openssl ecparam -genkey -name prime256v1 -out privatekey.pem
|
||||
// openssl ec -in privatekey.pem -outform DER | base64
|
||||
|
Loading…
x
Reference in New Issue
Block a user