-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5c223c
commit 699b130
Showing
32 changed files
with
817 additions
and
1,582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...eens/main/secondary_view/contents/downloading/components/confirm_cancellation_dialog.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import '../../../../../../shared/state/download_provider.dart'; | ||
|
||
class ConfirmCancellationDialog extends StatefulWidget { | ||
const ConfirmCancellationDialog({super.key}); | ||
|
||
@override | ||
State<ConfirmCancellationDialog> createState() => | ||
_ConfirmCancellationDialogState(); | ||
} | ||
|
||
class _ConfirmCancellationDialogState extends State<ConfirmCancellationDialog> { | ||
bool _isCancelling = false; | ||
|
||
@override | ||
Widget build(BuildContext context) => AlertDialog.adaptive( | ||
icon: const Icon(Icons.cancel), | ||
title: const Text('Cancel download?'), | ||
content: const Text('Any tiles already downloaded will not be removed'), | ||
actions: _isCancelling | ||
? [const CircularProgressIndicator.adaptive()] | ||
: [ | ||
TextButton( | ||
onPressed: () => Navigator.of(context).pop(false), | ||
child: const Text('Continue download'), | ||
), | ||
FilledButton( | ||
onPressed: () async { | ||
setState(() => _isCancelling = true); | ||
await context.read<DownloadingProvider>().cancel(); | ||
if (context.mounted) Navigator.of(context).pop(true); | ||
}, | ||
child: const Text('Cancel download'), | ||
), | ||
], | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
...secondary_view/contents/downloading/components/statistics/components/progress/colors.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class DownloadingProgressIndicatorColors { | ||
static final pendingColor = Colors.grey[350]!; | ||
static const failedColor = Colors.red; | ||
static const skippedColor = Colors.orange; | ||
static const successfulColor = Colors.green; | ||
} |
Oops, something went wrong.