mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: better abstract style
This commit is contained in:
parent
f910b9dc61
commit
ac228a5316
@ -10,17 +10,11 @@ import './attributes.dart';
|
|||||||
const int _maxInt = 9007199254740991;
|
const int _maxInt = 9007199254740991;
|
||||||
|
|
||||||
abstract class TextOperation {
|
abstract class TextOperation {
|
||||||
bool get isEmpty {
|
bool get isEmpty => length == 0;
|
||||||
return length == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int get length {
|
int get length;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Attributes? get attributes {
|
Attributes? get attributes => null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson();
|
Map<String, dynamic> toJson();
|
||||||
}
|
}
|
||||||
@ -130,11 +124,6 @@ class TextDelete extends TextOperation {
|
|||||||
|
|
||||||
TextDelete(int length) : _length = length;
|
TextDelete(int length) : _length = length;
|
||||||
|
|
||||||
@override
|
|
||||||
bool get isEmpty {
|
|
||||||
return length == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get length {
|
int get length {
|
||||||
return _length;
|
return _length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user