Skip to content

Commit

Permalink
Migrate utils/comparators
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Zhao <[email protected]>
  • Loading branch information
GZGavinZhao committed Jan 11, 2022
1 parent 2f1922c commit 7b672a8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions angular_components/lib/utils/comparators/comparators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// @dart=2.9
// ignore_for_file: hash_and_equals

/// Use this as a mixin to be able to use arithmetic comparison operators
/// in your class.
Expand All @@ -17,7 +17,9 @@ abstract class Comparators<T> implements Comparable<T> {

@override
bool operator ==(other) =>
other is T && runtimeType == other.runtimeType && compareTo(other) == 0;
other is T &&
runtimeType == other.runtimeType &&
compareTo(other as T) == 0;
}

/// This can be extended in classes that are using const constructors.
Expand All @@ -33,5 +35,7 @@ abstract class ConstComparators<T> implements Comparable<T> {

@override
bool operator ==(other) =>
other is T && runtimeType == other.runtimeType && compareTo(other) == 0;
other is T &&
runtimeType == other.runtimeType &&
compareTo(other as T) == 0;
}

0 comments on commit 7b672a8

Please sign in to comment.