TransactionModel constructor Null safety

TransactionModel(
  1. {Uint8List? id,
  2. int version = 1,
  3. required Uint8List address,
  4. required Uint8List contents,
  5. String assetRef = "AA==",
  6. DateTime? timestamp,
  7. Uint8List? merkelProof,
  8. BlockModel? block,
  9. Uint8List? signature}
)

Builds a new TransactionModel

If no timestamp is provided, the object creation time is used. If no assetRef is provided, it uses AA== as assetRef value.

Implementation

TransactionModel(
    {this.id,
    this.version = 1,
    required this.address,
    required this.contents,
    this.assetRef = "AA==",
    DateTime? timestamp,
    this.merkelProof,
    this.block,
    this.signature})
    : timestamp = timestamp ?? DateTime.now();