mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
18 lines
378 B
Dart
18 lines
378 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
extension ImageExtension on num {
|
|
int cacheSize(BuildContext context) {
|
|
return (this * MediaQuery.of(context).devicePixelRatio).round();
|
|
}
|
|
}
|
|
|
|
extension ScrollControllerExt on ScrollController {
|
|
void animToTop() {
|
|
animateTo(
|
|
0,
|
|
duration: const Duration(milliseconds: 500),
|
|
curve: Curves.ease,
|
|
);
|
|
}
|
|
}
|