mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 11:18:41 +00:00
fix console spaming error messages
This commit is contained in:
parent
636d4de1b6
commit
2b4ba6b81b
1 changed files with 41 additions and 44 deletions
|
|
@ -69,8 +69,7 @@ class ChatMessagesView extends StatefulWidget {
|
|||
State<ChatMessagesView> createState() => _ChatMessagesViewState();
|
||||
}
|
||||
|
||||
class _ChatMessagesViewState extends State<ChatMessagesView>
|
||||
with SingleTickerProviderStateMixin {
|
||||
class _ChatMessagesViewState extends State<ChatMessagesView> {
|
||||
TextEditingController newMessageController = TextEditingController();
|
||||
HashSet<int> alreadyReportedOpened = HashSet<int>();
|
||||
late Contact user;
|
||||
|
|
@ -86,7 +85,6 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
|
|||
Timer? tutorial;
|
||||
final ItemScrollController itemScrollController = ItemScrollController();
|
||||
int? focusedScrollItem;
|
||||
late AnimationController _animationController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
@ -95,11 +93,6 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
|
|||
textFieldFocus = FocusNode();
|
||||
initStreams();
|
||||
|
||||
_animationController = AnimationController(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
vsync: this,
|
||||
);
|
||||
|
||||
tutorial = Timer(const Duration(seconds: 1), () async {
|
||||
tutorial = null;
|
||||
if (!mounted) return;
|
||||
|
|
@ -262,19 +255,18 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
|
|||
final index = messages.indexWhere(
|
||||
(x) => x.isMessage && x.message!.message.messageId == messageId);
|
||||
if (index == -1) return;
|
||||
await itemScrollController.scrollTo(
|
||||
index: index,
|
||||
duration: const Duration(milliseconds: 400),
|
||||
alignment: 0.5,
|
||||
);
|
||||
setState(() {
|
||||
focusedScrollItem = index;
|
||||
_animationController.forward().then((_) {
|
||||
_animationController.reverse().then((_) {
|
||||
});
|
||||
await itemScrollController.scrollTo(
|
||||
index: index,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
alignment: 0.5,
|
||||
);
|
||||
Future.delayed(const Duration(milliseconds: 250), () {
|
||||
if (!context.mounted) return;
|
||||
setState(() {
|
||||
_animationController.value = 0.0;
|
||||
});
|
||||
});
|
||||
focusedScrollItem = null;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -336,18 +328,22 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
|
|||
);
|
||||
} else {
|
||||
final chatMessage = messages[i].message!;
|
||||
return ScaleTransition(
|
||||
scale: Tween<double>(
|
||||
begin: 1,
|
||||
end: (focusedScrollItem == i) ? 1.03 : 1)
|
||||
.animate(
|
||||
CurvedAnimation(
|
||||
parent: _animationController,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
),
|
||||
return Transform.translate(
|
||||
offset: Offset((focusedScrollItem == i) ? -3 : 0, 0),
|
||||
child: Transform.scale(
|
||||
scale: (focusedScrollItem == i) ? 1.03 : 1,
|
||||
// scale: Tween<double>(
|
||||
// begin: 1,
|
||||
// end: (focusedScrollItem == i) ? 1.03 : 1)
|
||||
// .animate(
|
||||
// CurvedAnimation(
|
||||
// parent: _animationController,
|
||||
// curve: Curves.easeInOut,
|
||||
// ),
|
||||
// ),
|
||||
child: ChatListEntry(
|
||||
key: Key(chatMessage.message.messageId.toString()),
|
||||
key:
|
||||
Key(chatMessage.message.messageId.toString()),
|
||||
chatMessage,
|
||||
user,
|
||||
galleryItems,
|
||||
|
|
@ -363,6 +359,7 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
|
|||
textFieldFocus.requestFocus();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue