0

如果Strig? idnull,我想为它分配一个uuid或随机int(作为字符串)。

@freezed
 class Todo with _$Todo {
 const factory Todo({
    @Default(false) bool isComplete,
    String? id,
    required String title,
    required String todo,
  }) = _Todo; ```


In vanila Constructor, I could to it in Initializer list.
4

0 回答 0