getNearbyPoint method
Implementation
DimensionabilityTouchBackModel? getNearbyPoint(
Offset localPosition,
) {
if (_cellModel == null || _cellModel!.isEmpty) {
return null;
}
DimensionabilityTouchBackModel? touchModel;
for (var i = 0; i < _cellModel!.length; i++) {
var tempModel = _cellModel![i];
if (localPosition.dx >= tempModel.point.dx &&
localPosition.dx <= (tempModel.point.dx + tempModel.size.width) &&
localPosition.dy >= tempModel.point.dy &&
localPosition.dy <= (tempModel.point.dy + tempModel.size.height)) {
touchModel = tempModel;
break;
}
}
return touchModel;
}