Merge branch 'feature/new-ui' of https://github.com/GetStream/stream-chat-flutter into feature/flag

 Conflicts:
	lib/src/message_actions_modal.dart
	lib/src/message_list_view.dart
	lib/src/message_widget.dart
This commit is contained in:
Deven Joshi
2021-01-11 21:38:12 +05:30
18 changed files with 458 additions and 320 deletions
+15 -2
View File
@@ -1,10 +1,10 @@
import 'package:emojis/emoji.dart';
import 'package:flutter/material.dart';
import 'package:stream_chat/stream_chat.dart';
import 'package:url_launcher/url_launcher.dart';
import 'stream_svg_icon.dart';
import '../stream_chat_flutter.dart';
import 'stream_svg_icon.dart';
Future<void> launchURL(BuildContext context, String url) async {
if (await canLaunch(url)) {
@@ -289,3 +289,16 @@ StreamSvgIcon getFileTypeImage(String type) {
break;
}
}
final _emojis = Emoji.all();
bool textIsOnlyEmoji(String text) {
return text.trim().characters.isNotEmpty &&
text.trim().characters.every((c) =>
_emojis.firstWhere(
(Emoji emoji) => emoji.char.contains(c),
orElse: () => null,
) !=
null) &&
text.characters.length < 4;
}