diff --git a/lib/view/pages/talk/chatView.dart b/lib/view/pages/talk/chatView.dart index 29e696b..a2c0c82 100644 --- a/lib/view/pages/talk/chatView.dart +++ b/lib/view/pages/talk/chatView.dart @@ -38,7 +38,11 @@ class _ChatViewState extends State { void _query({bool renew = false}) { Provider.of(context, listen: false).setQueryToken(widget.room.token); } - + + bool isSameDay(DateTime date1, DateTime date2) { + return date1.year == date2.year && date1.month == date2.month && date1.day == date2.day; + } + @override Widget build(BuildContext context) { return Consumer( @@ -53,7 +57,7 @@ class _ChatViewState extends State { if(element.systemMessage.contains("reaction")) return; - if(elementDate.weekday != lastDate.weekday) { + if(!isSameDay(elementDate, lastDate)) { lastDate = elementDate; messages.add(ChatBubble( context: context, diff --git a/lib/view/pages/talk/components/chatTextfield.dart b/lib/view/pages/talk/components/chatTextfield.dart index c3170fb..9aea0b9 100644 --- a/lib/view/pages/talk/components/chatTextfield.dart +++ b/lib/view/pages/talk/components/chatTextfield.dart @@ -154,7 +154,7 @@ class _ChatTextfieldState extends State { ), cursorColor: Colors.white, onChanged: (String text) { - if(text == "marbot marbot marbot") { + if(text.trim().toLowerCase() == "marbot marbot marbot") { var newText = "Roboter sind cool und so, aber marbots sind besser!"; _textBoxController.text = newText; text = newText;