Skip to content

Comments

Add recording timer UI and tests#13

Merged
fbraza merged 1 commit intomainfrom
feature/timer-issue-3
Sep 30, 2025
Merged

Add recording timer UI and tests#13
fbraza merged 1 commit intomainfrom
feature/timer-issue-3

Conversation

@fbraza
Copy link
Contributor

@fbraza fbraza commented Sep 30, 2025

Summary

  • Extend lib/features/voice_to_text/view/voice_to_text_model.dart with elapsed-duration state plus startTimer,
    pauseTimer, and resetTimer, ensuring the timer cancels on dispose.

  • Introduce TimerDisplay (lib/features/voice_to_text/widget/timer_display.dart) and render it
    beneath the waveform, auto-starting the timer from _VoiceToTextViewState (lib/features/voice_to_text/view/ voice_to_text_screen.dart).

  • Add targeted coverage: fake-async unit tests for timer transitions (test/features/voice_to_text/view/ voice_to_text_model_test.dart) and a widget test for MM:SS formatting (test/features/voice_to_text/widget/ timer_display_test.dart).

  • Declare the fake_async dev dependency in pubspec.yaml/pubspec.lock.

Testing

  • flutter test

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +1 to +24
import 'package:flutter/material.dart';

class TimerDisplay extends StatelessWidget {
const TimerDisplay({super.key, required this.duration});

final Duration duration;

@override
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
final style =
textTheme.titleMedium?.copyWith(
fontSize: 18,
fontWeight: FontWeight.w500,
color: Colors.grey.shade600,
letterSpacing: 1.2,
fontFeatures: const [FontFeature.tabularFigures()],
) ??
const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
color: Color(0xFF757575),
letterSpacing: 1.2,
fontFeatures: [FontFeature.tabularFigures()],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] Import FontFeature to compile TimerDisplay

The new TimerDisplay widget calls FontFeature.tabularFigures() but the file only imports package:flutter/material.dart. FontFeature lives in dart:ui and is not re-exported by the Material barrel, so the widget fails to compile with Undefined class 'FontFeature'. Add an explicit dart:ui import (or prefix the symbol) so the timer can build.

Useful? React with 👍 / 👎.

@fbraza fbraza merged commit b426695 into main Sep 30, 2025
2 checks passed
@fbraza fbraza mentioned this pull request Sep 30, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant