opt: unread & zan grpc & readlist open with browser (#852)

* opt: unread

* opt: zan grpc

* feat: readlist open with browser
This commit is contained in:
My-Responsitories
2025-05-11 18:58:00 +08:00
committed by GitHub
parent 8d34e6f340
commit 72734d4b4e
13 changed files with 127 additions and 208 deletions

View File

@@ -57,23 +57,6 @@ extension ListExt<T> on List<T>? {
T getOrElse(int index, {required T Function() orElse}) {
return getOrNull(index) ?? orElse();
}
bool eq(List<T>? other) {
if (this == null) {
return other == null;
}
if (other == null || this!.length != other.length) {
return false;
}
for (int index = 0; index < this!.length; index += 1) {
if (this![index] != other[index]) {
return false;
}
}
return true;
}
bool ne(List<T>? other) => !eq(other);
}
final _regExp = RegExp("^(http:)?//", caseSensitive: false);
@@ -128,17 +111,6 @@ extension ColorExtension on Color {
assert(amount >= 0 && amount <= 1, 'Amount must be between 0 and 1');
return Color.lerp(this, Colors.black, amount)!;
}
Color blend(Color color, [double fraction = 0.5]) {
assert(fraction >= 0 && fraction <= 1, 'Fraction must be between 0 and 1');
final blendedRed = (red * (1 - fraction) + color.red * fraction).toInt();
final blendedGreen =
(green * (1 - fraction) + color.green * fraction).toInt();
final blendedBlue = (blue * (1 - fraction) + color.blue * fraction).toInt();
final blendedAlpha =
(alpha * (1 - fraction) + color.alpha * fraction).toInt();
return Color.fromARGB(blendedAlpha, blendedRed, blendedGreen, blendedBlue);
}
}
extension BrightnessExt on Brightness {