Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix: show speed in desktop file transfer status (#15980)

fufesoufd471fcf028e
diff --git a/flutter/lib/desktop/pages/file_manager_page.dart b/flutter/lib/desktop/pages/file_manager_page.dart
index cf97351b3..e1130fdaa 100644
--- a/flutter/lib/desktop/pages/file_manager_page.dart
+++ b/flutter/lib/desktop/pages/file_manager_page.dart
@@ -278,7 +278,39 @@ class _FileManagerPageState extends State<FileManagerPage>
item.state != JobState.inProgress,
child: LinearPercentIndicator(
animateFromLastPercent: true,
- center: Text(item.percentText),
+ center: SizedBox.expand(
+ child: ShaderMask(
+ blendMode: BlendMode.srcATop,
+ shaderCallback: (bounds) =>
+ LinearGradient(
+ colors: [
+ Colors.white,
+ Colors.transparent,
+ ],
+ stops: [item.percent, item.percent],
+ ).createShader(bounds),
+ child: FittedBox(
+ fit: BoxFit.scaleDown,
+ child: Text.rich(
+ TextSpan(
+ text: item.percentText,
+ children: [
+ if (item.recvJobRes)
+ TextSpan(
+ text:
+ ' ${readableFileSize(item.speed)}/s',
+ style: TextStyle(
+ fontSize: 12,
+ fontWeight: FontWeight.w300,
+ color: MyTheme.darkGray,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ),
barRadius: Radius.circular(15),
percent: item.percent,
progressColor: MyTheme.accent,
diff --git a/flutter/lib/mobile/pages/file_manager_page.dart b/flutter/lib/mobile/pages/file_manager_page.dart
index 1e793bca7..982a4c805 100644
--- a/flutter/lib/mobile/pages/file_manager_page.dart
+++ b/flutter/lib/mobile/pages/file_manager_page.dart
@@ -366,8 +366,7 @@ class _FileManagerPageState extends State<FileManagerPage> {
return BottomSheetBody(
leading: CircularProgressIndicator(),
title: translate("Waiting"),
- text:
- "${translate("Speed")}: ${readableFileSize(activeJob.speed)}/s",
+ text: "${readableFileSize(activeJob.speed)}/s",
onCanceled: () {
model.jobController.cancelJob(activeJob.id);
jobTable.clear();