计算两个坐标的斜率值
static double calculateSlope(Offset pre, Offset next) { final diffWidth = next.dx - pre.dx; final diffHeight = next.dy - pre.dy; return diffWidth.abs() / diffHeight.abs(); }