From f59287ceee35f785781252f1972cd203541477ba Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 12 Jun 2023 15:36:39 +0530 Subject: [PATCH 1/3] Add empty state for images in map --- lib/ui/map/map_screen.dart | 50 +++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/lib/ui/map/map_screen.dart b/lib/ui/map/map_screen.dart index 47ab985a6..e2eec63cd 100644 --- a/lib/ui/map/map_screen.dart +++ b/lib/ui/map/map_screen.dart @@ -140,6 +140,7 @@ class _MapScreenState extends State { @override Widget build(BuildContext context) { + final textTheme = getEnteTextTheme(context); return Container( color: getEnteColorScheme(context).backgroundBase, child: SafeArea( @@ -175,20 +176,41 @@ class _MapScreenState extends State { ), child: SizedBox( height: 116, - child: ListView.builder( - itemCount: visibleImages.length, - scrollDirection: Axis.horizontal, - padding: const EdgeInsets.symmetric(horizontal: 2), - physics: const BouncingScrollPhysics(), - itemBuilder: (context, index) { - final image = visibleImages[index]; - return ImageTile( - image: image, - allImages: allImages, - visibleImages: visibleImages, - index: index, - ); - }, + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 200), + switchInCurve: Curves.easeInOutExpo, + switchOutCurve: Curves.easeInOutExpo, + child: visibleImages.isNotEmpty + ? ListView.builder( + itemCount: visibleImages.length, + scrollDirection: Axis.horizontal, + padding: + const EdgeInsets.symmetric(horizontal: 2), + physics: const BouncingScrollPhysics(), + itemBuilder: (context, index) { + final image = visibleImages[index]; + return ImageTile( + image: image, + allImages: allImages, + visibleImages: visibleImages, + index: index, + ); + }, + ) + : Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "No photos found here", + style: textTheme.large, + ), + const SizedBox(height: 4), + Text( + "Zoom out to see photos", + style: textTheme.smallFaint, + ) + ], + ), ), ), ) From 0c3fd691d5575950a10543576c5a5cace15da2e6 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 12 Jun 2023 16:49:02 +0530 Subject: [PATCH 2/3] Change loading icon --- lib/ui/map/map_screen.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ui/map/map_screen.dart b/lib/ui/map/map_screen.dart index e2eec63cd..32eda34dc 100644 --- a/lib/ui/map/map_screen.dart +++ b/lib/ui/map/map_screen.dart @@ -8,6 +8,7 @@ import "package:latlong2/latlong.dart"; import "package:logging/logging.dart"; import "package:photos/models/file.dart"; import "package:photos/theme/ente_theme.dart"; +import "package:photos/ui/common/loading_widget.dart"; import "package:photos/ui/map/image_marker.dart"; import 'package:photos/ui/map/image_tile.dart'; import "package:photos/ui/map/map_view.dart"; @@ -141,8 +142,9 @@ class _MapScreenState extends State { @override Widget build(BuildContext context) { final textTheme = getEnteTextTheme(context); + final colorScheme = getEnteColorScheme(context); return Container( - color: getEnteColorScheme(context).backgroundBase, + color: colorScheme.backgroundBase, child: SafeArea( top: false, child: Scaffold( @@ -217,10 +219,9 @@ class _MapScreenState extends State { ], ), isLoading - ? const SizedBox.expand( - child: Center( - child: CircularProgressIndicator(color: Colors.green), - ), + ? EnteLoadingWidget( + size: 28, + color: getEnteColorScheme(context).primary700, ) : const SizedBox.shrink(), ], From 62f4547a1be2f8727c7d7da1e3c2fcaf08b63f24 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Tue, 13 Jun 2023 10:07:17 +0530 Subject: [PATCH 3/3] Anchor the bottom of the markers at it's locations --- lib/ui/map/map_view.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ui/map/map_view.dart b/lib/ui/map/map_view.dart index 46cc600a3..bf3c47566 100644 --- a/lib/ui/map/map_view.dart +++ b/lib/ui/map/map_view.dart @@ -89,6 +89,7 @@ class _MapViewState extends State { const OSMFranceTileLayer(), MarkerClusterLayerWidget( options: MarkerClusterLayerOptions( + anchor: AnchorPos.align(AnchorAlign.top), maxClusterRadius: 100, showPolygon: true, size: const Size(75, 75),