Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-25 13:43:20 +08:00
parent 161bf2eedb
commit 20a36e8f9a
97 changed files with 596 additions and 436 deletions

View File

@@ -1,3 +1,5 @@
import 'dart:math' show pow;
import 'package:flutter/widgets.dart';
extension ImageExtension on num {
@@ -13,3 +15,10 @@ extension IntExt on int? {
int? operator +(int other) => this == null ? null : this! + other;
int? operator -(int other) => this == null ? null : this! - other;
}
extension DoubleExt on double {
double toPrecision(int fractionDigits) {
var mod = pow(10, fractionDigits.toDouble()).toDouble();
return ((this * mod).round().toDouble() / mod);
}
}