26 lines
664 B
Dart
26 lines
664 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:tstor_ui/utils/bytes.dart';
|
||
|
|
||
|
class DownloadProgress extends StatelessWidget {
|
||
|
final int current;
|
||
|
final int total;
|
||
|
|
||
|
const DownloadProgress(this.current, this.total, {super.key});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return SizedBox(
|
||
|
height: 32,
|
||
|
child: Row(
|
||
|
children: [
|
||
|
Text("${current.bytesFormat()}/${total.bytesFormat()}"),
|
||
|
const SizedBox(width: 10),
|
||
|
Expanded(child: LinearProgressIndicator(value: current / total)),
|
||
|
const SizedBox(width: 10),
|
||
|
Text("${current / total * 100}%"),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|