Merge pull request #18 from My1/patch-1

Update game_steps_widget.dart
This commit is contained in:
ALEZ 2024-10-31 21:31:11 +01:00 committed by GitHub
commit adc97cf5bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- Changed "Gb" (which ordinarily would be Gigabits) to "GiB" in the download progress
## [0.1.2] - 2024-10-28
### Changed

View File

@ -107,8 +107,9 @@ class _DownloadingGame extends StatelessWidget {
final provider = Provider.of<Game>(context);
final pourcent =
(provider.currentProgress.toInt() / provider.maxProgress.toInt()) * 100;
final currentGb = provider.currentProgress.toInt() / 1024 / 1024 / 1024;
final maxGb = provider.maxProgress.toInt() / 1024 / 1024 / 1024;
//1024^3 = 1073741824
final currentGb = provider.currentProgress.toInt() / 1073741824;
final maxGb = provider.maxProgress.toInt() / 1073741824;
return Padding(
padding: const EdgeInsets.only(bottom: 40.0),
@ -118,7 +119,7 @@ class _DownloadingGame extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
"${currentGb.toStringAsFixed(2)} / ${maxGb.toStringAsFixed(2)} Gb (${pourcent.toStringAsFixed(2)}%)",
"${currentGb.toStringAsFixed(2)} / ${maxGb.toStringAsFixed(2)} GiB (${pourcent.toStringAsFixed(2)}%)",
),
),
YaruLinearProgressIndicator(