From ac228a5316ca9ef3e6dc8935acad5f6442952c3c Mon Sep 17 00:00:00 2001 From: Vincent Chan Date: Mon, 18 Jul 2022 20:13:33 +0800 Subject: [PATCH] refactor: better abstract style --- .../flowy_editor/lib/document/text_delta.dart | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/frontend/app_flowy/packages/flowy_editor/lib/document/text_delta.dart b/frontend/app_flowy/packages/flowy_editor/lib/document/text_delta.dart index ede7d65882..2f3d194255 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/document/text_delta.dart +++ b/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 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;