Hixie 6795efacab Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-12 00:37:31 -08:00

30 lines
780 B
Dart

// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of cassowary;
class Param extends _EquationMember {
Param([double value = 0.0]) : variable = new Variable(value) {
variable._owner = this;
}
Param.withContext(dynamic context, [double value = 0.0])
: variable = new Variable(value),
context = context {
variable._owner = this;
}
final Variable variable;
dynamic context;
bool get isConstant => false;
double get value => variable.value;
String get name => variable.name;
void set name(String name) { variable.name = name; }
Expression asExpression() => new Expression(<Term>[new Term(variable, 1.0)], 0.0);
}