mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 09:06:36 +08:00
tweaks (#1142)
* opt: unused layout * mod: semantics * opt: DanmakuMsg type * opt: avoid cast * opt: unnecessary_lambdas * opt: use isEven * opt: logger * opt: invalid common page * tweak * opt: unify DynController
This commit is contained in:
committed by
GitHub
parent
56ffc2781f
commit
5f8313901b
@@ -48,6 +48,18 @@ extension IterableExt<T> on Iterable<T>? {
|
||||
bool get isNullOrEmpty => this == null || this!.isEmpty;
|
||||
}
|
||||
|
||||
extension MapExt<K, V> on Map<K, V> {
|
||||
Map<RK, RV> fromCast<RK, RV>() {
|
||||
return Map<RK, RV>.from(this);
|
||||
}
|
||||
}
|
||||
|
||||
extension NonNullListExt<T> on List<T> {
|
||||
List<R> fromCast<R>() {
|
||||
return List<R>.from(this);
|
||||
}
|
||||
}
|
||||
|
||||
extension ListExt<T> on List<T>? {
|
||||
T? getOrNull(int index) {
|
||||
if (isNullOrEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user