constant_member.dart 497 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 {
Ian Hickson's avatar
Ian Hickson committed
8 9
  ConstantMember(this.value);

pq's avatar
pq committed
10
  @override
11
  final double value;
12

pq's avatar
pq committed
13
  @override
14 15
  bool get isConstant => true;

pq's avatar
pq committed
16
  @override
17
  Expression asExpression() => new Expression([], this.value);
Chinmay Garde's avatar
Chinmay Garde committed
18 19
}

20
ConstantMember cm(double value) {
Chinmay Garde's avatar
Chinmay Garde committed
21 22
  return new ConstantMember(value);
}