mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
16 lines
395 B
Dart
16 lines
395 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() {
|
|
if (!hasClients) return;
|
|
animateTo(0,
|
|
duration: const Duration(milliseconds: 500), curve: Curves.easeInOut);
|
|
}
|
|
}
|