calculateSizePosition method

void calculateSizePosition({
  1. required int listIndex,
  2. required BuildContext context,
  3. required VoidCallback setstate,
})

Implementation

void calculateSizePosition(
    {required int listIndex,
    required BuildContext context,
    required VoidCallback setstate}) {
  var prov = ref.read(ProviderList.boardProvider);
  prov.board.lists[listIndex].context = context;
  var box = context.findRenderObject() as RenderBox;
  var location = box.localToGlobal(Offset.zero);
  prov.board.lists[listIndex].x =
      location.dx - prov.board.displacementX! - 10;
  prov.board.lists[listIndex].setState = setstate;
  prov.board.lists[listIndex].y =
      location.dy - prov.board.displacementY! + 24;
  prov.board.lists[listIndex].width ??= box.size.width;
  prov.board.lists[listIndex].height ??= box.size.height;
}