init method

void init({
  1. required double currentParentWidth,
  2. required double currentParentHeight,
  3. double targetParentWidth = 300,
  4. double targetParentHeight = 400,
})

Initializes the configuration for a responsive card.

This method sets the dimensions of the parent container and the target dimensions for the card.

currentParentWidth is the width of the parent container. currentParentHeight is the height of the parent container. targetParentWidth is the width that the card should adapt to. Defaults to 300. targetParentHeight is the height that the card should adapt to. Defaults to 400.

Implementation

void init({
  required double currentParentWidth,
  required double currentParentHeight,
  double targetParentWidth = 300,
  double targetParentHeight = 400,
}) {
  currentParentHeightValue = currentParentHeight;
  currentParentWidthValue = currentParentWidth;
  targetParentHeightValue = targetParentHeight;
  targetParentWidthValue = targetParentWidth;
}