Block constructor

Block({
  1. String id = '',
  2. bool hasChildren = false,
  3. Map<String, dynamic> jsonContent = const {},
  4. BlockTypes type = BlockTypes.None,
  5. String createdTime = '',
  6. String lastEditedTime = '',
})

Main block constructor.

Can receive the id, if this hasChildren, the jsonContent and the type of block. Possible types are defined by BlockTypes enum.

Also can receive the createdTime and the lastEditedTime of the block in case that the information is filled from response.

Implementation

Block({
  this.id: '',
  this.hasChildren: false,
  this.jsonContent: const {},
  this.type: BlockTypes.None,
  String createdTime: '',
  String lastEditedTime: '',
}) {
  this.setBaseProperties(
    createdTime: createdTime,
    lastEditedTime: lastEditedTime,
  );
}