💄 Optimize file upload prograss indicates

This commit is contained in:
2025-11-09 01:59:24 +08:00
parent 5e7d77e1a1
commit e4019dadc8
10 changed files with 61 additions and 28 deletions

View File

@@ -131,7 +131,7 @@ class ArticleComposeAttachments extends ConsumerWidget {
],
),
children: [
ValueListenableBuilder<Map<int, double>>(
ValueListenableBuilder<Map<int, double?>>(
valueListenable: state.attachmentProgress,
builder: (context, progressMap, _) {
return Wrap(

View File

@@ -33,7 +33,7 @@ class ComposeState {
final TextEditingController slugController;
final ValueNotifier<int> visibility;
final ValueNotifier<List<UniversalFile>> attachments;
final ValueNotifier<Map<int, double>> attachmentProgress;
final ValueNotifier<Map<int, double?>> attachmentProgress;
final ValueNotifier<SnPublisher?> currentPublisher;
final ValueNotifier<bool> submitting;
final ValueNotifier<List<SnPostCategory>> categories;
@@ -520,7 +520,7 @@ class ComposeLogic {
onProgress: (progress, _) {
state.attachmentProgress.value = {
...state.attachmentProgress.value,
index: progress,
index: progress ?? 0.0,
};
},
).future;