The _iconSizeController was being accessed before it was initialized,… (#2541)

* 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>
This commit is contained in:
Sofanyas Genene 2025-04-23 15:18:11 -04:00 committed by GitHub
parent a3c74692c9
commit cf2a5ace3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,13 +65,11 @@ class MessageTokenButtonState extends State<MessageTokenButton>
@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<MessageTokenButton>
CurvedAnimation(parent: _iconSizeController, curve: Curves.easeInOut),
);
_setSelected(); // Call _setSelected after initializing _iconSizeController
_wasEmpty = _isEmpty;
if (!_isEmpty) {