feat: Changed sending indicator icons to svg icons

This commit is contained in:
Deven Joshi
2021-01-06 18:33:31 +05:30
parent c9ee6bfb25
commit ee0cdf567b
5 changed files with 36 additions and 21 deletions
+2
View File
@@ -157,6 +157,7 @@ class ChannelListView extends StatefulWidget {
class _ChannelListViewState extends State<ChannelListView> class _ChannelListViewState extends State<ChannelListView>
with WidgetsBindingObserver { with WidgetsBindingObserver {
final ScrollController _scrollController = ScrollController(); final ScrollController _scrollController = ScrollController();
final SlidableController _slideController = SlidableController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -562,6 +563,7 @@ class _ChannelListViewState extends State<ChannelListView>
final backgroundColor = final backgroundColor =
StreamChatTheme.of(context).colorTheme.whiteSmoke; StreamChatTheme.of(context).colorTheme.whiteSmoke;
child = Slidable( child = Slidable(
controller: _slideController,
enabled: widget.swipeToAction, enabled: widget.swipeToAction,
actionPane: SlidableBehindActionPane(), actionPane: SlidableBehindActionPane(),
actionExtentRatio: 0.12, actionExtentRatio: 0.12,
+1 -2
View File
@@ -104,8 +104,7 @@ class ChannelPreview extends StatelessWidget {
message: channel.state.lastMessage, message: channel.state.lastMessage,
size: StreamChatTheme.of(context) size: StreamChatTheme.of(context)
.channelPreviewTheme .channelPreviewTheme
.lastMessageAt .indicatorIconSize,
.fontSize,
isMessageRead: channel.state.read isMessageRead: channel.state.read
?.where((element) => ?.where((element) =>
element.user.id != element.user.id !=
+2 -4
View File
@@ -17,15 +17,13 @@ class SendingIndicator extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (isMessageRead) { if (isMessageRead) {
return Icon( return StreamSvgIcon.checkAll(
Icons.done_all_rounded,
size: size, size: size,
color: StreamChatTheme.of(context).colorTheme.accentBlue, color: StreamChatTheme.of(context).colorTheme.accentBlue,
); );
} }
if (message.status == MessageSendingStatus.SENT || message.status == null) { if (message.status == MessageSendingStatus.SENT || message.status == null) {
return Icon( return StreamSvgIcon.check(
Icons.done,
size: size, size: size,
color: IconTheme.of(context).color.withOpacity(0.5), color: IconTheme.of(context).color.withOpacity(0.5),
); );
+19 -15
View File
@@ -227,22 +227,22 @@ class StreamChatThemeData {
), ),
), ),
channelPreviewTheme: ChannelPreviewTheme( channelPreviewTheme: ChannelPreviewTheme(
unreadCounterColor: colorTheme.accentRed, unreadCounterColor: colorTheme.accentRed,
avatarTheme: AvatarTheme( avatarTheme: AvatarTheme(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
constraints: BoxConstraints.tightFor( constraints: BoxConstraints.tightFor(
height: 40, height: 40,
width: 40, width: 40,
),
), ),
), title: textTheme.bodyBold,
title: textTheme.bodyBold, subtitle: textTheme.footnote.copyWith(
subtitle: textTheme.footnote.copyWith( color: Color(0xff7A7A7A),
color: Color(0xff7A7A7A), ),
), lastMessageAt: textTheme.footnote.copyWith(
lastMessageAt: textTheme.footnote.copyWith( color: colorTheme.black.withOpacity(.5),
color: colorTheme.black.withOpacity(.5), ),
), indicatorIconSize: 16.0),
),
channelTheme: ChannelTheme( channelTheme: ChannelTheme(
messageInputButtonIconTheme: theme.iconTheme.copyWith( messageInputButtonIconTheme: theme.iconTheme.copyWith(
color: accentColor, color: accentColor,
@@ -698,6 +698,7 @@ class ChannelPreviewTheme {
final TextStyle lastMessageAt; final TextStyle lastMessageAt;
final AvatarTheme avatarTheme; final AvatarTheme avatarTheme;
final Color unreadCounterColor; final Color unreadCounterColor;
final double indicatorIconSize;
const ChannelPreviewTheme({ const ChannelPreviewTheme({
this.title, this.title,
@@ -705,6 +706,7 @@ class ChannelPreviewTheme {
this.lastMessageAt, this.lastMessageAt,
this.avatarTheme, this.avatarTheme,
this.unreadCounterColor, this.unreadCounterColor,
this.indicatorIconSize,
}); });
ChannelPreviewTheme copyWith({ ChannelPreviewTheme copyWith({
@@ -713,6 +715,7 @@ class ChannelPreviewTheme {
TextStyle lastMessageAt, TextStyle lastMessageAt,
AvatarTheme avatarTheme, AvatarTheme avatarTheme,
Color unreadCounterColor, Color unreadCounterColor,
double indicatorIconSize,
}) => }) =>
ChannelPreviewTheme( ChannelPreviewTheme(
title: title ?? this.title, title: title ?? this.title,
@@ -720,6 +723,7 @@ class ChannelPreviewTheme {
lastMessageAt: lastMessageAt ?? this.lastMessageAt, lastMessageAt: lastMessageAt ?? this.lastMessageAt,
avatarTheme: avatarTheme ?? this.avatarTheme, avatarTheme: avatarTheme ?? this.avatarTheme,
unreadCounterColor: unreadCounterColor ?? this.unreadCounterColor, unreadCounterColor: unreadCounterColor ?? this.unreadCounterColor,
indicatorIconSize: indicatorIconSize ?? this.indicatorIconSize,
); );
} }
+12
View File
@@ -194,6 +194,18 @@ class StreamSvgIcon extends StatelessWidget {
); );
} }
factory StreamSvgIcon.checkAll({
double size,
Color color,
}) {
return StreamSvgIcon(
assetName: 'Icon_check_all.svg',
color: color,
width: size,
height: size,
);
}
factory StreamSvgIcon.penWrite({ factory StreamSvgIcon.penWrite({
double size, double size,
Color color, Color color,