del cache

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-11-01 17:26:21 +08:00
parent 77dd939172
commit 737be8dcac
12 changed files with 105 additions and 68 deletions

View File

@@ -82,7 +82,10 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
).colorScheme.secondaryContainer.withValues(alpha: 0.5);
void onClear() {
pathList.removeAt(index);
final path = pathList.removeAt(index);
if (Utils.isMobile) {
File(path).tryDel();
}
if (pathList.isEmpty && editController.rawText.trim().isEmpty) {
enablePublish.value = false;
}
@@ -148,8 +151,9 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
Future<void> onCropImage(int index) async {
late final colorScheme = ColorScheme.of(context);
CroppedFile? croppedFile = await ImageCropper.platform.cropImage(
sourcePath: pathList[index],
final sourcePath = pathList[index];
final croppedFile = await ImageCropper.platform.cropImage(
sourcePath: sourcePath,
uiSettings: [
AndroidUiSettings(
toolbarTitle: '裁剪',
@@ -161,6 +165,7 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
],
);
if (croppedFile != null) {
File(sourcePath).tryDel();
pathList[index] = croppedFile.path;
}
}