Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7f47fb7
feat(llc): add debugCurrentPlatformOverride for testing platform-spec…
xsahil03x May 4, 2026
bc0c9b4
feat(ui): add StreamQuotedMessage component and theme support
xsahil03x May 4, 2026
1d23ea2
refactor(ui): self-contain StreamQuotedMessage chrome via theme
xsahil03x May 4, 2026
4a29d39
docs(ui): note StreamQuotedMessage in changelog
xsahil03x May 4, 2026
ebf0e23
refactor(ui): adopt stream_core_flutter composer and message text pri…
xsahil03x May 6, 2026
77c3df4
Merge remote-tracking branch 'origin/v10.0.0' into fix/more-latest-qa
xsahil03x May 7, 2026
ec613b7
docs(ui): note StreamMarkdownMessage removal in changelog
xsahil03x May 7, 2026
6c572d1
refactor(ui): use solid affirmative button in confirmation dialogs an…
xsahil03x May 7, 2026
d49d0d8
refactor(ui): make badge sizing themeable and fix back button badge p…
xsahil03x May 7, 2026
c294a09
feat(sample, ui): make reaction overlap configurable
xsahil03x May 7, 2026
4f139e2
fix(sample): correct chevrons and admin actions in detail screens
xsahil03x May 7, 2026
db05749
fix(sample): edit group sheet fills available height
xsahil03x May 7, 2026
e3298a9
fix(ui): cap slash command and mention autocomplete heights
xsahil03x May 7, 2026
4adddd6
fix(ui): hide poll add-option button instead of disabling it
xsahil03x May 7, 2026
7c3c4ed
fix(ui): left-align StreamChannelListTile subtitle for empty channels
xsahil03x May 7, 2026
be07aa3
chore(deps): bump stream_core_flutter to da615a2
xsahil03x May 7, 2026
29b9b71
chore: gitignore devtools_options.yaml
xsahil03x May 7, 2026
37e2679
chore: Update Goldens
xsahil03x May 7, 2026
c47dacb
fix(ui): jump to quoted parent message in thread, polish highlight pulse
xsahil03x May 7, 2026
4f3c702
test(ui): fix MessageInputMediaAttachments render test and cover unsu…
xsahil03x May 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:meta/meta.dart' show visibleForTesting;
import 'package:stream_chat/src/core/platform_detector/platform_detector_stub.dart'
if (dart.library.html) 'platform_detector_web.dart'
if (dart.library.io) 'platform_detector_io.dart';
Expand Down Expand Up @@ -67,6 +68,30 @@ class CurrentPlatform {
};
}

/// Override the value reported by [type] in tests.
///
/// Setting this affects all reads of [type], [name], and the per-platform
/// flags ([isAndroid], [isWeb], …). Reset to `null` after each test (e.g.
/// in `tearDown`) to avoid leaking state.
///
/// The override is honored only when asserts are enabled (debug, profile,
/// and tests); release builds tree-shake it away. Mirrors Flutter's
/// `debugDefaultTargetPlatformOverride`.
@visibleForTesting
static PlatformType? debugCurrentPlatformOverride;

/// Get current platform type
static PlatformType get type => currentPlatform;
static PlatformType get type {
var result = currentPlatform;
assert(
() {
if (debugCurrentPlatformOverride case final override?) {
result = override;
}
return true;
}(),
'debugCurrentPlatformOverride applied',
);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,25 @@ void main() {
expect(CurrentPlatform.isWindows, isFalse);
expect(CurrentPlatform.isFuchsia, isFalse);
});

group('debugCurrentPlatformOverride', () {
tearDown(() => CurrentPlatform.debugCurrentPlatformOverride = null);

test('changes type, name, and flags', () {
CurrentPlatform.debugCurrentPlatformOverride = PlatformType.web;

expect(CurrentPlatform.type, PlatformType.web);
expect(CurrentPlatform.name, 'web');
expect(CurrentPlatform.isWeb, isTrue);
expect(CurrentPlatform.isLinux, isFalse);
});

test('clearing the override restores the real platform', () {
CurrentPlatform.debugCurrentPlatformOverride = PlatformType.windows;
CurrentPlatform.debugCurrentPlatformOverride = null;

expect(CurrentPlatform.type, PlatformType.linux);
expect(CurrentPlatform.isWindows, isFalse);
});
});
}
1 change: 1 addition & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- Redesigned `StreamSystemMessage` / `StreamModeratedMessage` with a pill-shaped style and visual customisation props.
- Added visual customisation props to `ThreadSeparator` and `UnreadMessagesSeparator`.
- Added `StreamUnsupportedAttachment` and `UnsupportedAttachmentBuilder` for unrecognised attachment types.
- Added `StreamQuotedMessage` and `StreamQuotedMessageThemeData` for the quoted message preview.
- `MessagePreviewFormatter` now renders `AttachmentType.urlPreview` messages with a link icon and caption / OG title / `linkAttachmentText` fallback.
- Added `StreamPollCardStyle`, `StreamPollQuestionStyle` and `StreamPollOptionVotesStyle` shared style classes for the poll sheets.
- Added a total vote count footer and per-option "View all" action to `StreamPollResultsSheet`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Iterable<StreamComponentBuilderExtension<Object>> streamChatComponentBuilders({
StreamComponentBuilder<StreamLinkPreviewAttachmentProps>? linkPreviewAttachment,
StreamComponentBuilder<StreamVoiceRecordingAttachmentProps>? voiceRecordingAttachment,
StreamComponentBuilder<StreamPollAttachmentProps>? pollAttachment,
StreamComponentBuilder<StreamQuotedMessageProps>? quotedMessage,
StreamComponentBuilder<StreamUnsupportedAttachmentProps>? unsupportedAttachment,
}) {
final builders = [
Expand All @@ -46,6 +47,7 @@ Iterable<StreamComponentBuilderExtension<Object>> streamChatComponentBuilders({
if (linkPreviewAttachment != null) StreamComponentBuilderExtension(builder: linkPreviewAttachment),
if (voiceRecordingAttachment != null) StreamComponentBuilderExtension(builder: voiceRecordingAttachment),
if (pollAttachment != null) StreamComponentBuilderExtension(builder: pollAttachment),
if (quotedMessage != null) StreamComponentBuilderExtension(builder: quotedMessage),
if (unsupportedAttachment != null) StreamComponentBuilderExtension(builder: unsupportedAttachment),
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:stream_chat_flutter/src/attachment/builder/attachment_widget_builder.dart';
import 'package:stream_chat_flutter/src/channel/stream_message_preview_text.dart';
import 'package:stream_chat_flutter/src/message_widget/components/stream_message_deleted.dart';
import 'package:stream_chat_flutter/src/message_widget/components/stream_message_reactions.dart';
import 'package:stream_chat_flutter/src/message_widget/components/stream_message_text.dart';
import 'package:stream_chat_flutter/src/message_widget/parse_attachments.dart';
import 'package:stream_chat_flutter/src/message_widget/stream_quoted_message.dart';
import 'package:stream_chat_flutter/src/utils/typedefs.dart';
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
import 'package:stream_core_flutter/stream_core_flutter.dart' as core;
Expand Down Expand Up @@ -165,40 +165,17 @@ class _StreamMessageContentState extends State<StreamMessageContent> {
final bubbleContent = ConstrainedBox(
constraints: const BoxConstraints().copyWith(maxWidth: widthLimit),
child: core.StreamColumn(
spacing: spacing.xxs,
mainAxisSize: .min,
spacing: spacing.xs,
crossAxisAlignment: .start,
children: [
if (widget.message.quotedMessage case final quotedMessage?)
// TODO: Refactor this with attachments
ConstrainedBox(
constraints: const .tightFor(width: 272),
child: GestureDetector(
onTap: !quotedMessage.isDeleted && widget.onQuotedMessageTap != null
? () => widget.onQuotedMessageTap!(quotedMessage)
: null,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: core.StreamMessageTheme(
data: core.StreamMessageThemeData(
incoming: core.StreamMessageStyle(
backgroundColor: context.streamColorScheme.backgroundSurfaceStrong,
),
outgoing: core.StreamMessageStyle(
backgroundColor: context.streamColorScheme.brand.shade150,
),
),
child: core.MessageComposerReplyAttachment(
title: Text(quotedMessage.user?.name ?? ''),
subtitle: StreamMessagePreviewText(message: quotedMessage),
style: switch (core.StreamMessageLayout.messageAlignmentOf(context)) {
core.StreamMessageAlignment.start => .incoming,
core.StreamMessageAlignment.end => .outgoing,
},
),
),
),
),
StreamQuotedMessage(
quotedMessage: quotedMessage,
onTap: switch (widget.onQuotedMessageTap) {
final onTap? => () => onTap(quotedMessage),
_ => null,
},
),
ParseAttachments(
key: attachmentsKey,
Expand Down
Loading
Loading