tstor/ui/lib/components/download.dart
2024-04-24 20:36:33 +03:00

25 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}%"),
],
),
);
}
}