feat: add color property for icon buttons in chat bottom

This commit is contained in:
FahadFahim71 2023-10-10 16:20:09 +02:00
parent 9b4ce62392
commit 60bcd1c26a
7 changed files with 28 additions and 10 deletions

View file

@ -1,4 +1,9 @@
## 0.3.3 - October 10 2023
- Add icon color property for icon buttons
## 0.3.2 - September 26 2023 ## 0.3.2 - September 26 2023
- Fix fullname getter for nullable values - Fix fullname getter for nullable values
## 0.3.1 - July 11 2023 ## 0.3.1 - July 11 2023

View file

@ -1,6 +1,6 @@
name: flutter_community_chat name: flutter_community_chat
description: A new Flutter package project. description: A new Flutter package project.
version: 0.3.1 version: 0.3.3
publish_to: none publish_to: none
@ -15,12 +15,12 @@ dependencies:
git: git:
url: https://github.com/Iconica-Development/flutter_community_chat.git url: https://github.com/Iconica-Development/flutter_community_chat.git
path: packages/flutter_community_chat_view path: packages/flutter_community_chat_view
ref: 0.3.1 ref: 0.3.3
flutter_community_chat_interface: flutter_community_chat_interface:
git: git:
url: https://github.com/Iconica-Development/flutter_community_chat.git url: https://github.com/Iconica-Development/flutter_community_chat.git
path: packages/flutter_community_chat_interface path: packages/flutter_community_chat_interface
ref: 0.3.1 ref: 0.3.3
dev_dependencies: dev_dependencies:
flutter_lints: ^2.0.0 flutter_lints: ^2.0.0

View file

@ -1,6 +1,6 @@
name: flutter_community_chat_firebase name: flutter_community_chat_firebase
description: A new Flutter package project. description: A new Flutter package project.
version: 0.3.1 version: 0.3.3
publish_to: none publish_to: none
environment: environment:
@ -19,7 +19,7 @@ dependencies:
git: git:
url: https://github.com/Iconica-Development/flutter_community_chat.git url: https://github.com/Iconica-Development/flutter_community_chat.git
path: packages/flutter_community_chat_interface path: packages/flutter_community_chat_interface
ref: 0.3.1 ref: 0.3.3
dev_dependencies: dev_dependencies:
flutter_lints: ^2.0.0 flutter_lints: ^2.0.0

View file

@ -1,6 +1,6 @@
name: flutter_community_chat_interface name: flutter_community_chat_interface
description: A new Flutter package project. description: A new Flutter package project.
version: 0.3.2 version: 0.3.3
publish_to: none publish_to: none
environment: environment:

View file

@ -12,6 +12,7 @@ class ChatBottom extends StatefulWidget {
required this.messageInputBuilder, required this.messageInputBuilder,
required this.translations, required this.translations,
this.onPressSelectImage, this.onPressSelectImage,
this.iconColor,
super.key, super.key,
}); });
@ -20,6 +21,7 @@ class ChatBottom extends StatefulWidget {
final VoidCallback? onPressSelectImage; final VoidCallback? onPressSelectImage;
final ChatModel chat; final ChatModel chat;
final ChatTranslations translations; final ChatTranslations translations;
final Color? iconColor;
@override @override
State<ChatBottom> createState() => _ChatBottomState(); State<ChatBottom> createState() => _ChatBottomState();
@ -45,7 +47,10 @@ class _ChatBottomState extends State<ChatBottom> {
children: [ children: [
IconButton( IconButton(
onPressed: widget.onPressSelectImage, onPressed: widget.onPressSelectImage,
icon: const Icon(Icons.image), icon: Icon(
Icons.image,
color: widget.iconColor,
),
), ),
IconButton( IconButton(
onPressed: () { onPressed: () {
@ -56,7 +61,10 @@ class _ChatBottomState extends State<ChatBottom> {
_textEditingController.clear(); _textEditingController.clear();
} }
}, },
icon: const Icon(Icons.send), icon: Icon(
Icons.send,
color: widget.iconColor,
),
), ),
], ],
), ),

View file

@ -19,6 +19,7 @@ class ChatDetailScreen extends StatelessWidget {
this.chat, this.chat,
this.chatMessages, this.chatMessages,
this.onPressChatTitle, this.onPressChatTitle,
this.iconColor,
super.key, super.key,
}); });
@ -30,6 +31,9 @@ class ChatDetailScreen extends StatelessWidget {
final Future<void> Function(String text) onMessageSubmit; final Future<void> Function(String text) onMessageSubmit;
final VoidCallback? onPressChatTitle; final VoidCallback? onPressChatTitle;
/// The color of the icon buttons in the chat bottom.
final Color? iconColor;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Future<void> onPressSelectImage() => showModalBottomSheet<Uint8List?>( Future<void> onPressSelectImage() => showModalBottomSheet<Uint8List?>(
@ -118,6 +122,7 @@ class ChatDetailScreen extends StatelessWidget {
onPressSelectImage: onPressSelectImage, onPressSelectImage: onPressSelectImage,
onMessageSubmit: onMessageSubmit, onMessageSubmit: onMessageSubmit,
translations: translations, translations: translations,
iconColor: iconColor,
), ),
], ],
), ),

View file

@ -4,7 +4,7 @@
name: flutter_community_chat_view name: flutter_community_chat_view
description: A standard flutter package. description: A standard flutter package.
version: 0.3.1 version: 0.3.3
publish_to: none publish_to: none
@ -20,7 +20,7 @@ dependencies:
git: git:
url: https://github.com/Iconica-Development/flutter_community_chat.git url: https://github.com/Iconica-Development/flutter_community_chat.git
path: packages/flutter_community_chat_interface path: packages/flutter_community_chat_interface
ref: 0.3.1 ref: 0.3.3
cached_network_image: ^3.2.2 cached_network_image: ^3.2.2
flutter_image_picker: flutter_image_picker:
git: git: