Fix exception on Linux due to unexpected "modify directory". (#2273)

diff --git a/pkgs/watcher/lib/src/event.dart b/pkgs/watcher/lib/src/event.dart
index f2f9ac8..4bdfaf0 100644
--- a/pkgs/watcher/lib/src/event.dart
+++ b/pkgs/watcher/lib/src/event.dart
@@ -32,6 +32,10 @@
       if (result.type.isIgnoredOnWindows) {
         return null;
       }
+    } else if (Platform.isLinux) {
+      if (result.type.isIgnoredOnLinux) {
+        return null;
+      }
     }
     return result;
   }
@@ -119,4 +123,10 @@
     // [createDirectory] or [deleteDirectory].
     return this == modifyDirectory;
   }
+
+  bool get isIgnoredOnLinux {
+    // Ignore [modifyDirectory], it arrives when the directory attributes
+    // changed which is not useful.
+    return this == modifyDirectory;
+  }
 }