-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from takenet/release/0.0.87
[Release] 0.0.87
- Loading branch information
Showing
9 changed files
with
98 additions
and
102 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
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,64 @@ | ||
import 'package:file_sizes/file_sizes.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../../themes/colors/ds_colors.theme.dart'; | ||
import '../texts/ds_caption_small_text.widget.dart'; | ||
|
||
class DSCircularProgress extends StatelessWidget { | ||
final RxInt maximumProgress; | ||
final RxInt currentProgress; | ||
final Color? foregroundColor; | ||
|
||
const DSCircularProgress({ | ||
super.key, | ||
required this.maximumProgress, | ||
required this.currentProgress, | ||
this.foregroundColor, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Obx( | ||
() { | ||
final double percent = maximumProgress.value > 0 | ||
? currentProgress.value / maximumProgress.value | ||
: 0; | ||
|
||
return SizedBox( | ||
width: double.infinity, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
mainAxisSize: MainAxisSize.max, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: CircularProgressIndicator( | ||
color: DSColors.primary, | ||
backgroundColor: Colors.grey, | ||
value: currentProgress.value < maximumProgress.value | ||
? percent | ||
: null, | ||
), | ||
), | ||
DSCaptionSmallText( | ||
_buildProgress(), | ||
color: foregroundColor ?? DSColors.neutralDarkCity, | ||
) | ||
], | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
|
||
String _buildProgress() { | ||
String getSize(int value) => FileSize.getSize( | ||
value, | ||
precision: PrecisionValue.One, | ||
); | ||
|
||
return '${getSize(currentProgress.value)} / ${getSize(maximumProgress.value)}'; | ||
} | ||
} |
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