tstor/ui/lib/components/download.dart

26 lines
664 B
Dart
Raw Normal View History

2024-04-24 17:36:33 +00:00
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}%"),
],
),
);
}
}