浏览代码

refactor: better abstract style

Vincent Chan 2 年之前
父节点
当前提交
ac228a5316
共有 1 个文件被更改,包括 3 次插入14 次删除
  1. 3 14
      frontend/app_flowy/packages/flowy_editor/lib/document/text_delta.dart

+ 3 - 14
frontend/app_flowy/packages/flowy_editor/lib/document/text_delta.dart

@@ -10,17 +10,11 @@ import './attributes.dart';
 const int _maxInt = 9007199254740991;
 
 abstract class TextOperation {
-  bool get isEmpty {
-    return length == 0;
-  }
+  bool get isEmpty => length == 0;
 
-  int get length {
-    return 0;
-  }
+  int get length;
 
-  Attributes? get attributes {
-    return null;
-  }
+  Attributes? get attributes => null;
 
   Map<String, dynamic> toJson();
 }
@@ -130,11 +124,6 @@ class TextDelete extends TextOperation {
 
   TextDelete(int length) : _length = length;
 
-  @override
-  bool get isEmpty {
-    return length == 0;
-  }
-
   @override
   int get length {
     return _length;