Skip to content

v10: composer / attachment-picker icons render white (invisible) in light mode despite a light StreamColorScheme #2786

Description

@Mounix99

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

  1. 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)).
  2. Run the app in light mode and open a channel (StreamChannel + StreamMessageComposer).
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions