pair static method

Widget pair(
  1. BuildContext context,
  2. Widget first,
  3. Widget second, {
  4. double gap = 10,
})

Two fields side by side on a wide screen, stacked on a phone.

The branch exists because two text fields sharing a 360px row leave each one too narrow to read what it holds.

Implementation

static Widget pair(BuildContext context, Widget first, Widget second, {double gap = 10}) => context.isMobileWidth
    ? UColumn(
        spacing: 8,
        crossAxisAlignment: CrossAxisAlignment.stretch,
        margin: const EdgeInsets.symmetric(vertical: 6),
        children: <Widget>[first, second],
      )
    : URow(
        crossAxisAlignment: CrossAxisAlignment.start,
        margin: const EdgeInsets.symmetric(vertical: 6),
        children: <Widget>[
          first.expanded(),
          SizedBox(width: gap),
          second.expanded(),
        ],
      );