Browse Source

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

ashilkn 1 year ago
parent
commit
93f225c7d3
1 changed files with 24 additions and 1 deletions
  1. 24 1
      lib/ui/viewer/file_details/location_tags_widget.dart

+ 24 - 1
lib/ui/viewer/file_details/location_tags_widget.dart

@@ -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,
+                            ),
+                          ),
+                        ),
                       ],
                     ),
                   ),