master #81
22
packages/wyatt_type_utils/lib/src/extensions/extensions.dart
Normal file
22
packages/wyatt_type_utils/lib/src/extensions/extensions.dart
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
export 'date_time_extension.dart';
|
||||||
|
export 'encoding.dart';
|
||||||
|
export 'iterable_extension.dart';
|
||||||
|
export 'num_extension.dart';
|
||||||
|
export 'object_extension.dart';
|
||||||
|
export 'string_extension.dart';
|
@ -0,0 +1,51 @@
|
|||||||
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
extension NumExtension on num? {
|
||||||
|
bool operator <(num? other) {
|
||||||
|
if (this == null || other == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this < other;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator >(num? other) {
|
||||||
|
if (this == null || other == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this > other;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator <=(num? other) {
|
||||||
|
if (this == null && other == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (this == null || other == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this <= other;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator >=(num? other) {
|
||||||
|
if (this == null && other == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (this == null || other == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this >= other;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user