constant_member.dart 461 Bytes
Newer Older
Chinmay Garde's avatar
Chinmay Garde committed
1 2 3 4 5 6
// 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;

7
class ConstantMember extends _EquationMember {
8
  final double value;
9

10 11
  bool get isConstant => true;

Chinmay Garde's avatar
Chinmay Garde committed
12 13
  ConstantMember(this.value);

14
  Expression asExpression() => new Expression([], this.value);
Chinmay Garde's avatar
Chinmay Garde committed
15 16
}

17
ConstantMember cm(double value) {
Chinmay Garde's avatar
Chinmay Garde committed
18 19
  return new ConstantMember(value);
}