Skip to content

Commit

Permalink
greenify percent when 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Ray committed Dec 3, 2024
1 parent 6dc3db5 commit 2fb7040
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions app/lib/screens/torrents/sheets/torrent_details/tabs/files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ class FilesTab extends StatelessWidget {
: (bool? checked) =>
_handleWantedChange(context, index, checked))),
title: Text(file.name),
subtitle: Text(
'${percent.toString()}% • ${prettyBytes(file.length.toDouble())}'),
subtitle: Row(
children: [
Text('${percent.toString()}%',
style: TextStyle(
color: percent == 100 ? Colors.lightGreen : null)),
Text(' • ${prettyBytes(file.length.toDouble())}')
],
),
onTap: () => _openFile(file.name));
},
);
Expand Down
8 changes: 4 additions & 4 deletions app/lib/screens/torrents/torrent_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ class TorrentListTile extends StatelessWidget {
builder: (BuildContext context) {
return RemoveTorrentDialog(torrent: torrent);
}),
// Rouge au survol
icon: const Icon(
Icons.delete_outline,
// color: Colors.red
))
: null,

subtitle: Row(children: [
Expanded(
child: Text('${percent.floor().toString()}%',
style:
const TextStyle(fontWeight: FontWeight.bold, fontSize: 12)),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
color: percent == 100 ? Colors.lightGreen : null)),
),
Expanded(
child: Text(
Expand Down

0 comments on commit 2fb7040

Please sign in to comment.