浏览代码

小的交互优化

gavin.chen 2 年之前
父节点
当前提交
37fb1ca03d
共有 1 个文件被更改,包括 18 次插入2 次删除
  1. 18 2
      lib/calendar_view/month_calendar/schedule_list.dart

+ 18 - 2
lib/calendar_view/month_calendar/schedule_list.dart

@@ -79,7 +79,15 @@ class ScheduleListState extends State<ScheduleList> {
         customBorder: RoundedRectangleBorder(
           borderRadius: BorderRadius.circular(5),
         ),
-        onTap: () => print('点击了${scheduleType.typeName}'),
+        onTap: () {
+          ScaffoldMessenger.of(context).showSnackBar(
+            SnackBar(
+              backgroundColor: scheduleType.color,
+              duration: const Duration(milliseconds: 500),
+              content: Text('点击了${scheduleType.typeName}'),
+            ),
+          );
+        },
         hoverColor: const Color.fromARGB(255, 227, 228, 228),
         child: Container(
           height: widget.itemHeight,
@@ -122,7 +130,15 @@ class ScheduleListState extends State<ScheduleList> {
         customBorder: RoundedRectangleBorder(
           borderRadius: BorderRadius.circular(5),
         ),
-        onTap: () => print('点击了更多'),
+        onTap: () {
+          /// 弹出提示
+          ScaffoldMessenger.of(context).showSnackBar(
+            const SnackBar(
+              duration: Duration(milliseconds: 500),
+              content: Text('前方正在施工'),
+            ),
+          );
+        },
         hoverColor: const Color.fromARGB(255, 227, 228, 228),
         child: Container(
           height: widget.itemHeight,