fluent2OnFirstLine function

Widget fluent2OnFirstLine(
  1. BuildContext context,
  2. TextStyle style,
  3. Widget control
)

control beside words in style, dropped by half what their first line grows under the reader's text size, so it stays on that line's middle (0 at the default size, where the row's own padding centres it). Plumbing of the components; pages never write it.

Implementation

Widget fluent2OnFirstLine(
  BuildContext context,
  TextStyle style,
  Widget control,
) {
  final size = style.fontSize ?? 14;
  final grown =
      (MediaQuery.textScalerOf(context).scale(size) - size) *
      (style.height ?? 1);
  if (grown <= 0) return control;
  return Padding(
    padding: EdgeInsets.only(top: grown / 2),
    child: control,
  );
}