Skip to content

feat(ui, localization, samples): message translations - #2870

Open
renefloor wants to merge 10 commits into
masterfrom
worktree-message-translations
Open

feat(ui, localization, samples): message translations#2870
renefloor wants to merge 10 commits into
masterfrom
worktree-message-translations

Conversation

@renefloor

@renefloor renefloor commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Submit a pull request

Linear: Fixes FLU-673

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

The current SDK already supports translating messages, but the UI package misses crucial features. This PR adds the annotations from the new design system that shows the fact that it's translated and you can switch between original and translated message. The SDK also adds a flag StreamChatConfigurationData.translationDisplayEnabled so you can also disable auto translated messages.

The sample app adds a button in the message actions so you can request a translation, as the sdk never automatically translate messages, although the backend can do that for you. The button to translate is disabled if the message is already translated to your language.

Screenshots / Videos

image image image

Summary by CodeRabbit

  • New Features

    • Messages now display available translations automatically, with controls to switch between translated and original text.
    • Translation display can be disabled globally.
    • Added a sample-app setting and message action for requesting translations.
    • Added localized translation labels and source-language text across supported languages.
  • Bug Fixes

    • Message translation state now persists correctly as lists update or paginate.

… available translation

Automatically detects when Message.i18n already has a translation for the
current user's language (either from server-side auto-translation or an
earlier on-request translate call) and surfaces it as a message annotation,
with a tappable link to toggle back to the original text.

- DefaultStreamMessageHeader renders the annotation last in the mixed-
  annotation priority order, per the design system's Figma spec, and names
  the message's original language when known.
- The show-original toggle lives in a new StreamMessageTranslationStore,
  scoped per StreamMessageListView, so it survives list virtualization
  instead of resetting when a message widget scrolls out of view and back.
- Gated behind a new translationDisplayEnabled config flag (default true)
  for apps that want to opt out entirely.
- Adds the "Translated"/"Original"/"Show original"/"Show translation"/
  "Translated from {language}" strings, plus a curated language-code to
  display-name table, to all 11 bundled locales.
…n message previews

Stream's API defaults User.language to '' rather than omitting it, so the
previous `language ?? currentUser?.language ?? 'en'` fallback never reached
its 'en' default and previews silently rendered untranslated. Falls back to
the device locale instead, matching the behavior already used elsewhere for
message text and headers.
Adds a Translate action to the message long-press menu, gated behind a new
"Message Translation" toggle in the sample app's configuration screen
(disabled by default). Calls channel.translateMessage and merges the result
into local channel state, so the SDK's own translation annotation and
message rendering pick it up automatically.

Only shown for received messages — translating your own message isn't
useful — and always translates directly to the user's language (falling
back to the device locale), with no language picker. Disabled once the
message is already translated to that language, or the original text is
already in it.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a07267bd-1d5c-4c12-ada7-a0379c97e4af

📥 Commits

Reviewing files that changed from the base of the PR and between 855ba68 and 970c5a9.

📒 Files selected for processing (5)
  • packages/stream_chat_flutter/lib/src/channel/stream_message_preview_text.dart
  • packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_header.dart
  • packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_text.dart
  • packages/stream_chat_flutter/lib/src/utils/extensions.dart
  • sample_app/lib/widgets/custom_message_actions.dart
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/stream_chat_flutter/lib/src/channel/stream_message_preview_text.dart
  • packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_text.dart
  • packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_header.dart

📝 Walkthrough

Walkthrough

The PR adds automatic translated-message display, localized translation annotations, per-message original-text toggles, a global SDK display setting, and a sample-app translation action.

Changes

Message translation

Layer / File(s) Summary
Translation contracts and configuration
packages/stream_chat_flutter/lib/src/localization/translations.dart, packages/stream_chat_flutter/lib/src/stream_chat_configuration.dart, packages/stream_chat_flutter/lib/src/utils/extensions.dart, packages/stream_chat_localizations/lib/src/stream_chat_localizations_*.dart, packages/stream_chat_localizations/example/lib/add_new_lang.dart
Added translation labels, source-language formatting, language-code lookup maps, nullable language handling, and the translationDisplayEnabled configuration field.
Per-list translation state
packages/stream_chat_flutter/lib/src/message_widget/stream_message_translation_store.dart, packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart, packages/stream_chat_flutter/lib/src/message_widget/stream_message_item.dart, packages/stream_chat_flutter/lib/stream_chat_flutter.dart
Added list-scoped message translation state, inherited store access, disposal, stable message keys, and translation-aware message previews.
Translated message rendering
packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_header.dart, packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_content.dart, packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_text.dart, packages/stream_chat_flutter/lib/src/channel/stream_message_preview_text.dart, packages/stream_chat_flutter/test/src/channel/stream_message_preview_text_test.dart, packages/stream_chat_flutter/CHANGELOG.md
Added original-text controls, translated annotations, locale-based translation selection, disabled-display behavior, and coverage for untranslated previews.
Sample app translation controls
sample_app/lib/config/sample_app_config.dart, sample_app/lib/config/sample_app_config_screen.dart, sample_app/lib/widgets/custom_message_actions.dart
Added persisted message-translation settings, a feature switch, and guarded context-menu translation requests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MessageListView
  participant StreamMessageTranslationStore
  participant DefaultStreamMessageItem
  participant StreamMessageHeader
  participant StreamMessageText
  MessageListView->>StreamMessageTranslationStore: provide per-list translation state
  DefaultStreamMessageItem->>StreamMessageTranslationStore: read message original-text state
  DefaultStreamMessageItem->>StreamMessageHeader: pass toggle state and callback
  DefaultStreamMessageItem->>StreamMessageText: pass original-text state
  StreamMessageHeader->>StreamMessageTranslationStore: toggle original text
  StreamMessageText-->>DefaultStreamMessageItem: render translated or original text
Loading

Suggested reviewers: xsahil03x

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the message translation features added to the UI, localization, and sample app.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-message-translations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

StreamMessagePreviewText translated unconditionally, unlike StreamMessageText
which already gates translation behind translationDisplayEnabled. This left
the channel list, thread list, search results, quoted messages, and the
reply-preview header showing translated text even when the flag was
disabled SDK-wide.
The comment attributed the key to protecting a translation show-original
toggle, which moved into StreamMessageTranslationStore (keyed externally by
message id) and no longer needs it. The key is still required though: other
per-message StatefulWidgets in this subtree (content, attachments, leading)
would otherwise have their State reused for the wrong message when
pagination prepends older messages and shifts every already-rendered item's
index.
…n toggle

The long-press message-actions modal re-renders the message in a fresh
StreamMessageItem on top of the scrim, outside the StreamMessageListView
subtree that owns the StreamMessageTranslationStore. Without re-providing
that scope, the preview always showed the translation regardless of the
list's toggle state, and its "Show original"/"Show translation" link had
no effect.

Captures the ambient store (if any) before opening the dialog and
re-provides it around the nested StreamMessageItem, matching how
StreamChatConfiguration and StreamChannel are already re-provided for the
same modal.
StreamThreadListTile passed currentUser?.language straight through to
StreamMessagePreviewText's language parameter, bypassing that widget's
own null-or-empty-string fallback to the device locale. Stream's API
defaults User.language to '' rather than omitting it, so thread previews
silently stopped translating for exactly the case the preview-text fix
already handled elsewhere.

Also extracts the "null or empty string falls back to the device locale"
logic into a single UserX.languageOrDeviceLocale extension. It was
previously duplicated as two identical _resolveLanguage private functions
(stream_message_header.dart, stream_message_text.dart) plus two more
inlined switch expressions (stream_message_preview_text.dart, the sample
app's custom_message_actions.dart) — all doing the same thing.
@renefloor
renefloor marked this pull request as ready for review August 6, 2026 13:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart`:
- Around line 812-813: Update translatedFromLanguageText to use the contracted
Spanish preposition “del” before the interpolated source-language name, so the
resulting label reads “Traducido del Inglés” while preserving the existing
_languageNameEs(languageCode) interpolation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ac6ac58c-047a-4d69-9905-6c2f42ccf61f

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4c2ae and 3961cd4.

📒 Files selected for processing (28)
  • packages/stream_chat_flutter/CHANGELOG.md
  • packages/stream_chat_flutter/lib/src/channel/stream_message_preview_text.dart
  • packages/stream_chat_flutter/lib/src/localization/translations.dart
  • packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart
  • packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_content.dart
  • packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_header.dart
  • packages/stream_chat_flutter/lib/src/message_widget/components/stream_message_text.dart
  • packages/stream_chat_flutter/lib/src/message_widget/stream_message_item.dart
  • packages/stream_chat_flutter/lib/src/message_widget/stream_message_translation_store.dart
  • packages/stream_chat_flutter/lib/src/scroll_view/thread_scroll_view/stream_thread_list_tile.dart
  • packages/stream_chat_flutter/lib/src/stream_chat_configuration.dart
  • packages/stream_chat_flutter/lib/src/utils/extensions.dart
  • packages/stream_chat_flutter/lib/stream_chat_flutter.dart
  • packages/stream_chat_flutter/test/src/channel/stream_message_preview_text_test.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart
  • packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart
  • sample_app/lib/config/sample_app_config.dart
  • sample_app/lib/config/sample_app_config_screen.dart
  • sample_app/lib/widgets/custom_message_actions.dart

Comment thread packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart Outdated
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.74233% with 108 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.93%. Comparing base (4b4c2ae) to head (970c5a9).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ssage_widget/components/stream_message_header.dart 46.87% 17 Missing ⚠️
...hat_flutter/lib/src/localization/translations.dart 0.00% 7 Missing ⚠️
...izations/lib/src/stream_chat_localizations_ca.dart 0.00% 7 Missing ⚠️
...izations/lib/src/stream_chat_localizations_de.dart 0.00% 7 Missing ⚠️
...izations/lib/src/stream_chat_localizations_en.dart 0.00% 7 Missing ⚠️
...izations/lib/src/stream_chat_localizations_es.dart 0.00% 7 Missing ⚠️
...izations/lib/src/stream_chat_localizations_fr.dart 0.00% 7 Missing ⚠️
...izations/lib/src/stream_chat_localizations_hi.dart 0.00% 7 Missing ⚠️
...izations/lib/src/stream_chat_localizations_it.dart 0.00% 7 Missing ⚠️
...izations/lib/src/stream_chat_localizations_ja.dart 0.00% 7 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2870      +/-   ##
==========================================
- Coverage   73.18%   72.93%   -0.26%     
==========================================
  Files         429      430       +1     
  Lines       27724    27866     +142     
==========================================
+ Hits        20289    20323      +34     
- Misses       7435     7543     +108     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renefloor renefloor changed the title feat(ui): message translations feat(ui, localizations, samples): message translations Aug 6, 2026
@renefloor renefloor changed the title feat(ui, localizations, samples): message translations feat(ui, localization, samples): message translations Aug 6, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/stream_chat_localizations/example/lib/add_new_lang.dart`:
- Around line 818-831: Add `///` documentation comments immediately above each
public localization member in the generated implementation: `translatedLabel`,
`originalLabel`, `showOriginalLabel`, `showTranslationLabel`, and
`translatedFromLanguageText`. Document the purpose of each label and the
language-code interpolation method without changing their existing values or
signatures.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d82c927f-18b2-4760-a112-4e60b5f23d35

📥 Commits

Reviewing files that changed from the base of the PR and between 3961cd4 and 5d72c45.

📒 Files selected for processing (1)
  • packages/stream_chat_localizations/example/lib/add_new_lang.dart

Comment on lines +818 to +831
@override
String get translatedLabel => 'Translated';

@override
String get originalLabel => 'Original';

@override
String get showOriginalLabel => 'Show original';

@override
String get showTranslationLabel => 'Show translation';

@override
String translatedFromLanguageText(String languageCode) => 'Translated from ${languageCode.toUpperCase()}';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add doc comments for the new public localization APIs.

translatedLabel, originalLabel, showOriginalLabel, showTranslationLabel, and translatedFromLanguageText are public members. Add a /// comment for each declaration.

Proposed documentation
+  /// The annotation label shown for translated message content.
   `@override`
   String get translatedLabel => 'Translated';

+  /// The annotation label shown for original message content.
   `@override`
   String get originalLabel => 'Original';

+  /// The label that switches a message to its original text.
   `@override`
   String get showOriginalLabel => 'Show original';

+  /// The label that switches a message to its translated text.
   `@override`
   String get showTranslationLabel => 'Show translation';

+  /// Returns the translated-message label for the source language code.
   `@override`
   String translatedFromLanguageText(String languageCode) =>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@override
String get translatedLabel => 'Translated';
@override
String get originalLabel => 'Original';
@override
String get showOriginalLabel => 'Show original';
@override
String get showTranslationLabel => 'Show translation';
@override
String translatedFromLanguageText(String languageCode) => 'Translated from ${languageCode.toUpperCase()}';
/// The annotation label shown for translated message content.
`@override`
String get translatedLabel => 'Translated';
/// The annotation label shown for original message content.
`@override`
String get originalLabel => 'Original';
/// The label that switches a message to its original text.
`@override`
String get showOriginalLabel => 'Show original';
/// The label that switches a message to its translated text.
`@override`
String get showTranslationLabel => 'Show translation';
/// Returns the translated-message label for the source language code.
`@override`
String translatedFromLanguageText(String languageCode) => 'Translated from ${languageCode.toUpperCase()}';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stream_chat_localizations/example/lib/add_new_lang.dart` around
lines 818 - 831, Add `///` documentation comments immediately above each public
localization member in the generated implementation: `translatedLabel`,
`originalLabel`, `showOriginalLabel`, `showTranslationLabel`, and
`translatedFromLanguageText`. Document the purpose of each label and the
language-code interpolation method without changing their existing values or
signatures.

Source: Coding guidelines

@renefloor renefloor Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The doc comments for translatedLabel, originalLabel, showOriginalLabel, showTranslationLabel, and translatedFromLanguageText already exist on the abstract interface (stream_chat_flutter/lib/src/localization/translations.dart:730-756). Every concrete implementation in the repo — the base DefaultTranslations, all locale files in stream_chat_localizations/lib/src/, and this example file — consistently omits doc comments on @override members and relies on doc inheritance. Adding comments only in the example file would be inconsistent with the established convention, so I left it as-is.

Comment thread packages/stream_chat_flutter/lib/src/stream_chat_configuration.dart
/// available translations.
///
/// Defaults to `true`.
final bool translationDisplayEnabled;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Something maybe to consider: On Android, this config is two-part:

public data class TranslationConfig(
    val enabled: Boolean = true,
    val showOriginalEnabled: Boolean = true,
)
  • TranslationConfig.enabled -> controls whether the message automatically displays its translation
  • TranslationConfig.showOriginalEnabled -> controls whether the Show original is toggled.

It was implemented like this because the features came at a different time and to avoid breaking changes - but maybe it makes sense if a customer would like to use auto translation, but disable the "Show original" toggle.

Again, just a suggestion, since the whole feature is new, we can keep it simple.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wonder why you would ever want to hide the show original button? I can only imagine that we want 2 toggles for showing translations at all and showing the translated message automatically. Or is that what is meant with showOriginalEnabled?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes the showOriginalEnabled controls whether the "Show original"/"Show translated" toggle is shown in the message view.

On Android the "Show original" feature request came much later compared to the "Auto translation". So in order to be backwards compatible, we hid the "Show original" button by default - and customers can opt-in via the config to actually show the toggle (this has now changed with the major v7, and both flags are true by default, but they still exist separately).

Now that we are introducing "both" features as a package - maybe it doesn't make sense to have them configured separately. But still, I think we should consider the possibility of a customer not wanting to show the "Show original" toggle, even when they use auto-translation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In that case maybe it's better to name it showTranslationAnnotation as it's also hiding 'show translation'. But we do want to have less configuration options and people now have a slot to manage their annotations directly, so I think it's better to write a doc on how to manage your own annotations.

@VelikovPetar VelikovPetar Aug 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah I like that naming better. One thing that I can suggest is still wrapping the translationDisplayEnabled flag into a config object, something along the lines of:

class StreamTranslationsConfiguration {
  final bool translationDisplayEnabled;
}

So we can easily extend it (potentially with showTranslationAnnotation) without breaking changes, and without polluting the StreamChatConfiguration with multiple translations-related fields.

But we do want to have less configuration options and people now have a slot to manage their annotations directly

I am still a bit worried about having the "Show original/translation" displayed by default - mostly because of the reason I mentioned earlier about showing "double" labels (one from the SDK, and one from the integrator app).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I personally don't like the name translationDisplayEnabled i think showTranslationAnnotation is better suited here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But I would still prefer not to have this setting at all, but just explain how to disable using the header builder of the message in the factory.

/// Returns the message unchanged when [language] is `null` or empty —
/// Stream's API defaults [User.language] to `''` rather than omitting it,
/// so both are treated as "no language to translate to".
Message translate(String? language) => switch (language) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps we can add/extend the unit test for this?

final icons = context.streamIcons;
return [
StreamContextMenuAction(
label: const Text('Translate'),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
label: const Text('Translate'),
label: const Text('Translate Message'),

/// isn't a useful action — and always translates directly to the current
/// user's [User.language], with no language picker. Hidden entirely when
/// that isn't set server-side, rather than guessing a target language.
abstract final class _TranslateAction {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
abstract final class _TranslateAction {
abstract final class _TranslateMessageAction {

];
}

static Future<void> _translate(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
static Future<void> _translate(
static Future<void> _translateMessage(

channel.state?.updateMessage(response.message);
} catch (e) {
if (!context.mounted) return;
ScaffoldMessenger.of(context).showSnackBar(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's use our StreamSnackbar instead

/// the individual message widget, is what makes the toggle survive message
/// items being disposed and recreated as they scroll out of and back into
/// the list's render window.
class StreamMessageTranslationStore extends ChangeNotifier {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we can use a value notifier here

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.

3 participants