Line data Source code
1 : import 'package:flutter/material.dart';
2 : import 'package:flutter_chat_ui/flutter_chat_ui.dart';
3 :
4 : const CHATWOOT_COLOR_PRIMARY = Color(0xff1f93ff);
5 : const CHATWOOT_BG_COLOR = Color(0xfff7f0fc);
6 : const CHATWOOT_AVATAR_COLORS = [CHATWOOT_COLOR_PRIMARY];
7 :
8 : /// Default chatwoot chat theme which extends [ChatTheme]
9 : @immutable
10 : class ChatwootChatTheme extends ChatTheme {
11 : /// Creates a chatwoot chat theme. Use this constructor if you want to
12 : /// override only a couple of variables.
13 0 : const ChatwootChatTheme({
14 : Widget? attachmentButtonIcon,
15 : Color backgroundColor = CHATWOOT_BG_COLOR,
16 : TextStyle dateDividerTextStyle = const TextStyle(
17 : color: Colors.black26,
18 : fontSize: 12,
19 : fontWeight: FontWeight.w800,
20 : height: 1.333,
21 : ),
22 : Widget? deliveredIcon,
23 : Widget? documentIcon,
24 : TextStyle emptyChatPlaceholderTextStyle = const TextStyle(
25 : color: NEUTRAL_2,
26 : fontSize: 16,
27 : fontWeight: FontWeight.w500,
28 : height: 1.5,
29 : ),
30 : Color errorColor = ERROR,
31 : Widget? errorIcon,
32 : Color inputBackgroundColor = Colors.white,
33 : BorderRadius inputBorderRadius = const BorderRadius.all(
34 : Radius.circular(10),
35 : ),
36 : Color inputTextColor = Colors.black87,
37 : TextStyle inputTextStyle = const TextStyle(
38 : fontSize: 16,
39 : fontWeight: FontWeight.w500,
40 : height: 1.5,
41 : ),
42 : double messageBorderRadius = 20.0,
43 : Color primaryColor = CHATWOOT_COLOR_PRIMARY,
44 : TextStyle receivedMessageBodyTextStyle = const TextStyle(
45 : color: Colors.black87,
46 : fontSize: 16,
47 : fontWeight: FontWeight.w500,
48 : height: 1.5,
49 : ),
50 : TextStyle receivedMessageCaptionTextStyle = const TextStyle(
51 : color: NEUTRAL_2,
52 : fontSize: 12,
53 : fontWeight: FontWeight.w500,
54 : height: 1.333,
55 : ),
56 : Color receivedMessageDocumentIconColor = PRIMARY,
57 : TextStyle receivedMessageLinkDescriptionTextStyle = const TextStyle(
58 : color: NEUTRAL_0,
59 : fontSize: 14,
60 : fontWeight: FontWeight.w400,
61 : height: 1.428,
62 : ),
63 : TextStyle receivedMessageLinkTitleTextStyle = const TextStyle(
64 : color: NEUTRAL_0,
65 : fontSize: 16,
66 : fontWeight: FontWeight.w800,
67 : height: 1.375,
68 : ),
69 : Color secondaryColor = Colors.white,
70 : Widget? seenIcon,
71 : Widget? sendButtonIcon,
72 : TextStyle sentMessageBodyTextStyle = const TextStyle(
73 : color: Colors.white,
74 : fontSize: 16,
75 : fontWeight: FontWeight.w500,
76 : height: 1.5,
77 : ),
78 : TextStyle sentMessageCaptionTextStyle = const TextStyle(
79 : color: NEUTRAL_7_WITH_OPACITY,
80 : fontSize: 12,
81 : fontWeight: FontWeight.w500,
82 : height: 1.333,
83 : ),
84 : Color sentMessageDocumentIconColor = NEUTRAL_7,
85 : TextStyle sentMessageLinkDescriptionTextStyle = const TextStyle(
86 : color: NEUTRAL_7,
87 : fontSize: 14,
88 : fontWeight: FontWeight.w400,
89 : height: 1.428,
90 : ),
91 : TextStyle sentMessageLinkTitleTextStyle = const TextStyle(
92 : color: NEUTRAL_7,
93 : fontSize: 16,
94 : fontWeight: FontWeight.w800,
95 : height: 1.375,
96 : ),
97 : List<Color> userAvatarNameColors = CHATWOOT_AVATAR_COLORS,
98 : TextStyle userAvatarTextStyle = const TextStyle(
99 : color: NEUTRAL_7,
100 : fontSize: 12,
101 : fontWeight: FontWeight.w800,
102 : height: 1.333,
103 : ),
104 : TextStyle userNameTextStyle = const TextStyle(
105 : color: Colors.black87,
106 : fontSize: 12,
107 : fontWeight: FontWeight.w800,
108 : height: 1.333,
109 : ),
110 0 : }) : super(
111 : attachmentButtonIcon: attachmentButtonIcon,
112 : backgroundColor: backgroundColor,
113 : dateDividerTextStyle: dateDividerTextStyle,
114 : deliveredIcon: deliveredIcon,
115 : documentIcon: documentIcon,
116 : emptyChatPlaceholderTextStyle: emptyChatPlaceholderTextStyle,
117 : errorColor: errorColor,
118 : errorIcon: errorIcon,
119 : inputBackgroundColor: inputBackgroundColor,
120 : inputBorderRadius: inputBorderRadius,
121 : inputTextColor: inputTextColor,
122 : inputTextStyle: inputTextStyle,
123 : messageBorderRadius: messageBorderRadius,
124 : primaryColor: primaryColor,
125 : receivedMessageBodyTextStyle: receivedMessageBodyTextStyle,
126 : receivedMessageCaptionTextStyle: receivedMessageCaptionTextStyle,
127 : receivedMessageDocumentIconColor: receivedMessageDocumentIconColor,
128 : receivedMessageLinkDescriptionTextStyle:
129 : receivedMessageLinkDescriptionTextStyle,
130 : receivedMessageLinkTitleTextStyle: receivedMessageLinkTitleTextStyle,
131 : secondaryColor: secondaryColor,
132 : seenIcon: seenIcon,
133 : sendButtonIcon: sendButtonIcon,
134 : sentMessageBodyTextStyle: sentMessageBodyTextStyle,
135 : sentMessageCaptionTextStyle: sentMessageCaptionTextStyle,
136 : sentMessageDocumentIconColor: sentMessageDocumentIconColor,
137 : sentMessageLinkDescriptionTextStyle:
138 : sentMessageLinkDescriptionTextStyle,
139 : sentMessageLinkTitleTextStyle: sentMessageLinkTitleTextStyle,
140 : userAvatarNameColors: userAvatarNameColors,
141 : userAvatarTextStyle: userAvatarTextStyle,
142 : userNameTextStyle: userNameTextStyle,
143 : );
144 : }
|