mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 01:11:07 +03:00
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
@@ -16,10 +16,7 @@ import 'package:immich_mobile/widgets/common/immich_toast.dart';
|
||||
class AlbumInfoCard extends HookConsumerWidget {
|
||||
final AvailableAlbum album;
|
||||
|
||||
const AlbumInfoCard({
|
||||
super.key,
|
||||
required this.album,
|
||||
});
|
||||
const AlbumInfoCard({super.key, required this.album});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -29,10 +26,7 @@ class AlbumInfoCard extends HookConsumerWidget {
|
||||
|
||||
final isDarkTheme = context.isDarkTheme;
|
||||
|
||||
ColorFilter selectedFilter = ColorFilter.mode(
|
||||
context.primaryColor.withAlpha(100),
|
||||
BlendMode.darken,
|
||||
);
|
||||
ColorFilter selectedFilter = ColorFilter.mode(context.primaryColor.withAlpha(100), BlendMode.darken);
|
||||
ColorFilter excludedFilter = ColorFilter.mode(Colors.red.withAlpha(75), BlendMode.darken);
|
||||
ColorFilter unselectedFilter = const ColorFilter.mode(Colors.black, BlendMode.color);
|
||||
|
||||
@@ -40,9 +34,7 @@ class AlbumInfoCard extends HookConsumerWidget {
|
||||
if (isSelected) {
|
||||
return Chip(
|
||||
visualDensity: VisualDensity.compact,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||
),
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||
label: Text(
|
||||
"album_info_card_backup_album_included",
|
||||
style: TextStyle(
|
||||
@@ -56,9 +48,7 @@ class AlbumInfoCard extends HookConsumerWidget {
|
||||
} else if (isExcluded) {
|
||||
return Chip(
|
||||
visualDensity: VisualDensity.compact,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||
),
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))),
|
||||
label: Text(
|
||||
"album_info_card_backup_album_excluded",
|
||||
style: TextStyle(
|
||||
@@ -145,24 +135,16 @@ class AlbumInfoCard extends HookConsumerWidget {
|
||||
child: const Image(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
image: AssetImage(
|
||||
'assets/immich-logo.png',
|
||||
),
|
||||
image: AssetImage('assets/immich-logo.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 25,
|
||||
child: buildSelectedTextBox(),
|
||||
),
|
||||
Positioned(bottom: 10, right: 25, child: buildSelectedTextBox()),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 25,
|
||||
),
|
||||
padding: const EdgeInsets.only(left: 25),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
@@ -173,20 +155,13 @@ class AlbumInfoCard extends HookConsumerWidget {
|
||||
children: [
|
||||
Text(
|
||||
album.name,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: context.primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
style: TextStyle(fontSize: 14, color: context.primaryColor, fontWeight: FontWeight.bold),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 2.0),
|
||||
child: Text(
|
||||
album.assetCount.toString() + (album.isAll ? " (${'all'.tr()})" : ""),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -194,15 +169,9 @@ class AlbumInfoCard extends HookConsumerWidget {
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
context.pushRoute(
|
||||
AlbumPreviewRoute(album: album.album),
|
||||
);
|
||||
context.pushRoute(AlbumPreviewRoute(album: album.album));
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.image_outlined,
|
||||
color: context.primaryColor,
|
||||
size: 24,
|
||||
),
|
||||
icon: Icon(Icons.image_outlined, color: context.primaryColor, size: 24),
|
||||
splashRadius: 25,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -35,23 +35,14 @@ class AlbumInfoListTile extends HookConsumerWidget {
|
||||
|
||||
buildIcon() {
|
||||
if (isSelected) {
|
||||
return Icon(
|
||||
Icons.check_circle_rounded,
|
||||
color: context.colorScheme.primary,
|
||||
);
|
||||
return Icon(Icons.check_circle_rounded, color: context.colorScheme.primary);
|
||||
}
|
||||
|
||||
if (isExcluded) {
|
||||
return Icon(
|
||||
Icons.remove_circle_rounded,
|
||||
color: context.colorScheme.error,
|
||||
);
|
||||
return Icon(Icons.remove_circle_rounded, color: context.colorScheme.error);
|
||||
}
|
||||
|
||||
return Icon(
|
||||
Icons.circle,
|
||||
color: context.colorScheme.surfaceContainerHighest,
|
||||
);
|
||||
return Icon(Icons.circle, color: context.colorScheme.surfaceContainerHighest);
|
||||
}
|
||||
|
||||
return GestureDetector(
|
||||
@@ -92,25 +83,13 @@ class AlbumInfoListTile extends HookConsumerWidget {
|
||||
}
|
||||
},
|
||||
leading: buildIcon(),
|
||||
title: Text(
|
||||
album.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
title: Text(album.name, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
subtitle: Text(album.assetCount.toString()),
|
||||
trailing: IconButton(
|
||||
onPressed: () {
|
||||
context.pushRoute(
|
||||
AlbumPreviewRoute(album: album.album),
|
||||
);
|
||||
context.pushRoute(AlbumPreviewRoute(album: album.album));
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.image_outlined,
|
||||
color: context.primaryColor,
|
||||
size: 24,
|
||||
),
|
||||
icon: Icon(Icons.image_outlined, color: context.primaryColor, size: 24),
|
||||
splashRadius: 25,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -14,9 +14,7 @@ class BackupAssetInfoTable extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isManualUpload = ref.watch(
|
||||
backupProvider.select(
|
||||
(value) => value.backupProgress == BackUpProgressEnum.manualInProgress,
|
||||
),
|
||||
backupProvider.select((value) => value.backupProgress == BackUpProgressEnum.manualInProgress),
|
||||
);
|
||||
|
||||
final isUploadInProgress = ref.watch(
|
||||
@@ -29,18 +27,13 @@ class BackupAssetInfoTable extends ConsumerWidget {
|
||||
);
|
||||
|
||||
final asset = isManualUpload
|
||||
? ref.watch(
|
||||
manualUploadProvider.select((value) => value.currentUploadAsset),
|
||||
)
|
||||
? ref.watch(manualUploadProvider.select((value) => value.currentUploadAsset))
|
||||
: ref.watch(backupProvider.select((value) => value.currentUploadAsset));
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Table(
|
||||
border: TableBorder.all(
|
||||
color: context.colorScheme.outlineVariant,
|
||||
width: 1,
|
||||
),
|
||||
border: TableBorder.all(color: context.colorScheme.outlineVariant, width: 1),
|
||||
children: [
|
||||
TableRow(
|
||||
children: [
|
||||
@@ -48,21 +41,19 @@ class BackupAssetInfoTable extends ConsumerWidget {
|
||||
verticalAlignment: TableCellVerticalAlignment.middle,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6.0),
|
||||
child: Text(
|
||||
'backup_controller_page_filename',
|
||||
style: TextStyle(
|
||||
color: context.colorScheme.onSurfaceSecondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10.0,
|
||||
),
|
||||
).tr(
|
||||
namedArgs: isUploadInProgress
|
||||
? {
|
||||
'filename': asset.fileName,
|
||||
'size': asset.fileType.toLowerCase(),
|
||||
}
|
||||
: {'filename': "-", 'size': "-"},
|
||||
),
|
||||
child:
|
||||
Text(
|
||||
'backup_controller_page_filename',
|
||||
style: TextStyle(
|
||||
color: context.colorScheme.onSurfaceSecondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10.0,
|
||||
),
|
||||
).tr(
|
||||
namedArgs: isUploadInProgress
|
||||
? {'filename': asset.fileName, 'size': asset.fileType.toLowerCase()}
|
||||
: {'filename': "-", 'size': "-"},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -80,11 +71,7 @@ class BackupAssetInfoTable extends ConsumerWidget {
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10.0,
|
||||
),
|
||||
).tr(
|
||||
namedArgs: {
|
||||
'date': isUploadInProgress ? _getAssetCreationDate(asset) : "-",
|
||||
},
|
||||
),
|
||||
).tr(namedArgs: {'date': isUploadInProgress ? _getAssetCreationDate(asset) : "-"}),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -101,9 +88,7 @@ class BackupAssetInfoTable extends ConsumerWidget {
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10.0,
|
||||
),
|
||||
).tr(
|
||||
namedArgs: {'id': isUploadInProgress ? asset.id : "-"},
|
||||
),
|
||||
).tr(namedArgs: {'id': isUploadInProgress ? asset.id : "-"}),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -7,12 +7,7 @@ class BackupInfoCard extends StatelessWidget {
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final String info;
|
||||
const BackupInfoCard({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.info,
|
||||
});
|
||||
const BackupInfoCard({super.key, required this.title, required this.subtitle, required this.info});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -21,40 +16,26 @@ class BackupInfoCard extends StatelessWidget {
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(20), // if you need this
|
||||
),
|
||||
side: BorderSide(
|
||||
color: context.colorScheme.outlineVariant,
|
||||
width: 1,
|
||||
),
|
||||
side: BorderSide(color: context.colorScheme.outlineVariant, width: 1),
|
||||
),
|
||||
elevation: 0,
|
||||
borderOnForeground: false,
|
||||
child: ListTile(
|
||||
minVerticalPadding: 18,
|
||||
isThreeLine: true,
|
||||
title: Text(
|
||||
title,
|
||||
style: context.textTheme.titleMedium,
|
||||
),
|
||||
title: Text(title, style: context.textTheme.titleMedium),
|
||||
subtitle: Padding(
|
||||
padding: const EdgeInsets.only(top: 4.0, right: 18.0),
|
||||
child: Text(
|
||||
subtitle,
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: context.colorScheme.onSurfaceSecondary,
|
||||
),
|
||||
style: context.textTheme.bodyMedium?.copyWith(color: context.colorScheme.onSurfaceSecondary),
|
||||
),
|
||||
),
|
||||
trailing: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
info,
|
||||
style: context.textTheme.titleLarge,
|
||||
),
|
||||
Text(
|
||||
"backup_info_card_assets",
|
||||
style: context.textTheme.labelLarge,
|
||||
).tr(),
|
||||
Text(info, style: context.textTheme.titleLarge),
|
||||
Text("backup_info_card_assets", style: context.textTheme.labelLarge).tr(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -16,18 +16,11 @@ class CurrentUploadingAssetInfoBox extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
isThreeLine: true,
|
||||
leading: Icon(
|
||||
Icons.image_outlined,
|
||||
color: context.primaryColor,
|
||||
size: 30,
|
||||
),
|
||||
leading: Icon(Icons.image_outlined, color: context.primaryColor, size: 30),
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"backup_controller_page_uploading_file_info",
|
||||
style: context.textTheme.titleSmall,
|
||||
).tr(),
|
||||
Text("backup_controller_page_uploading_file_info", style: context.textTheme.titleSmall).tr(),
|
||||
const BackupErrorChip(),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -36,23 +36,14 @@ class DriftAlbumInfoListTile extends HookConsumerWidget {
|
||||
|
||||
buildIcon() {
|
||||
if (isSelected) {
|
||||
return Icon(
|
||||
Icons.check_circle_rounded,
|
||||
color: context.colorScheme.primary,
|
||||
);
|
||||
return Icon(Icons.check_circle_rounded, color: context.colorScheme.primary);
|
||||
}
|
||||
|
||||
if (isExcluded) {
|
||||
return Icon(
|
||||
Icons.remove_circle_rounded,
|
||||
color: context.colorScheme.error,
|
||||
);
|
||||
return Icon(Icons.remove_circle_rounded, color: context.colorScheme.error);
|
||||
}
|
||||
|
||||
return Icon(
|
||||
Icons.circle,
|
||||
color: context.colorScheme.surfaceContainerHighest,
|
||||
);
|
||||
return Icon(Icons.circle, color: context.colorScheme.surfaceContainerHighest);
|
||||
}
|
||||
|
||||
return GestureDetector(
|
||||
@@ -90,23 +81,13 @@ class DriftAlbumInfoListTile extends HookConsumerWidget {
|
||||
}
|
||||
},
|
||||
leading: buildIcon(),
|
||||
title: Text(
|
||||
album.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
title: Text(album.name, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
|
||||
subtitle: Text(album.assetCount.toString()),
|
||||
trailing: IconButton(
|
||||
onPressed: () {
|
||||
context.pushRoute(LocalTimelineRoute(album: album));
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.image_outlined,
|
||||
color: context.primaryColor,
|
||||
size: 24,
|
||||
),
|
||||
icon: Icon(Icons.image_outlined, color: context.primaryColor, size: 24),
|
||||
splashRadius: 25,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -17,10 +17,7 @@ class BackupErrorChip extends ConsumerWidget {
|
||||
}
|
||||
|
||||
return ActionChip(
|
||||
avatar: const Icon(
|
||||
Icons.info,
|
||||
color: red400,
|
||||
),
|
||||
avatar: const Icon(Icons.info, color: red400),
|
||||
elevation: 1,
|
||||
visualDensity: VisualDensity.compact,
|
||||
label: const BackupErrorChipText(),
|
||||
|
||||
@@ -16,11 +16,7 @@ class BackupErrorChipText extends ConsumerWidget {
|
||||
|
||||
return const Text(
|
||||
"backup_controller_page_failed",
|
||||
style: TextStyle(
|
||||
color: red400,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 11,
|
||||
),
|
||||
style: TextStyle(color: red400, fontWeight: FontWeight.bold, fontSize: 11),
|
||||
).tr(namedArgs: {'count': count.toString()});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,18 +10,12 @@ class IcloudDownloadProgressBar extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isManualUpload = ref.watch(
|
||||
backupProvider.select(
|
||||
(value) => value.backupProgress == BackUpProgressEnum.manualInProgress,
|
||||
),
|
||||
backupProvider.select((value) => value.backupProgress == BackUpProgressEnum.manualInProgress),
|
||||
);
|
||||
|
||||
final isIcloudAsset = isManualUpload
|
||||
? ref.watch(
|
||||
manualUploadProvider.select((value) => value.currentUploadAsset.isIcloudAsset),
|
||||
)
|
||||
: ref.watch(
|
||||
backupProvider.select((value) => value.currentUploadAsset.isIcloudAsset),
|
||||
);
|
||||
? ref.watch(manualUploadProvider.select((value) => value.currentUploadAsset.isIcloudAsset))
|
||||
: ref.watch(backupProvider.select((value) => value.currentUploadAsset.isIcloudAsset));
|
||||
|
||||
if (!isIcloudAsset) {
|
||||
return const SizedBox();
|
||||
@@ -33,13 +27,7 @@ class IcloudDownloadProgressBar extends ConsumerWidget {
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 110,
|
||||
child: Text(
|
||||
"iCloud Download",
|
||||
style: context.textTheme.labelSmall,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 110, child: Text("iCloud Download", style: context.textTheme.labelSmall)),
|
||||
Expanded(
|
||||
child: LinearProgressIndicator(
|
||||
minHeight: 10.0,
|
||||
@@ -47,10 +35,7 @@ class IcloudDownloadProgressBar extends ConsumerWidget {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
" ${iCloudDownloadProgress ~/ 1}%",
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
Text(" ${iCloudDownloadProgress ~/ 1}%", style: const TextStyle(fontSize: 12)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -9,10 +9,7 @@ import 'package:immich_mobile/providers/backup/ios_background_settings.provider.
|
||||
/// more confident about background sync
|
||||
class IosDebugInfoTile extends HookConsumerWidget {
|
||||
final IOSBackgroundSettings settings;
|
||||
const IosDebugInfoTile({
|
||||
super.key,
|
||||
required this.settings,
|
||||
});
|
||||
const IosDebugInfoTile({super.key, required this.settings});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -37,31 +34,16 @@ class IosDebugInfoTile extends HookConsumerWidget {
|
||||
subtitle = 'ios_debug_info_processing_ran_at'.t(context: context, args: {'dateTime': df.format(processing)});
|
||||
} else {
|
||||
final fetchOrProcessing = fetch!.isAfter(processing!) ? fetch : processing;
|
||||
subtitle = 'ios_debug_info_last_sync_at'.t(
|
||||
context: context,
|
||||
args: {'dateTime': df.format(fetchOrProcessing)},
|
||||
);
|
||||
subtitle = 'ios_debug_info_last_sync_at'.t(context: context, args: {'dateTime': df.format(fetchOrProcessing)});
|
||||
}
|
||||
|
||||
return ListTile(
|
||||
title: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
color: context.primaryColor,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
subtitle,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
leading: Icon(
|
||||
Icons.bug_report,
|
||||
color: context.primaryColor,
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: context.primaryColor),
|
||||
),
|
||||
subtitle: Text(subtitle, style: const TextStyle(fontSize: 14)),
|
||||
leading: Icon(Icons.bug_report, color: context.primaryColor),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,39 +11,22 @@ class BackupUploadProgressBar extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isManualUpload = ref.watch(
|
||||
backupProvider.select(
|
||||
(value) => value.backupProgress == BackUpProgressEnum.manualInProgress,
|
||||
),
|
||||
backupProvider.select((value) => value.backupProgress == BackUpProgressEnum.manualInProgress),
|
||||
);
|
||||
|
||||
final isIcloudAsset = isManualUpload
|
||||
? ref.watch(
|
||||
manualUploadProvider.select((value) => value.currentUploadAsset.isIcloudAsset),
|
||||
)
|
||||
: ref.watch(
|
||||
backupProvider.select((value) => value.currentUploadAsset.isIcloudAsset),
|
||||
);
|
||||
? ref.watch(manualUploadProvider.select((value) => value.currentUploadAsset.isIcloudAsset))
|
||||
: ref.watch(backupProvider.select((value) => value.currentUploadAsset.isIcloudAsset));
|
||||
|
||||
final uploadProgress = isManualUpload
|
||||
? ref.watch(
|
||||
manualUploadProvider.select((value) => value.progressInPercentage),
|
||||
)
|
||||
: ref.watch(
|
||||
backupProvider.select((value) => value.progressInPercentage),
|
||||
);
|
||||
? ref.watch(manualUploadProvider.select((value) => value.progressInPercentage))
|
||||
: ref.watch(backupProvider.select((value) => value.progressInPercentage));
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
if (isIcloudAsset)
|
||||
SizedBox(
|
||||
width: 110,
|
||||
child: Text(
|
||||
"Immich Upload",
|
||||
style: context.textTheme.labelSmall,
|
||||
),
|
||||
),
|
||||
if (isIcloudAsset) SizedBox(width: 110, child: Text("Immich Upload", style: context.textTheme.labelSmall)),
|
||||
Expanded(
|
||||
child: LinearProgressIndicator(
|
||||
minHeight: 10.0,
|
||||
|
||||
@@ -10,34 +10,23 @@ class BackupUploadStats extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isManualUpload = ref.watch(
|
||||
backupProvider.select(
|
||||
(value) => value.backupProgress == BackUpProgressEnum.manualInProgress,
|
||||
),
|
||||
backupProvider.select((value) => value.backupProgress == BackUpProgressEnum.manualInProgress),
|
||||
);
|
||||
|
||||
final uploadFileProgress = isManualUpload
|
||||
? ref.watch(
|
||||
manualUploadProvider.select((value) => value.progressInFileSize),
|
||||
)
|
||||
? ref.watch(manualUploadProvider.select((value) => value.progressInFileSize))
|
||||
: ref.watch(backupProvider.select((value) => value.progressInFileSize));
|
||||
|
||||
final uploadFileSpeed = isManualUpload
|
||||
? ref.watch(
|
||||
manualUploadProvider.select((value) => value.progressInFileSpeed),
|
||||
)
|
||||
: ref.watch(
|
||||
backupProvider.select((value) => value.progressInFileSpeed),
|
||||
);
|
||||
? ref.watch(manualUploadProvider.select((value) => value.progressInFileSpeed))
|
||||
: ref.watch(backupProvider.select((value) => value.progressInFileSpeed));
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 2.0, bottom: 2.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
uploadFileProgress,
|
||||
style: const TextStyle(fontSize: 10, fontFamily: "OverpassMono"),
|
||||
),
|
||||
Text(uploadFileProgress, style: const TextStyle(fontSize: 10, fontFamily: "OverpassMono")),
|
||||
Text(
|
||||
_formatUploadFileSpeed(uploadFileSpeed),
|
||||
style: const TextStyle(fontSize: 10, fontFamily: "OverpassMono"),
|
||||
|
||||
Reference in New Issue
Block a user