LevelPathMap constructor

LevelPathMap({
  1. Key? key,
  2. required List<LevelPathNode> nodes,
  3. void onLevelTap(
    1. int level
    )?,
  4. bool bottomUp = true,
  5. double rowHeight = 96,
  6. double width = 320,
})

Implementation

LevelPathMap({
  super.key,
  required this.nodes,
  this.onLevelTap,
  this.bottomUp = true,
  this.rowHeight = 96,
  this.width = 320,
}) {
  if (nodes.isEmpty) {
    throw ArgumentError.value(nodes, 'nodes', 'must not be empty');
  }
  if (!width.isFinite || width <= 0) {
    throw ArgumentError.value(width, 'width', 'must be positive and finite');
  }
  if (!rowHeight.isFinite || rowHeight <= 0) {
    throw ArgumentError.value(
      rowHeight,
      'rowHeight',
      'must be positive and finite',
    );
  }
}