Browse Source

feat: double click day cell to create event (#2424)

Richard Shiue 2 years ago
parent
commit
c4ff1a6290

+ 10 - 7
frontend/appflowy_flutter/lib/plugins/database_view/calendar/presentation/calendar_day.dart

@@ -82,13 +82,16 @@ class CalendarDayCard extends StatelessWidget {
 
         return Container(
           color: backgroundColor,
-          child: MouseRegion(
-            cursor: SystemMouseCursors.basic,
-            onEnter: (p) => notifyEnter(context, true),
-            onExit: (p) => notifyEnter(context, false),
-            child: Padding(
-              padding: const EdgeInsets.only(top: 8.0),
-              child: child,
+          child: GestureDetector(
+            onDoubleTap: () => onCreateEvent(date),
+            child: MouseRegion(
+              cursor: SystemMouseCursors.basic,
+              onEnter: (p) => notifyEnter(context, true),
+              onExit: (p) => notifyEnter(context, false),
+              child: Padding(
+                padding: const EdgeInsets.only(top: 8.0),
+                child: child,
+              ),
             ),
           ),
         );