Package
stream_chat_flutter
On what platforms did you experience the issue?
iOS
Package version
stream_chat_flutter 10.0.1, stream_core_flutter 0.3.0 (Flutter 3.44.0, Dart 3.12.0)
Flutter version
3.44.0
Steps to reproduce
- Provide a custom light
StreamColorScheme to the app — e.g. expose a StreamTheme(brightness: Brightness.light, colorScheme: StreamColorScheme.light(accentPrimary: <appAccent>)) as a ThemeData extension on the app's light theme (so StreamChat picks it up via StreamTheme.of(context)).
- Run the app in light mode and open a channel (
StreamChannel + StreamMessageComposer).
- Look at the composer's icons: the leading attachment
+, the attachment-picker tab icons (gallery/camera/files/…), and the send/record button.
Expected behavior
The composer/picker icons should use the provided light StreamColorScheme — i.e. textPrimary (a dark color) — and be visible on the light composer surface, exactly as the message-list text correctly does.
Actual behavior
The composer / attachment-picker icons render white (invisible) on the light surface, even though the message list text correctly uses the light scheme (dark text). In dark mode the same icons are white and visible (correct). So only the composer/picker StreamButton icons behave as if a dark scheme is active, while everything else uses the light scheme.
Diagnostic (measured at the composer's build context)
Theme.of(context).brightness = Brightness.light
Theme.of(context).extension<StreamTheme>() != null = true
StreamTheme.of(context).brightness = Brightness.light
context.streamColorScheme.textPrimary = Color(0xFF1A1B25) // dark
So the resolved StreamColorScheme at the composer is the light one, and textPrimary is dark.
Analysis
The composer icons are StreamButtons:
- leading
+ → StreamButton(style: secondary, type: outline) → _SecondaryOutlineDefaults.foregroundColor => colorScheme.textPrimary
- picker tabs / send →
StreamButton(style: secondary, type: ghost/...) → _SecondaryGhostDefaults.foregroundColor => colorScheme.textPrimary
effectiveForegroundColor = themeStyle?.foregroundColor ?? defaults.foregroundColor, and with the default (empty) StreamButtonThemeData the defaults win → colorScheme.textPrimary. Since textPrimary is dark (per the diagnostic above) and it's passed as ButtonStyle.foregroundColor to the underlying ElevatedButton, the icons should render dark — but they render white. We could not find any theme re-injection between StreamMessageComposer and the buttons, nor a separate iconColor override, nor a MediaQuery.platformBrightness fallback in the resolution path.
Question
Is this a known issue, or is there a supported way to supply a custom light StreamColorScheme so the composer/picker StreamButton icons pick it up? Note that StreamColorScheme/StreamTheme are exported by stream_chat_flutter, but StreamButtonThemeData (which would let us force the button foreground) is not — so overriding the button theme requires depending on stream_core_flutter directly.
Package
stream_chat_flutter
On what platforms did you experience the issue?
iOS
Package version
stream_chat_flutter 10.0.1, stream_core_flutter 0.3.0 (Flutter 3.44.0, Dart 3.12.0)
Flutter version
3.44.0
Steps to reproduce
StreamColorSchemeto the app — e.g. expose aStreamTheme(brightness: Brightness.light, colorScheme: StreamColorScheme.light(accentPrimary: <appAccent>))as aThemeDataextension on the app's light theme (soStreamChatpicks it up viaStreamTheme.of(context)).StreamChannel+StreamMessageComposer).+, the attachment-picker tab icons (gallery/camera/files/…), and the send/record button.Expected behavior
The composer/picker icons should use the provided light
StreamColorScheme— i.e.textPrimary(a dark color) — and be visible on the light composer surface, exactly as the message-list text correctly does.Actual behavior
The composer / attachment-picker icons render white (invisible) on the light surface, even though the message list text correctly uses the light scheme (dark text). In dark mode the same icons are white and visible (correct). So only the composer/picker
StreamButtonicons behave as if a dark scheme is active, while everything else uses the light scheme.Diagnostic (measured at the composer's build context)
So the resolved
StreamColorSchemeat the composer is the light one, andtextPrimaryis dark.Analysis
The composer icons are
StreamButtons:+→StreamButton(style: secondary, type: outline)→_SecondaryOutlineDefaults.foregroundColor => colorScheme.textPrimaryStreamButton(style: secondary, type: ghost/...)→_SecondaryGhostDefaults.foregroundColor => colorScheme.textPrimaryeffectiveForegroundColor = themeStyle?.foregroundColor ?? defaults.foregroundColor, and with the default (empty)StreamButtonThemeDatathe defaults win →colorScheme.textPrimary. SincetextPrimaryis dark (per the diagnostic above) and it's passed asButtonStyle.foregroundColorto the underlyingElevatedButton, the icons should render dark — but they render white. We could not find any theme re-injection betweenStreamMessageComposerand the buttons, nor a separateiconColoroverride, nor aMediaQuery.platformBrightnessfallback in the resolution path.Question
Is this a known issue, or is there a supported way to supply a custom light
StreamColorSchemeso the composer/pickerStreamButtonicons pick it up? Note thatStreamColorScheme/StreamThemeare exported bystream_chat_flutter, butStreamButtonThemeData(which would let us force the button foreground) is not — so overriding the button theme requires depending onstream_core_flutterdirectly.