Skip to content

Commit 574876b

Browse files
committed
added deprecation warn for the field backGroundColor
1 parent c7bd578 commit 574876b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class _ChatScreenState extends State<ChatScreen> {
185185
textFieldBackgroundColor: theme.textFieldBackgroundColor,
186186
closeIconColor: theme.closeIconColor,
187187
textFieldConfig: TextFieldConfiguration(
188+
enableEnterToSubmit: true,
188189
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
189190
onMessageTyping: (status) {
190191
/// Do with status

lib/src/widgets/chat_view_appbar.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class ChatViewAppBar extends StatelessWidget {
3333
const ChatViewAppBar({
3434
Key? key,
3535
required this.chatTitle,
36-
this.backgroundColor = Colors.white,
36+
@Deprecated('Use backgroundColor instead') this.backGroundColor = Colors.white,
37+
this.backgroundColor,
3738
this.centerTitle = false,
3839
this.userStatus,
3940
this.profilePicture,
@@ -53,8 +54,12 @@ class ChatViewAppBar extends StatelessWidget {
5354
this.networkImageProgressIndicatorBuilder,
5455
}) : super(key: key);
5556

57+
/// [Deprecated] use [backgroundColor] instead, this will be removed in next versions
58+
@Deprecated('Use backgroundColor instead. This will be removed in future versions.')
59+
final Color backGroundColor;
60+
5661
/// Allow user to change colour of appbar.
57-
final Color backgroundColor;
62+
final Color? backgroundColor;
5863

5964
/// Allow user to center title of appbar.
6065
final bool centerTitle;
@@ -120,7 +125,7 @@ class ChatViewAppBar extends StatelessWidget {
120125
top: MediaQuery.of(context).padding.top,
121126
bottom: 4,
122127
),
123-
color: backgroundColor,
128+
color: backgroundColor ?? backGroundColor,
124129
child: Row(
125130
children: [
126131
if (showLeading)

0 commit comments

Comments
 (0)