Add empty state for images in map

This commit is contained in:
ashilkn 2023-06-12 15:36:39 +05:30
parent fb7dfa2059
commit f59287ceee

View file

@ -140,6 +140,7 @@ class _MapScreenState extends State<MapScreen> {
@override
Widget build(BuildContext context) {
final textTheme = getEnteTextTheme(context);
return Container(
color: getEnteColorScheme(context).backgroundBase,
child: SafeArea(
@ -175,10 +176,16 @@ class _MapScreenState extends State<MapScreen> {
),
child: SizedBox(
height: 116,
child: ListView.builder(
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),
padding:
const EdgeInsets.symmetric(horizontal: 2),
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) {
final image = visibleImages[index];
@ -189,6 +196,21 @@ class _MapScreenState extends State<MapScreen> {
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,
)
],
),
),
),
)