Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion packages/stream_core_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.5.0
## Upcoming

### ✨ Features

Expand All @@ -11,6 +11,10 @@
- Added `excludeHeaderSemantics` to `StreamAppBar` and `StreamSheetHeader` for opting out of the default heading role and route naming on the title.
- Added `onVisible` callback to `StreamSnackbar` — fires after the entrance animation completes (or synchronously when a screen reader is active).

### 🐞 Fixed

- Fixed `StreamButton` icons picking up the host app's `ElevatedButtonThemeData.iconColor` instead of the button's own `foregroundColor`.

## 0.4.0

### ✨ Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ class _DefaultStreamButtonState extends State<DefaultStreamButton> {
elevation: effectiveElevation,
backgroundColor: effectiveBackgroundColor,
foregroundColor: effectiveForegroundColor,
iconColor: effectiveForegroundColor,
overlayColor: effectiveOverlayColor,
fixedSize: effectiveFixedSize,
minimumSize: effectiveMinimumSize,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stream_core_flutter/core.dart';

Widget _withStreamTheme(Widget child) {
Widget _withStreamTheme(
Widget child, {
StreamTheme? streamTheme,
ElevatedButtonThemeData? elevatedButtonTheme,
}) {
return MaterialApp(
theme: ThemeData(extensions: [StreamTheme()]),
theme: ThemeData(
extensions: [streamTheme ?? StreamTheme()],
elevatedButtonTheme: elevatedButtonTheme,
),
home: Scaffold(body: Center(child: child)),
);
}
Expand Down Expand Up @@ -154,4 +161,33 @@ void main() {
handle.dispose();
});
});

// Test for https://github.com/GetStream/stream-chat-flutter/issues/2786
testWidgets(
'host-app ElevatedButtonThemeData.iconColor does not leak into StreamButton icons',
(tester) async {
const hostIconColor = Color(0xFF00FF00);

Color? capturedIconColor;
await tester.pumpWidget(
_withStreamTheme(
elevatedButtonTheme: const ElevatedButtonThemeData(
style: ButtonStyle(iconColor: WidgetStatePropertyAll(hostIconColor)),
),
StreamButton.icon(
onPressed: () {},
icon: Builder(
builder: (context) {
capturedIconColor = IconTheme.of(context).color;
return const Icon(Icons.add);
},
),
),
),
);
await tester.pumpAndSettle();

expect(capturedIconColor, isNot(hostIconColor));
},
);
}
Loading
Loading