From cf2a5ace3a4fdcb3fe957a58f6c0ab293a055d43 Mon Sep 17 00:00:00 2001 From: Sofanyas Genene <123987957+Sofanyas@users.noreply.github.com> Date: Wed, 23 Apr 2025 15:18:11 -0400 Subject: [PATCH] =?UTF-8?q?The=C2=A0=5FiconSizeController=C2=A0was=20being?= =?UTF-8?q?=20accessed=20before=20it=20was=20initialized,=E2=80=A6=20(#254?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * The _iconSizeController was being accessed before it was initialized, initialized it in the initState method before _setSelected is called * generated --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- lib/pangea/message_token_text/message_token_button.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pangea/message_token_text/message_token_button.dart b/lib/pangea/message_token_text/message_token_button.dart index 8058ae4f0..325fb2901 100644 --- a/lib/pangea/message_token_text/message_token_button.dart +++ b/lib/pangea/message_token_text/message_token_button.dart @@ -65,13 +65,11 @@ class MessageTokenButtonState extends State @override void initState() { super.initState(); - _setSelected(); _controller = AnimationController( vsync: this, duration: const Duration( milliseconds: AppConfig.overlayAnimationDuration, - // seconds: 5, ), ); @@ -93,6 +91,8 @@ class MessageTokenButtonState extends State CurvedAnimation(parent: _iconSizeController, curve: Curves.easeInOut), ); + _setSelected(); // Call _setSelected after initializing _iconSizeController + _wasEmpty = _isEmpty; if (!_isEmpty) {