superscriptShiftUp method

  1. @override
double superscriptShiftUp(
  1. double fontSizePx, {
  2. bool? displayStyle,
  3. bool? crampedStyle,
})
override

In Dart, method overloading is not permitted. Named optional parameters successfully emulate the separate signatures for superscriptShiftUp found in the Kotlin source.

Implementation

@override
double superscriptShiftUp(
  double fontSizePx, {
  bool? displayStyle,
  bool? crampedStyle,
}) {
  if (displayStyle == null && crampedStyle == null) {
    return fontSizePx * 0.363;
  }
  if (displayStyle == true) return fontSizePx * 0.413;
  if (crampedStyle == true) return fontSizePx * 0.289;
  return fontSizePx * 0.363;
}