-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update start/stop/completed icons, and add status feedback
- Loading branch information
Showing
3 changed files
with
72 additions
and
28 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
37 changes: 37 additions & 0 deletions
37
app/lib/screens/torrents/torrent_list_tile/torrent_status.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,37 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:pikatorrent/engine/torrent.dart'; | ||
|
||
class TorrentStatusText extends StatelessWidget { | ||
final Torrent torrent; | ||
final double percent; | ||
|
||
const TorrentStatusText( | ||
{super.key, required this.torrent, required this.percent}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return switch (torrent.status) { | ||
TorrentStatus.stopped => const Text('Paused', | ||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12)), | ||
TorrentStatus.queuedToCheck => const Text('Queued to check', | ||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12)), | ||
TorrentStatus.checking => const Text('Checking', | ||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12)), | ||
TorrentStatus.queuedToDownload => const Text('Queued to download', | ||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12)), | ||
TorrentStatus.downloading => Text('${percent.floor().toString()}%', | ||
style: const TextStyle( | ||
fontWeight: FontWeight.bold, | ||
fontSize: 12, | ||
color: Colors.lightGreen)), | ||
TorrentStatus.queuedToSeed => const Text('Queued to seed', | ||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12)), | ||
TorrentStatus.seeding => const Text('Seeding', | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
fontSize: 12, | ||
color: Colors.lightBlue)), | ||
null => const Text('-'), | ||
}; | ||
} | ||
} |
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