3 changed files with 26 additions and 3 deletions
@ -0,0 +1,24 @@ |
|||||||
|
import 'package:problem_check_system/app/core/models/sync_status.dart'; |
||||||
|
|
||||||
|
class ProblemEntity implements SyncableEntity { |
||||||
|
// 1. 将 getter 实现替换为 final 字段 |
||||||
|
@override |
||||||
|
final String id; |
||||||
|
|
||||||
|
@override |
||||||
|
final DateTime? lastModifiedTime; |
||||||
|
|
||||||
|
@override |
||||||
|
final String? lastModifierId; |
||||||
|
|
||||||
|
@override |
||||||
|
final SyncStatus syncStatus; |
||||||
|
|
||||||
|
// 2. 在构造函数中初始化这些字段 |
||||||
|
ProblemEntity({ |
||||||
|
required this.id, |
||||||
|
this.lastModifiedTime, |
||||||
|
this.lastModifierId, |
||||||
|
this.syncStatus = SyncStatus.pendingCreate, |
||||||
|
}); |
||||||
|
} |
||||||
Loading…
Reference in new issue