calculateCardPositionSize method

void calculateCardPositionSize({
  1. required int listIndex,
  2. required int itemIndex,
  3. required BuildContext context,
  4. required VoidCallback setsate,
})

Implementation

void calculateCardPositionSize(
    {required int listIndex,
    required int itemIndex,
    required BuildContext context,
    required VoidCallback setsate}) {
  var prov = ref.read(ProviderList.boardProvider);
  if (!context.mounted) return;
  prov.board.lists[listIndex].items[itemIndex].context = context;
  var box = context.findRenderObject() as RenderBox;
  var location = box.localToGlobal(Offset.zero);
  prov.board.lists[listIndex].items[itemIndex].setState = setsate;
  prov.board.lists[listIndex].items[itemIndex].x =
      location.dx - prov.board.displacementX!;
  prov.board.lists[listIndex].items[itemIndex].y =
      location.dy - prov.board.displacementY!;
  prov.board.lists[listIndex].items[itemIndex].actualSize ??= box.size;
  prov.board.lists[listIndex].items[itemIndex].width = box.size.width;
  prov.board.lists[listIndex].items[itemIndex].height = box.size.height;
}