mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
fix: Sync leaving left over temp files (#73)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
c5e39db9ec
commit
8d15e319d3
15 changed files with 644 additions and 406 deletions
|
|
@ -5,12 +5,12 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
|
||||
import 'package:fladder/models/syncing/sync_item.dart';
|
||||
import 'package:fladder/util/list_padding.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
|
||||
///This is a wrapper widget for marking a synced item as deleted (while it is being deleted)
|
||||
class SyncMarkedForDelete extends ConsumerWidget {
|
||||
class SyncStatusOverlay extends ConsumerWidget {
|
||||
final SyncedItem syncedItem;
|
||||
final Widget child;
|
||||
const SyncMarkedForDelete({required this.syncedItem, required this.child, super.key});
|
||||
const SyncStatusOverlay({required this.syncedItem, required this.child, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
|
|
@ -32,12 +32,35 @@ class SyncMarkedForDelete extends ConsumerWidget {
|
|||
strokeCap: StrokeCap.round,
|
||||
valueColor: AlwaysStoppedAnimation(Theme.of(context).colorScheme.error),
|
||||
),
|
||||
const Text("Deleting"),
|
||||
Text(context.localized.syncOverlayDeleting),
|
||||
const Icon(IconsaxOutline.trash)
|
||||
].addPadding(const EdgeInsets.symmetric(horizontal: 16)),
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
if (syncedItem.syncing)
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
semanticContainer: false,
|
||||
color: Colors.black.withOpacity(0.6),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator.adaptive(
|
||||
strokeCap: StrokeCap.round,
|
||||
valueColor: AlwaysStoppedAnimation(Theme.of(context).colorScheme.error),
|
||||
),
|
||||
Text(context.localized.syncOverlaySyncing),
|
||||
const Icon(IconsaxOutline.cloud_notif)
|
||||
].addPadding(const EdgeInsets.symmetric(horizontal: 16)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
@ -1,4 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:ficonsax/ficonsax.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/models/items/episode_model.dart';
|
||||
import 'package:fladder/models/syncing/sync_item.dart';
|
||||
import 'package:fladder/providers/sync/sync_provider_helpers.dart';
|
||||
|
|
@ -10,8 +14,6 @@ import 'package:fladder/util/list_padding.dart';
|
|||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/util/size_formatting.dart';
|
||||
import 'package:fladder/widgets/shared/icon_button_await.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class SyncedEpisodeItem extends ConsumerStatefulWidget {
|
||||
const SyncedEpisodeItem({
|
||||
|
|
@ -106,7 +108,7 @@ class _SyncedEpisodeItemState extends ConsumerState<SyncedEpisodeItem> {
|
|||
context.localized.syncRemoveDataTitle,
|
||||
context.localized.syncRemoveDataDesc,
|
||||
(context) async {
|
||||
await ref.read(syncProvider.notifier).deleteFullSyncFiles(syncedItem);
|
||||
await ref.read(syncProvider.notifier).deleteFullSyncFiles(syncedItem, downloadTask.task);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
context.localized.delete,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue