feat(map in info): make blurred map clickable to enable map

This commit is contained in:
ashilkn 2024-01-31 14:35:52 +05:30
parent 8749f4decb
commit 93f225c7d3

View file

@ -16,6 +16,7 @@ import "package:photos/states/location_screen_state.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/buttons/chip_button_widget.dart";
import "package:photos/ui/components/info_item_widget.dart";
import "package:photos/ui/map/enable_map.dart";
import "package:photos/ui/map/image_marker.dart";
import "package:photos/ui/map/map_screen.dart";
import "package:photos/ui/map/map_view.dart";
@ -82,6 +83,7 @@ class _LocationTagsWidgetState extends State<LocationTagsWidget> {
child: SizedBox(
height: 120,
child: Stack(
key: ValueKey(_hasEnabledMap),
children: [
MapView(
updateVisibleImages: () {},
@ -143,6 +145,7 @@ class _LocationTagsWidgetState extends State<LocationTagsWidget> {
child: SizedBox(
height: 120,
child: Stack(
key: ValueKey(_hasEnabledMap),
children: [
MapView(
updateVisibleImages: () {},
@ -167,7 +170,7 @@ class _LocationTagsWidgetState extends State<LocationTagsWidget> {
filter: ImageFilter.blur(sigmaX: 2.8, sigmaY: 2.8),
child: Container(
color: getEnteColorScheme(context)
.backgroundElevated2
.backgroundElevated
.withOpacity(0.5),
),
),
@ -179,6 +182,26 @@ class _LocationTagsWidgetState extends State<LocationTagsWidget> {
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
unawaited(
requestForMapEnable(context).then((value) {
if (value) {
setState(() {
_hasEnabledMap = true;
});
}
}),
);
},
child: Center(
child: Text(
"Enable Maps",
style: getEnteTextTheme(context).small,
),
),
),
],
),
),