If constructor

If(
  1. dynamic condition, {
  2. required List<Widget> then,
  3. List<Widget>? orElse,
  4. String targetFilePath = 'objd',
  5. String? targetFileName,
  6. bool encapsulate = true,
  7. Entity? assignTag,
  8. String useTag = 'objd_isTrue',
})

The if widget accepts a Condition and runs the children if the condition is true.

If just gives you an execute wrapper with if and else statements. The conditions have their own class. Example:

If(
	Condition(Entity.Player()),
	then: [
		Log('true')
	],
	orElse: [
		Log('false')
	]
)

Implementation

If(
  dynamic condition, {
  required this.then,
  this.orElse,
  this.targetFilePath = 'objd',
  this.targetFileName,
  this.encapsulate = true,
  this.assignTag,
  this.useTag = 'objd_isTrue',
}) {
  getCondition(condition);
}