fluent2SearchFailed function

Widget fluent2SearchFailed(
  1. BuildContext context,
  2. DesignSearchError failure
)

The list after a search threw (failure): that it failed, in the secondary ink, and "Try again" as an option row, lit while the keys are on it (DesignSearchError.focused) and under the pointer. The focus stays in the field: the row is no tab stop.

Implementation

Widget fluent2SearchFailed(BuildContext context, DesignSearchError failure) {
  final t = context.fluent2Theme;
  final words = DesignLocalizations.of(context);
  return Column(
    mainAxisSize: MainAxisSize.min,
    crossAxisAlignment: CrossAxisAlignment.stretch,
    children: [
      // The list says it as it appears; the row would say it twice.
      ExcludeSemantics(
        child: Padding(
          padding: const EdgeInsets.symmetric(
            horizontal: Fluent2Spacing.s,
            vertical: Fluent2Spacing.sNudge,
          ),
          child: Text(
            words.searchFailedMessage,
            style: t.body1.c(t.textSecondary),
          ),
        ),
      ),
      ExcludeFocus(
        child: DesignPressable(
          onPressed: failure.retry,
          semanticLabel: words.retryButtonLabel,
          builder: (context, states, _) => Fluent2OptionFace(
            label: words.retryButtonLabel,
            selected: false,
            highlighted: failure.focused,
            states: states,
          ),
        ),
      ),
    ],
  );
}