splitHintOf function

Widget splitHintOf({
  1. required bool noSound,
  2. required bool revealing,
  3. required String? wrong,
  4. required String? reference,
})

A dica da faixa da pergunta: o aviso do momento (sem som, tempo esgotado, a tecla errada, wrong) ou, sem aviso, o acorde de referência (reference) e como ouvir.

Implementation

Widget splitHintOf({
  required bool noSound,
  required bool revealing,
  required String? wrong,
  required String? reference,
}) {
  return Builder(
    builder: (context) {
      final t = context.zt;
      final small = TextStyle(
        fontSize: t.text.captionSmall.fontSize,
        fontWeight: FontWeight.w600,
      );
      if (noSound) {
        return Text(
          'Sem som: confira a saída de som nas configurações.',
          style: small.copyWith(color: t.colors.bad),
        );
      }
      if (revealing) {
        return Text(
          'Tempo esgotado — a certa está em verde.',
          style: t.text.captionSmall,
        );
      }
      if (wrong != null) {
        return Text(wrong, style: small.copyWith(color: t.colors.bad));
      }
      return Text(
        [?reference, 'Primeiro o acorde, depois a partitura.'].join(' '),
        maxLines: 2,
        overflow: TextOverflow.ellipsis,
        style: t.text.captionSmall,
      );
    },
  );
}