add custom theme example

This commit is contained in:
Salvatore Giordano
2020-02-28 13:28:01 +01:00
parent 7dc7261a06
commit 2d7ea2d3cd
5 changed files with 96 additions and 87 deletions
+6 -14
View File
@@ -23,27 +23,19 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.green,
);
final streamTheme = StreamChatThemeData.fromTheme(theme);
return MaterialApp(
theme: theme,
home: Container(
child: StreamChat(
streamChatThemeData: streamTheme.copyWith(
channelPreviewTheme: ChannelPreviewTheme(
avatarTheme: AvatarTheme(
borderRadius: BorderRadius.circular(16),
),
),
streamChatThemeData: StreamChatThemeData.fromTheme(theme).copyWith(
ownMessageTheme: MessageTheme(
replies: streamTheme.ownMessageTheme.replies
.copyWith(fontStyle: FontStyle.italic),
messageBackgroundColor: Colors.black,
messageText: TextStyle(
color: Colors.white,
),
avatarTheme: AvatarTheme(
borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(8),
),
),
otherMessageTheme: MessageTheme(
messageBackgroundColor: Colors.red,
),
),
client: client,