|
@@ -66,6 +66,12 @@ class _LocationGalleryWidgetState extends State<LocationGalleryWidget> {
|
|
super.initState();
|
|
super.initState();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @override
|
|
|
|
+ void dispose() {
|
|
|
|
+ InheritedLocationScreenState.memoryCountNotifier.value = null;
|
|
|
|
+ super.dispose();
|
|
|
|
+ }
|
|
|
|
+
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
//Todo: get radius of location tag here.
|
|
//Todo: get radius of location tag here.
|
|
@@ -93,7 +99,8 @@ class _LocationGalleryWidgetState extends State<LocationGalleryWidget> {
|
|
"Time taken to get all files in a location tag: ${stopWatch.elapsedMilliseconds} ms",
|
|
"Time taken to get all files in a location tag: ${stopWatch.elapsedMilliseconds} ms",
|
|
);
|
|
);
|
|
stopWatch.stop();
|
|
stopWatch.stop();
|
|
- // widget.memoriesCountNotifier.value = copyOfFiles.length;
|
|
|
|
|
|
+ InheritedLocationScreenState.memoryCountNotifier.value =
|
|
|
|
+ copyOfFiles.length;
|
|
|
|
|
|
return Future.value(
|
|
return Future.value(
|
|
FileLoadResult(
|
|
FileLoadResult(
|
|
@@ -126,12 +133,7 @@ class _LocationGalleryWidgetState extends State<LocationGalleryWidget> {
|
|
tagPrefix: "location_gallery",
|
|
tagPrefix: "location_gallery",
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
- return Column(
|
|
|
|
- children: [
|
|
|
|
- galleryHeaderWidget,
|
|
|
|
- const EnteLoadingWidget(),
|
|
|
|
- ],
|
|
|
|
- );
|
|
|
|
|
|
+ return galleryHeaderWidget;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
future: filterFiles(),
|
|
future: filterFiles(),
|
|
@@ -171,10 +173,27 @@ class _GalleryHeaderWidgetState extends State<GalleryHeaderWidget> {
|
|
title: locationName,
|
|
title: locationName,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- Text(
|
|
|
|
- "51 memories",
|
|
|
|
- style: getEnteTextTheme(context).smallMuted,
|
|
|
|
- ),
|
|
|
|
|
|
+ ValueListenableBuilder(
|
|
|
|
+ valueListenable:
|
|
|
|
+ InheritedLocationScreenState.memoryCountNotifier,
|
|
|
|
+ builder: (context, value, _) {
|
|
|
|
+ if (value == null) {
|
|
|
|
+ return RepaintBoundary(
|
|
|
|
+ child: EnteLoadingWidget(
|
|
|
|
+ size: 10,
|
|
|
|
+ color: getEnteColorScheme(context).strokeMuted,
|
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
|
+ padding: 5,
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ return Text(
|
|
|
|
+ value == 1 ? "1 memory" : "$value memories",
|
|
|
|
+ style: getEnteTextTheme(context).smallMuted,
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ )
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|