mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-16 22:24:04 +08:00
@@ -1,16 +1,5 @@
|
||||
import 'dart:math' show pow;
|
||||
|
||||
import 'package:flutter/widgets.dart' show BuildContext, MediaQuery;
|
||||
|
||||
extension ImageExtension on num {
|
||||
int? cacheSize(BuildContext context) {
|
||||
if (this == 0) {
|
||||
return null;
|
||||
}
|
||||
return (this * MediaQuery.devicePixelRatioOf(context)).round();
|
||||
}
|
||||
}
|
||||
|
||||
extension IntExt on int? {
|
||||
int? operator +(int other) => this == null ? null : this! + other;
|
||||
int? operator -(int other) => this == null ? null : this! - other;
|
||||
|
||||
Reference in New Issue
Block a user