BlockModel constructor Null safety
- {Uint8List? id,
- int version = 1,
- required Uint8List previousHash,
- required Uint8List transactionRoot,
- DateTime? timestamp}
Buils a new BlockModel.
If no timestamp
is provided, it is considered a new BlockModel and
the object creation time becomes the timestamp
.
Implementation
BlockModel({
this.id,
this.version = 1,
required this.previousHash,
required this.transactionRoot,
DateTime? timestamp,
}) : timestamp = timestamp ?? DateTime.now();