summaryrefslogtreecommitdiff
path: root/lib/widgets/collection/loading.dart
diff options
context:
space:
mode:
authormirror <mirror@localhost>2026-11-22 08:41:00 +0900
committermirror <mirror@localhost>2026-11-22 08:41:00 +0900
commit449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch)
treec131c3528c4d517f56e19b854a7453fedb097d40 /lib/widgets/collection/loading.dart
downloadaves-src-master.tar.gz
aves-src-master.zip
snapshot of aves v1.13.12 (secrets removed: android/app/google-services.json)HEADv1.13.12master
Diffstat (limited to 'lib/widgets/collection/loading.dart')
-rw-r--r--lib/widgets/collection/loading.dart50
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/widgets/collection/loading.dart b/lib/widgets/collection/loading.dart
new file mode 100644
index 0000000..390752e
--- /dev/null
+++ b/lib/widgets/collection/loading.dart
@@ -0,0 +1,50 @@
+import 'package:aves/model/source/collection_source.dart';
+import 'package:aves/model/source/events.dart';
+import 'package:aves/widgets/common/action_mixins/feedback.dart';
+import 'package:aves/widgets/common/extensions/build_context.dart';
+import 'package:aves/widgets/common/identity/empty.dart';
+import 'package:flutter/material.dart';
+import 'package:intl/intl.dart';
+
+class LoadingEmptyContent extends StatelessWidget {
+ final CollectionSource source;
+
+ const LoadingEmptyContent({
+ super.key,
+ required this.source,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final countFormatter = NumberFormat.decimalPattern(context.locale);
+ final progressTextStyle = TextStyle(
+ color: Theme.of(context).colorScheme.primary.withValues(alpha: .5),
+ fontSize: 18,
+ );
+
+ return EmptyContent(
+ text: context.l10n.sourceStateLoading,
+ bottom: Padding(
+ padding: const EdgeInsets.only(top: 16),
+ child: Stack(
+ alignment: Alignment.center,
+ children: [
+ const ReportProgressIndicator(),
+ ValueListenableBuilder<ProgressEvent>(
+ valueListenable: source.progressNotifier,
+ builder: (context, progress, snapshot) {
+ final done = progress.done;
+ return done > 0
+ ? Text(
+ countFormatter.format(done),
+ style: progressTextStyle,
+ )
+ : const SizedBox();
+ },
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}