0

I have two widgets that I drag across the screen using gesturedetector. I am aware of the method rect.contains(rect) to tell if widgets overlap, but how can I tell if a rect/widget hit the bottom of another one and if the left or right of both rects are aligned?

 Rect rect1 = Rect.fromLTRB(top,left,right,bottom);
    Rect rect2 =   Rect.fromLTRB(top,left,right,bottom);

     if (rect1.contains(Offset)){
     
    }
//what I want to know is:

 if (rect1.bottom.collidesWith(rect2.bottom)){
     
    }
Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
Nelson
  • 1
  • 2
  • Can you include full widget – Md. Yeasin Sheikh Aug 06 '22 at 13:19
  • this is a good example of what I want to achieve :https://stackoverflow.com/questions/66301849/how-to-check-if-two-widgets-are-overlapping-in-flutter except I want to determine collision inside the rect ( at the bottom instead of at the edges,) meaning if rect1.bottom.collidesWith(rect2.bottom). thanks – Nelson Aug 06 '22 at 16:49

0 Answers0