chore: rename ChannelPreviewTheme to ChannelPreviewThemeData
This commit is contained in:
@@ -58,7 +58,7 @@ class MyApp extends StatelessWidget {
|
|||||||
final defaultTheme = StreamChatThemeData.fromTheme(themeData);
|
final defaultTheme = StreamChatThemeData.fromTheme(themeData);
|
||||||
final colorTheme = defaultTheme.colorTheme;
|
final colorTheme = defaultTheme.colorTheme;
|
||||||
final customTheme = defaultTheme.merge(StreamChatThemeData(
|
final customTheme = defaultTheme.merge(StreamChatThemeData(
|
||||||
channelPreviewTheme: ChannelPreviewTheme(
|
channelPreviewTheme: ChannelPreviewThemeData(
|
||||||
avatarTheme: AvatarThemeData(
|
avatarTheme: AvatarThemeData(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class StreamChatThemeData {
|
|||||||
TextTheme? textTheme,
|
TextTheme? textTheme,
|
||||||
ColorTheme? colorTheme,
|
ColorTheme? colorTheme,
|
||||||
ChannelListHeaderTheme? channelListHeaderTheme,
|
ChannelListHeaderTheme? channelListHeaderTheme,
|
||||||
ChannelPreviewTheme? channelPreviewTheme,
|
ChannelPreviewThemeData? channelPreviewTheme,
|
||||||
ChannelHeaderThemeData? channelHeaderTheme,
|
ChannelHeaderThemeData? channelHeaderTheme,
|
||||||
MessageTheme? otherMessageTheme,
|
MessageTheme? otherMessageTheme,
|
||||||
MessageTheme? ownMessageTheme,
|
MessageTheme? ownMessageTheme,
|
||||||
@@ -142,7 +142,7 @@ class StreamChatThemeData {
|
|||||||
final ColorTheme colorTheme;
|
final ColorTheme colorTheme;
|
||||||
|
|
||||||
/// Theme of the [ChannelPreview]
|
/// Theme of the [ChannelPreview]
|
||||||
final ChannelPreviewTheme channelPreviewTheme;
|
final ChannelPreviewThemeData channelPreviewTheme;
|
||||||
|
|
||||||
/// Theme of the [ChannelListHeader]
|
/// Theme of the [ChannelListHeader]
|
||||||
final ChannelListHeaderTheme channelListHeaderTheme;
|
final ChannelListHeaderTheme channelListHeaderTheme;
|
||||||
@@ -193,7 +193,7 @@ class StreamChatThemeData {
|
|||||||
StreamChatThemeData copyWith({
|
StreamChatThemeData copyWith({
|
||||||
TextTheme? textTheme,
|
TextTheme? textTheme,
|
||||||
ColorTheme? colorTheme,
|
ColorTheme? colorTheme,
|
||||||
ChannelPreviewTheme? channelPreviewTheme,
|
ChannelPreviewThemeData? channelPreviewTheme,
|
||||||
ChannelHeaderThemeData? channelHeaderTheme,
|
ChannelHeaderThemeData? channelHeaderTheme,
|
||||||
MessageTheme? ownMessageTheme,
|
MessageTheme? ownMessageTheme,
|
||||||
MessageTheme? otherMessageTheme,
|
MessageTheme? otherMessageTheme,
|
||||||
@@ -283,7 +283,7 @@ class StreamChatThemeData {
|
|||||||
color: const Color(0xff7A7A7A),
|
color: const Color(0xff7A7A7A),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final channelPreviewTheme = ChannelPreviewTheme(
|
final channelPreviewTheme = ChannelPreviewThemeData(
|
||||||
unreadCounterColor: colorTheme.accentError,
|
unreadCounterColor: colorTheme.accentError,
|
||||||
avatarTheme: AvatarThemeData(
|
avatarTheme: AvatarThemeData(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:stream_chat_flutter/src/theme/avatar_theme.dart';
|
import 'package:stream_chat_flutter/src/theme/avatar_theme.dart';
|
||||||
|
|
||||||
/// Theme for channel preview
|
/// Theme for channel preview
|
||||||
class ChannelPreviewTheme with Diagnosticable {
|
class ChannelPreviewThemeData with Diagnosticable {
|
||||||
/// Constructor for creating [ChannelPreviewTheme]
|
/// Constructor for creating [ChannelPreviewThemeData]
|
||||||
const ChannelPreviewTheme({
|
const ChannelPreviewThemeData({
|
||||||
this.titleStyle,
|
this.titleStyle,
|
||||||
this.subtitleStyle,
|
this.subtitleStyle,
|
||||||
this.lastMessageAtStyle,
|
this.lastMessageAtStyle,
|
||||||
@@ -33,7 +33,7 @@ class ChannelPreviewTheme with Diagnosticable {
|
|||||||
final double? indicatorIconSize;
|
final double? indicatorIconSize;
|
||||||
|
|
||||||
/// Copy with theme
|
/// Copy with theme
|
||||||
ChannelPreviewTheme copyWith({
|
ChannelPreviewThemeData copyWith({
|
||||||
TextStyle? titleStyle,
|
TextStyle? titleStyle,
|
||||||
TextStyle? subtitleStyle,
|
TextStyle? subtitleStyle,
|
||||||
TextStyle? lastMessageAtStyle,
|
TextStyle? lastMessageAtStyle,
|
||||||
@@ -41,7 +41,7 @@ class ChannelPreviewTheme with Diagnosticable {
|
|||||||
Color? unreadCounterColor,
|
Color? unreadCounterColor,
|
||||||
double? indicatorIconSize,
|
double? indicatorIconSize,
|
||||||
}) =>
|
}) =>
|
||||||
ChannelPreviewTheme(
|
ChannelPreviewThemeData(
|
||||||
titleStyle: titleStyle ?? this.titleStyle,
|
titleStyle: titleStyle ?? this.titleStyle,
|
||||||
subtitleStyle: subtitleStyle ?? this.subtitleStyle,
|
subtitleStyle: subtitleStyle ?? this.subtitleStyle,
|
||||||
lastMessageAtStyle: lastMessageAtStyle ?? this.lastMessageAtStyle,
|
lastMessageAtStyle: lastMessageAtStyle ?? this.lastMessageAtStyle,
|
||||||
@@ -51,7 +51,7 @@ class ChannelPreviewTheme with Diagnosticable {
|
|||||||
);
|
);
|
||||||
|
|
||||||
/// Merge with theme
|
/// Merge with theme
|
||||||
ChannelPreviewTheme merge(ChannelPreviewTheme? other) {
|
ChannelPreviewThemeData merge(ChannelPreviewThemeData? other) {
|
||||||
if (other == null) return this;
|
if (other == null) return this;
|
||||||
return copyWith(
|
return copyWith(
|
||||||
titleStyle: titleStyle?.merge(other.titleStyle) ?? other.titleStyle,
|
titleStyle: titleStyle?.merge(other.titleStyle) ?? other.titleStyle,
|
||||||
|
|||||||
Reference in New Issue
Block a user