Newer
Older
flutterBaseApp / lib / ui / widgets / common / button / likebtn / like_button_util.dart
StephanieGitHub on 9 Feb 2021 426 bytes first commit
import 'dart:math' as math;

num degToRad(num deg) => deg * (math.pi / 180.0);

num radToDeg(num rad) => rad * (180.0 / math.pi);

double mapValueFromRangeToRange(double value, double fromLow, double fromHigh, double toLow, double toHigh) {
  return toLow + ((value - fromLow) / (fromHigh - fromLow) * (toHigh - toLow));
}

double clamp(double value, double low, double high) {
  return math.min(math.max(value, low), high);
}