Map UI improvements (#1204)

This commit is contained in:
Ashil 2023-06-13 12:27:00 +05:30 committed by GitHub
commit 39912e81f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 19 deletions

View file

@ -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";
@ -140,8 +141,10 @@ class _MapScreenState extends State<MapScreen> {
@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(
@ -175,30 +178,50 @@ class _MapScreenState extends State<MapScreen> {
),
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,
)
],
),
),
),
)
],
),
isLoading
? const SizedBox.expand(
child: Center(
child: CircularProgressIndicator(color: Colors.green),
),
? EnteLoadingWidget(
size: 28,
color: getEnteColorScheme(context).primary700,
)
: const SizedBox.shrink(),
],

View file

@ -89,6 +89,7 @@ class _MapViewState extends State<MapView> {
const OSMFranceTileLayer(),
MarkerClusterLayerWidget(
options: MarkerClusterLayerOptions(
anchor: AnchorPos.align(AnchorAlign.top),
maxClusterRadius: 100,
showPolygon: true,
size: const Size(75, 75),